Summary: Layer on top of PKCS#11 API to make using PKCS#11 implementations easier
-Summary(pl): Warstwa powy¿ej API PKCS#11 u³atwiaj±ca u¿ywanie implementacji PKCS#11
+Summary(pl.UTF-8): Warstwa powyżej API PKCS#11 ułatwiająca używanie implementacji PKCS#11
Name: libp11
-Version: 0.2.0
-Release: 1
+Version: 0.4.9
+Release: 2
License: LGPL v2.1+
Group: Libraries
-Source0: http://www.opensc.org/files/%{name}-%{version}.tar.gz
-# Source0-md5: 549803a368aa2b457ebcf9d5c7d36dfd
-URL: http://www.opensc.org/libp11/
-BuildRequires: libltdl-devel
-BuildRequires: openssl-devel
+#Source0Download: https://github.com/OpenSC/libp11/releases
+Source0: https://github.com/OpenSC/libp11/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 757b23242758a52599cb35f61de11ba2
+URL: https://github.com/OpenSC/libp11
+BuildRequires: doxygen
+BuildRequires: openssl-devel >= 0.9.8
+# for proxy_module detection
+BuildRequires: p11-kit-devel
BuildRequires: pkgconfig
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+%undefine __cxx
+
%description
Libp11 is a library implementing a small layer on top of PKCS#11 API
to make using PKCS#11 implementations easier.
-%description -l pl
-Libp11 to biblioteka implementuj±ca niewielk± warstwê na wierzchu API
-PKCS#11 maj±ca u³atwiæ u¿ywanie implementacji PKCS#11.
+%description -l pl.UTF-8
+Libp11 to biblioteka implementująca niewielką warstwę na wierzchu API
+PKCS#11 mająca ułatwić używanie implementacji PKCS#11.
%package devel
Summary: Header files for libp11 library
-Summary(pl): Pliki nag³ówkowe biblioteki libp11
+Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libp11
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
-Requires: libltdl-devel
-Requires: openssl-devel
+Requires: openssl-devel >= 0.9.8
%description devel
Header files for libp11 library.
-%description devel -l pl
-Pliki nag³ówkowe biblioteki libp11.
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki libp11.
%package static
Summary: Static libp11 library
-Summary(pl): Statyczna biblioteka libp11
+Summary(pl.UTF-8): Statyczna biblioteka libp11
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
%description static
Static libp11 library.
-%description static -l pl
+%description static -l pl.UTF-8
Statyczna biblioteka libp11.
+%package apidocs
+Summary: API documentation for libp11 library
+Summary(pl.UTF-8): Dokumentacja API biblioteki libp11
+Group: Documentation
+
+%description apidocs
+API documentation for libp11 library.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API biblioteki libp11.
+
+%package -n openssl-engine-pkcs11
+Summary: PKCS#11 engine for OpenSSL
+Summary(pl.UTF-8): Silnik PKCS#11 dla OpenSSL-a
+Group: Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: openssl >= 0.9.8
+
+%description -n openssl-engine-pkcs11
+engine_pkcs11 is an implementation of an engine for OpenSSL. It can be
+loaded using code, config file or command line and will pass any
+function call by openssl to a PKCS#11 module. Engine_pkcs11 is meant
+to be used with smart cards and software for using smart cards in
+PKCS#11 format, such as OpenSC.
+
+%description -n openssl-engine-pkcs11 -l pl.UTF-8
+engine_pkcs11 to implementacja silnika dla OpenSSL-a. Może być
+wczytany przy użyciu kodu, pliku konfiguracyjnego i linii poleceń;
+przekazuje wszystkie wywołania funkcji openssl-a do modułu PKCS#11.
+engine_pkcs11 jest przeznaczony do używania z kartami procesorowymi i
+oprogramowaniem do używania kart procesorowych w formacie PKCS#11,
+takim jak OpenSC.
+
%prep
%setup -q
%build
-%configure
+%configure \
+ --enable-api-doc \
+ --disable-silent-rules \
+ --with-enginesdir=/%{_lib}/engines-1.1
%{__make}
%install
install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
cp -af examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+# obsoleted by pkgconfig
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libp11.la
+# loadable module
+%{__rm} $RPM_BUILD_ROOT/%{_lib}/engines-1.1/*.la
+# packaged as %doc
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/libp11
+
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc doc/{README,*.html,*.css}
+%doc NEWS README.md
%attr(755,root,root) %{_libdir}/libp11.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libp11.so.3
%files devel
%defattr(644,root,root,755)
-%doc doc/api/*
%attr(755,root,root) %{_libdir}/libp11.so
-%{_libdir}/libp11.la
%{_includedir}/libp11.h
+%{_includedir}/p11_err.h
%{_pkgconfigdir}/libp11.pc
%{_examplesdir}/%{name}-%{version}
%files static
%defattr(644,root,root,755)
%{_libdir}/libp11.a
+
+%files apidocs
+%defattr(644,root,root,755)
+%doc doc/api.out/html/*
+
+%files -n openssl-engine-pkcs11
+%defattr(644,root,root,755)
+%attr(755,root,root) /%{_lib}/engines-1.1/libpkcs11.so
+%attr(755,root,root) /%{_lib}/engines-1.1/pkcs11.so