%define _qt4_datadir %(pkg-config --variable datadir --silence-errors Qt 2>/dev/null || echo %{_libdir}/qt4)

Name:           qca2
Summary:        Qt Cryptographic Architecture
Version:        2.0.3
Release:        3%{?_dist_release}

Group:          System Environment/Libraries
License:        LGPLv2+
URL:            http://delta.affinix.com/qca
Source0:        http://delta.affinix.com/download/qca/2.0/qca-%{version}.tar.bz2

BuildRoot:      %{_tmppath}/%{name}-%{version}-root
BuildRequires:  qt4-devel >= 4.2
BuildRequires:  pkgconfig

%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
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       qt4-devel >= %{_qt4_version}

%description    devel
This packages contains the development files for QCA

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

%build
MAKE=%{_bindir}/make \
./configure \
  --prefix=%{_prefix} \
  --includedir=%{_includedir} \
  --libdir=%{_libdir} \
  --datadir=%{_datadir} \
  --no-separate-debug-info \
  --verbose

sed -i -e /strip/d Makefile
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install INSTALL_ROOT=$RPM_BUILD_ROOT


%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc COPYING README TODO
%{_bindir}/qcatool2
%{_libdir}/*.so.*
%{_mandir}/*/*

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


%changelog
* 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 
