LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File libqca2.spec of Package libqca2 (Project openSUSE:Factory)

#
# spec file for package libqca2
#
# Copyright (c) 2012 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/
#



Name:           libqca2
BuildRequires:  cmake
BuildRequires:  cyrus-sasl-devel
BuildRequires:  gpg2
BuildRequires:  kde4-filesystem
BuildRequires:  libdrm-devel
BuildRequires:  libgcrypt-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libqt4-devel
BuildRequires:  openssl-devel
BuildRequires:  update-desktop-files
Summary:        Qt Cryptographic Architecture 2
License:        LGPL-2.1+
Group:          Development/Libraries/C and C++
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Url:            http://delta.affinix.com/qca/
Version:        2.0.3
Release:        0
%define tar_version %{version}
%define my_subdirs qca-gnupg-* qca-ossl-* qca-pkcs11-* qca-cyrus-sasl-*
%define with_botan 0
%define with_nss 0
%define with_pkcs11 1
%if %with_botan
BuildRequires:  libbotan-devel
%endif
%if %with_pkcs11
BuildRequires:  mozilla-nss-devel
%endif
%if %with_pkcs11
BuildRequires:  pkcs11-helper-devel
%endif
Source:         http://delta.affinix.com/download/qca/2.0/qca-%{tar_version}.tar.bz2
Source1:        http://delta.affinix.com/download/qca/2.0/plugins/qca-cyrus-sasl-2.0.0-beta3.tar.bz2
Source2:        http://delta.affinix.com/download/qca/2.0/plugins/qca-gnupg-2.0.0-beta3.tar.bz2
Source3:        http://delta.affinix.com/download/qca/2.0/plugins/qca-ossl-2.0.0-beta3.tar.bz2
Source4:        http://delta.affinix.com/download/qca/2.0/plugins/qca-pkcs11-2.0.0-beta2.tar.bz2
Source5:        baselibs.conf
Patch0:         fix-qt-check.diff
Patch1:         r928413.diff
Patch2:         disable-insecure-ssl.diff
Patch3:         qca-2.0.3-gcc47.patch
Requires:       gpg2 >= 2.0.0
%requires_eq    libqt4

%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
Summary:        Qt Cryptographic Architecture 2
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       libqt4-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
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
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
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
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 -q -c -n qca-%{tar_version}/plugins -a 1 -a 2 -a 3 -a 4
pushd qca-gnupg-*
%patch0
popd
pushd qca-ossl-*
%patch2
popd
cd ../../..
%setup -D -q -n qca-%{tar_version}
%patch1
%patch3

%build
# I confess this is ugly..
# but there are too many "pro" files to make a patch ( > 180)
find -type f -name "*.pro" -exec sed -i "1i QMAKE_CXXFLAGS +=$RPM_OPT_FLAGS -fvisibility-inlines-hidden" {} +
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"
export EXTRA_FLAGS="$RPM_OPT_FLAGS -fvisibility-inlines-hidden"
export QMAKE_CXXFLAGS="$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
# no baselibs supplements for older distros
%if %suse_version < 1110
  sed -i -e 's, supplements .*,,' $RPM_SOURCE_DIR/baselibs.conf
%endif

%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
%dir %{_datadir}/qca
%{_datadir}/qca/certs/

%files devel
%defattr(-,root,root)
%doc apidocs/html
%{_bindir}/qcatool2
%{_includedir}/QtCrypto
%{_datadir}/qt4/mkspecs/features/crypto.prf
%{_mandir}/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