File libqca2.spec of Package libqca2

#
# spec file for package libqca2 (Version 2.0.1)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           libqca2
BuildRequires:  cmake libdrm-devel libjpeg-devel libqt4-devel openssl-devel
BuildRequires:  kde4-filesystem update-desktop-files
BuildRequires:  cyrus-sasl-devel gpg2 libgcrypt-devel mozilla-nss-devel
%if %suse_version < 1030
BuildRequires:  gmp-devel
%define my_subdirs qca-gnupg-* qca-ossl-* qca-cyrus-sasl-*
%define with_pkcs11 0
%else
%define my_subdirs qca-gnupg-* qca-ossl-* qca-pkcs11-* qca-cyrus-sasl-*
%define with_pkcs11 1
BuildRequires:  pkcs11-helper-devel
%endif
BuildRequires:  libbotan-devel
License:        LGPL v2.1 or later
Group:          Development/Libraries/C and C++
Summary:        Qt Cryptographic Architecture 2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Url:            http://delta.affinix.com/qca/
Version:        2.0.1
Release:        1
%define tar_version %version
%define with_botan 0
%define with_nss 0
Source:         qca-%{tar_version}.tar.bz2
Source1:        qca-cyrus-sasl-2.0.0-beta3.tar.bz2
Source2:        qca-gnupg-2.0.0-beta3.tar.bz2
Source3:        qca-ossl-2.0.0-beta3.tar.bz2
Source4:        qca-pkcs11-2.0.0-beta2.tar.bz2
%if %suse_version > 1020
Requires:       gpg2 >= 2.0.0
%endif

%description
This package provides a generic Qt cryptographic architecture,
including a library and a plug-in for using all supported capabilities
of openssl, like SSL/TLS, X509, RSA, SHA1, MD5, Blowfish, 3DES, and
AES.

It can be extended by further plug-ins, for example, with qca-sasl for
SASL support.



Authors:
--------
    Justin Karneges <justin@affinix.com>

%package devel
License:        LGPL v2.1 or later
Summary:        Qt Cryptographic Architecture 2
Group:          Development/Libraries/C and C++
Requires:       %name = %version
Requires:       libqt4-devel Botan-devel

%description devel
This package provides a generic Qt cryptographic architecture,
including a library and a plugin for using all supported capabilities
of openssl, like SSL/TLS, X509, RSA, SHA1, MD5, Blowfish, 3DES and AES.



Authors:
--------
    Justin Karneges <justin@affinix.com>

%package plugin-cyrus-sasl
License:        LGPL v2.1 or later
Summary:        Qt Cryptographic Architecture 2
Group:          Development/Libraries/C and C++
Requires:       %name = %version

%description plugin-cyrus-sasl
This package provides a generic Qt cryptographic architecture,
including a library and a plug-in for using all supported capabilities
of openssl, like SSL/TLS, X509, RSA, SHA1, MD5, Blowfish, 3DES, and
AES.

It can be extended by further plug-ins, for example, with qca-sasl for
SASL support.



Authors:
--------
    Justin Karneges <justin@affinix.com>

%if %with_botan

%package plugin-botan
License:        LGPL v2.1 or later
Summary:        Qt Cryptographic Architecture 2
Group:          Development/Libraries/C and C++
Requires:       %name = %version
Provides:       %name:%{_libdir}/qt4/plugins/crypto/libqca-botan.so

%description plugin-botan
This package provides a generic Qt cryptographic architecture,
including a library and a plug-in for using all supported capabilities
of openssl, like SSL/TLS, X509, RSA, SHA1, MD5, Blowfish, 3DES, and
AES.

It can be extended by further plug-ins, for example, with qca-sasl for
SASL support.



Authors:
--------
    Justin Karneges <justin@affinix.com>

%endif
%if %with_nss

%package plugin-nss
License:        LGPL v2.1 or later
Summary:        Qt Cryptographic Architecture 2
Group:          Development/Libraries/C and C++
Requires:       %name = %version

%description plugin-nss
This package provides a generic Qt cryptographic architecture,
including a library and a plug-in for using all supported capabilities
of openssl, like SSL/TLS, X509, RSA, SHA1, MD5, Blowfish, 3DES, and
AES.

It can be extended by further plug-ins, for example, with qca-sasl for
SASL support.



Authors:
--------
    Justin Karneges <justin@affinix.com>

%endif
%if %with_pkcs11

%package plugin-pkcs11
License:        LGPL v2.1 or later
Summary:        Qt Cryptographic Architecture 2 - pkcs11 support
Group:          Development/Libraries/C and C++
Requires:       %name = %version

%description plugin-pkcs11
This package provides a generic Qt cryptographic architecture,
including a library and a plug-in for using all supported capabilities
of openssl, like SSL/TLS, X509, RSA, SHA1, MD5, Blowfish, 3DES, and
AES.

It can be extended by further plug-ins, for example, with qca-sasl for
SASL support.



Authors:
--------
    Justin Karneges <justin@affinix.com>

%endif

%prep
%setup  -c -n qca-%{tar_version}/plugins -a 1 -a 2 -a 3 -a 4
cd ../../..
%setup -D -q -n qca-%{tar_version}

%build
pushd plugins
rm -rf CMakeLists.txt qca-%version
for i in *; do
  echo "add_subdirectory($i)" >> CMakeLists.txt
done
popd
export CXXFLAGS="$RPM_OPT_FLAGS"
export CFLAGS="$RPM_OPT_FLAGS"
EXTRA_FLAGS=""
if [ %_lib = lib64 ]; then
  EXTRA_FLAGS="$EXTRA_FLAGS -DLIB_SUFFIX=64"
fi
#cmake . -DCMAKE_CXXFLAGS="$RPM_OPT_FLAGS" -DCMAKE_CFLAGS="$RPM_OPT_FLAGS" -DCMAKE_INSTALL_PREFIX=/usr $EXTRA_FLAGS
./configure --prefix=%_prefix --libdir=%_libdir --debug --no-separate-debug-info
make %{?jobs:-j %jobs}
export LD_LIBRARY_PATH=$PWD/lib
cd plugins
for sub in %my_subdirs; do
pushd $sub
  ./configure --debug --no-separate-debug-info --with-qca=$PWD/../.. --verbose
  make %{?jobs:-j %jobs}
popd
done

%install
make INSTALL_ROOT=$RPM_BUILD_ROOT install
rm apidocs/html/installdox
cd plugins
for sub in %my_subdirs; do
pushd $sub
  make INSTALL_ROOT=$RPM_BUILD_ROOT install
popd
done
mkdir -p $RPM_BUILD_ROOT/%_libdir/pkgconfig

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc README COPYING TODO
%{_libdir}/libqca.so.*
%dir %{_libdir}/qt4/plugins/crypto
#%{_libdir}/qt4/plugins/crypto/libqca-logger.so
#%{_libdir}/qt4/plugins/crypto/libqca-softstore.so
%{_libdir}/qt4/plugins/crypto/libqca-ossl.so
%{_libdir}/qt4/plugins/crypto/libqca-gnupg.so
#%{_libdir}/qt4/plugins/crypto/libqca-gcrypt.so
/usr/share/qca/certs/
%dir /usr/share/qca

%files devel
%defattr(-,root,root)
%doc apidocs/html
/usr/bin/qcatool2
/usr/include/QtCrypto
/usr/share/qt4/mkspecs/features/crypto.prf
/usr/share/man/man1/qcatool2*
%{_libdir}/libqca.so
%{_libdir}/libqca.prl
%_libdir/pkgconfig/qca2.pc

%files plugin-cyrus-sasl
%defattr(-,root,root)
%{_libdir}/qt4/plugins/crypto/libqca-cyrus-sasl.so
%if %with_botan

%files plugin-botan
%defattr(-,root,root)
%{_libdir}/qt4/plugins/crypto/libqca-botan.so
%endif
%if %with_nss

%files plugin-nss
%defattr(-,root,root)
%{_libdir}/qt4/plugins/crypto/libqca-nss.so
%endif
%if %with_pkcs11

%files plugin-pkcs11
%defattr(-,root,root)
%_libdir/qt4/plugins/crypto/libqca-pkcs11.so
%endif

%changelog
* Fri Aug 29 2008 wstephenson@suse.de
- update to 2.0.1
  * Bugfix release
  * the pkgconfig file is always qca2.pc, even in debug mode
  * Certificates containing wildcards are now matched properly
  * DirWatch/FileWatch now work
  * Keystore writes now work
  * Don't delete objects in their event handler (prevents Qt 4.4 warnings)
  * Fix potential hang with TLS in server mode
- improve packaging
* Mon Jul 07 2008 dmueller@suse.de
- update qca providers to latest beta release (bnc#379500)
* Sat Oct 20 2007 dmueller@suse.de
- only move the pkgconfig file for lib64 archs
* Thu Oct 18 2007 dmueller@suse.de
- build fix
* Thu Oct 18 2007 dmueller@suse.de
- improve packaging
* Wed Oct 17 2007 dmueller@suse.de
- update to 2.0.0 final:
  - Rewritten for Qt 4
  - MAC algorithms
  - DSA
  - Diffie-Hellman
  - Secure random
  - Secure memory
  - Extensive X.509 API, supporting chains, crls, and validation
  - Smart cards and other key storage
  - OpenPGP
  - Cryptographic Message Syntax (for S/MIME)
  - probably more
* Tue Aug 28 2007 dmueller@suse.de
- update to 2.0.0-test1:
  * finalized API
* Mon Aug 06 2007 aj@suse.de
- Botan-devel -> libbotan-devel
* Fri Aug 03 2007 dmueller@suse.de
- update to svn695914
- build plugins modular
- add nss, gcrypt, gnupg and cyrus-sasl plugins
* Mon Jun 25 2007 dmueller@suse.de
- update to svn revision680219
* Thu May 31 2007 dmueller@suse.de
- update to svn670229 to fix compilation with gcc 4.3
* Mon Apr 23 2007 dmueller@suse.de
- build against system Botan
* Thu Apr 19 2007 dmueller@suse.de
- spec file cleanup
* Sun Apr 15 2007 dmueller@suse.de
- fix build
* Wed Apr 11 2007 dmueller@suse.de
- fix -devel package requires
* Thu Apr 05 2007 dmueller@suse.de
- remove examples from devel package
* Tue Jan 23 2007 dmueller@suse.de
- fix build on lib64 platforms
* Mon Jan 22 2007 dmueller@suse.de
- Initial package (SVN r626102)
openSUSE Build Service is sponsored by