Name:           qca2
Version:        2.2.1
Release:        1%{?_dist_release}
Summary:        Qt Cryptographic Architecture
Summary(ja):    Qt 暗号アーキテクチャ
Group:          System Environment/Libraries

Vendor:         Project Vine
Distribution:   Vine Linux

License:        LGPLv2+
URL:            https://userbase.kde.org/QCA
Source0:        http://download.kde.org/stable/qca/%{version}/qca-%{version}.tar.xz

BuildRoot:      %{_tmppath}/%{name}-%{version}-root
BuildRequires:  pkgconfig
BuildRequires:  cmake
BuildRequires:  extra-cmake-modules
BuildRequires:  qt5-rpm-macros
BuildRequires:  openssl-devel
BuildRequires:  qt4-devel
BuildRequires:  qt5-qtbase-devel
Provides:       qca-qt4 = %{version}-%{release}

%description
Taking a hint from the similarly-named Java Cryptography Architecture,
QCA aims to provide a straightforward and cross-platform crypto API,
using Qt datatypes and conventions. QCA separates the API from the
implementation, using plugins known as Providers. The advantage of this
model is to allow applications to avoid linking to or explicitly depending
on any particular cryptographic library. This allows one to easily change
or upgrade crypto implementations without even needing to recompile the
application!


%package        devel
Summary:        Qt Cryptographic Architecture development files
Summary(ja):    Qt 暗号アーキテクチャの開発用ファイル
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       qt4-devel >= %{_qt4_version}
Provides:       qca-qt4-devel = %{version}-%{release}

%description    devel
This packages contains the development files for QCA


%package -n     qca2-qt5
Summary:        Qt5 Cryptographic Architecture
Summary(ja):    Qt5 暗号アーキテクチャ
Group:          System Environment/Libraries
Provides:       qca-qt5 = %{version}-%{release}

%description -n qca2-qt5
Taking a hint from the similarly-named Java Cryptography Architecture,
QCA aims to provide a straightforward and cross-platform crypto API,
using Qt datatypes and conventions. QCA separates the API from the
implementation, using plugins known as Providers. The advantage of this
model is to allow applications to avoid linking to or explicitly depending
on any particular cryptographic library. This allows one to easily change
or upgrade crypto implementations without even needing to recompile the
application!


%package -n     qca2-qt5-devel
Summary:        Qt5 Cryptographic Architecture development files
Summary(ja):    Qt5 暗号アーキテクチャの開発用ファイル
Group:          Development/Libraries
Provides:       qca-qt5-devel = %{version}-%{release}
Requires:       qca2-qt5 = %{version}-%{release}
Requires:       qt5-qtbase-devel

%description -n qca2-qt5-devel
This packages contains the development files for QCA


%prep
%setup -q -n qca-%{version}

%build

mkdir build_qt5
pushd build_qt5

%{cmake} .. \
  -DQCA_BINARY_INSTALL_DIR:STRING=%{_bindir} \
  -DQCA_FEATURE_INSTALL_DIR:PATH=%{_qt5_archdatadir}/mkspecs/features \
  -DQCA_INCLUDE_INSTALL_DIR:PATH=%{_qt5_headerdir} \
  -DQCA_LIBRARY_INSTALL_DIR:PATH=%{_qt5_libdir} \
  -DQCA_PLUGINS_INSTALL_DIR:PATH=%{_qt5_plugindir} \
  -DQCA_PRIVATE_INCLUDE_INSTALL_DIR:PATH=%{_qt5_headerdir} \
  -DQT4_BUILD:BOOL=OFF

make %{?_smp_mflags}
popd

mkdir build_qt4
pushd build_qt4
%{cmake} .. \
  -DQCA_BINARY_INSTALL_DIR:STRING=%{_bindir} \
  -DQCA_FEATURE_INSTALL_DIR:PATH=%{_qt4_prefix}/mkspecs/features \
  -DQCA_INCLUDE_INSTALL_DIR:PATH=%{_qt4_headerdir} \
  -DQCA_LIBRARY_INSTALL_DIR:PATH=%{_qt4_libdir} \
  -DQCA_PLUGINS_INSTALL_DIR:PATH=%{_qt4_plugindir} \
  -DQCA_PRIVATE_INCLUDE_INSTALL_DIR:PATH=%{_qt4_headerdir} \
  -DQT4_BUILD:BOOL=ON

make %{?_smp_mflags}
popd


%install
rm -rf %{buildroot}
make install/fast DESTDIR=%{buildroot} -C build_qt5
make install/fast DESTDIR=%{buildroot} -C build_qt4


%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%post -n qca2-qt5 -p /sbin/ldconfig
%postun -n qca2-qt5 -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%license COPYING
%doc README TODO
%{_qt4_libdir}/libqca.so.2*
%{_bindir}/mozcerts
%{_bindir}/qcatool
%{_mandir}/man1/qcatool.1*
%dir %{_qt4_plugindir}/crypto/
%{_qt4_plugindir}/crypto/*

%files devel
%defattr(-,root,root,-)
%{_includedir}/QtCrypto
%{_libdir}/libqca.so
%{_libdir}/pkgconfig/qca2.pc
%{_libdir}/cmake/Qca/
%{_qt4_datadir}/mkspecs/features/crypto.prf

%files -n qca2-qt5
%doc README TODO
%license COPYING
%{_bindir}/mozcerts-qt5
%{_bindir}/qcatool-qt5
%{_mandir}/man1/qcatool-qt5.1*
%{_qt5_libdir}/libqca-qt5.so.2*
%dir %{_qt5_plugindir}/crypto/
%{_qt5_plugindir}/crypto/*

%files -n qca2-qt5-devel
%{_qt5_headerdir}/QtCrypto
%{_qt5_libdir}/libqca-qt5.so
%{_libdir}/pkgconfig/qca2-qt5.pc
%{_libdir}/cmake/Qca-qt5/
%{_qt5_archdatadir}/mkspecs/features/crypto.prf


%changelog
* Sun Oct 27 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2.2.1-1
- new upstream release.
- added Qt5 support.

* Mon Jul 04 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 2.0.3-5
- rebuild with gcc-5.4.0

* Mon Feb  9 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> - 2.0.3-4
- rebuilt on current VineSeed
- added patch0 from Fedora
- added Japanese summary

* Sun Jan  8 2012 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.0.3-3
- rebuilt with qt-4.8.0

* Tue Mar  8 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.0.3-2
- rebuilt with qt-4.7.2

* Sun Jan 30 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.0.3-1
- new upstream release
- built with qt-4.7.1

* Mon Sep 20 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.0.2-8
- rebuilt with rpm-4.8.1

* Mon Aug 23 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 2.0.2-7
- rebuilt with qt-4.6.3 again
- change BuildRequires: qt4-devel = %{qt4_ver} (add version)

* Sat Jul 24 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.0.2-6
- rebuilt with qt-4.6.3

* Fri Feb 05 2010 Shu KONNO <owa@bg.wakwak.com> 2.0.2-5
- rebuilt with new toolchain, qt4-4.6.1

* Sun Nov 22 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.0.2-4
- rebuilt with qt-4.5.3

* Sun Aug 30 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.0.2-3
- Initial build for Vine Linux

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Tue May 05 2009 Sven Lankes <sven@lank.es> - 2.0.2-1
- new upstream release - qt 4.5-compat-fixes

* Wed Apr 08 2009 Sven Lankes <sven@lank.es> - 2.0.1-1
- new upstream release
- removed 64bit patch - now upstream

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Fri May 30 2008 Dennis Gilmore <dennis@ausil.us> - 2.0.0-3
- crypto.prf is in libdir not datadir

* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.0.0-2
- Autorebuild for GCC 4.3

* Sun Oct 21 2007 Aurelien Bompard <abompard@fedoraproject.org> 2.0.0-1
- version 2.0.0 final

* Sun Oct 21 2007 Aurelien Bompard <abompard@fedoraproject.org> 2.0.0-0.4.beta7
- fix build on x86_64

* Sun Oct 21 2007 Aurelien Bompard <abompard@fedoraproject.org> 2.0.0-0.3.beta7
- missing BR: openssl

* Thu Sep 13 2007 Aurelien Bompard <abompard@fedoraproject.org> 2.0.0-0.2.beta7
- review from bug 289681 (thanks Rex)

* Sun Sep 09 2007 Aurelien Bompard <abompard@fedoraproject.org> 2.0.0-0.1.beta7
- initial package 
