4dbf30
Name:           p11-kit
4dbf30
Version:        0.23.5
4dbf30
Release:        3%{?dist}
4dbf30
Summary:        Library for loading and sharing PKCS#11 modules
4dbf30
4dbf30
License:        BSD
4dbf30
URL:            http://p11-glue.freedesktop.org/p11-kit.html
4dbf30
Source0:        http://p11-glue.freedesktop.org/releases/p11-kit-%{version}.tar.gz
4dbf30
Source1:        trust-extract-compat
4dbf30
Patch0:		p11-kit-modifiable.patch
4dbf30
Patch1:		p11-kit-strerror.patch
4dbf30
Patch2:		p11-kit-oaep.patch
4dbf30
Patch3:		p11-kit-doc.patch
4dbf30
4dbf30
BuildRequires:  libtasn1-devel >= 2.3
4dbf30
BuildRequires:  nss-softokn-freebl
4dbf30
BuildRequires:	libffi-devel
4dbf30
BuildRequires:	gtk-doc
4dbf30
4dbf30
%description
4dbf30
p11-kit provides a way to load and enumerate PKCS#11 modules, as well
4dbf30
as a standard configuration setup for installing PKCS#11 modules in
4dbf30
such a way that they're discoverable.
4dbf30
4dbf30
%package devel
4dbf30
Summary:        Development files for %{name}
4dbf30
Requires:       %{name}%{?_isa} = %{version}-%{release}
4dbf30
4dbf30
%description devel
4dbf30
The %{name}-devel package contains libraries and header files for
4dbf30
developing applications that use %{name}.
4dbf30
4dbf30
%package doc
4dbf30
Summary:        Documentation files for %{name}
4dbf30
BuildArch:	noarch
4dbf30
4dbf30
%description doc
4dbf30
The %{name}-doc package contains additional documentation for p11-kit
4dbf30
and developing applications to take advantage of it.
4dbf30
4dbf30
%package trust
4dbf30
Summary:        System trust module from %{name}
4dbf30
Requires:       %{name}%{?_isa} = %{version}-%{release}
4dbf30
Requires(post):   %{_sbindir}/update-alternatives
4dbf30
Requires(postun): %{_sbindir}/update-alternatives
4dbf30
Conflicts:        nss < 3.14.3-9
4dbf30
4dbf30
%description trust
4dbf30
The %{name}-trust package contains a system trust PKCS#11 module which
4dbf30
contains certificate anchors and black lists.
4dbf30
4dbf30
4dbf30
# solution taken from icedtea-web.spec
4dbf30
%define multilib_arches ppc64 sparc64 x86_64 s390x
4dbf30
%ifarch %{multilib_arches}
4dbf30
%define alt_ckbi  libnssckbi.so.%{_arch}
4dbf30
%else
4dbf30
%define alt_ckbi  libnssckbi.so
4dbf30
%endif
4dbf30
4dbf30
4dbf30
%prep
4dbf30
%autosetup -p1
4dbf30
4dbf30
%build
4dbf30
# These paths are the source paths that  come from the plan here:
4dbf30
# https://fedoraproject.org/wiki/Features/SharedSystemCertificates:SubTasks
4dbf30
%configure --disable-static --enable-doc --with-trust-paths=%{_sysconfdir}/pki/ca-trust/source:%{_datadir}/pki/ca-trust-source --with-hash-impl=freebl --disable-silent-rules
4dbf30
make %{?_smp_mflags} V=1
4dbf30
4dbf30
%install
4dbf30
make install DESTDIR=$RPM_BUILD_ROOT
4dbf30
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pkcs11/modules
4dbf30
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
4dbf30
rm -f $RPM_BUILD_ROOT%{_libdir}/pkcs11/*.la
4dbf30
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_libexecdir}/p11-kit/
4dbf30
# Install the example conf with %%doc instead
4dbf30
rm $RPM_BUILD_ROOT%{_sysconfdir}/pkcs11/pkcs11.conf.example
4dbf30
# We don't support PKCS#11 forwarding in RHEL-7 yet
4dbf30
rm -f $RPM_BUILD_ROOT%{_libexecdir}/p11-kit/p11-kit-server
4dbf30
rm -f $RPM_BUILD_ROOT%{_libdir}/pkcs11/p11-kit-client.so
4dbf30
4dbf30
%check
4dbf30
make check
4dbf30
4dbf30
4dbf30
%post -p /sbin/ldconfig
4dbf30
4dbf30
%post trust
4dbf30
%{_sbindir}/update-alternatives --install %{_libdir}/libnssckbi.so \
4dbf30
	%{alt_ckbi} %{_libdir}/pkcs11/p11-kit-trust.so 30
4dbf30
4dbf30
# Fix bad links from earlier p11-kit packages which didn't include s390x
4dbf30
%posttrans trust
4dbf30
%ifarch s390x
4dbf30
if %{_sbindir}/update-alternatives --display libnssckbi.so | grep -q lib64; then
4dbf30
    %{_sbindir}/update-alternatives --remove libnssckbi.so %{_libdir}/pkcs11/p11-kit-trust.so
4dbf30
    if test -e /usr/lib/nss/libnssckbi.so; then
4dbf30
        %{_sbindir}/update-alternatives --install /usr/lib/libnssckbi.so libnssckbi.so /usr/lib/nss/libnssckbi.so 10
4dbf30
    fi
4dbf30
fi
4dbf30
%endif
4dbf30
4dbf30
%postun -p /sbin/ldconfig
4dbf30
4dbf30
%postun trust
4dbf30
if [ $1 -eq 0 ] ; then
4dbf30
	# package removal
4dbf30
	%{_sbindir}/update-alternatives --remove %{alt_ckbi} %{_libdir}/pkcs11/p11-kit-trust.so
4dbf30
fi
4dbf30
4dbf30
4dbf30
%files
4dbf30
%doc AUTHORS COPYING NEWS README
4dbf30
%doc p11-kit/pkcs11.conf.example
4dbf30
%dir %{_sysconfdir}/pkcs11
4dbf30
%dir %{_sysconfdir}/pkcs11/modules
4dbf30
%dir %{_datadir}/p11-kit
4dbf30
%dir %{_datadir}/p11-kit/modules
4dbf30
%dir %{_libexecdir}/p11-kit
4dbf30
%{_bindir}/p11-kit
4dbf30
%{_libdir}/libp11-kit.so.*
4dbf30
%{_libdir}/p11-kit-proxy.so
4dbf30
%{_libexecdir}/p11-kit/p11-kit-remote
4dbf30
%{_mandir}/man8/p11-kit.8.gz
4dbf30
%{_mandir}/man5/pkcs11.conf.5.gz
4dbf30
4dbf30
%files devel
4dbf30
%{_includedir}/p11-kit-1/
4dbf30
%{_libdir}/libp11-kit.so
4dbf30
%{_libdir}/pkgconfig/p11-kit-1.pc
4dbf30
4dbf30
%files doc
4dbf30
%doc %{_datadir}/gtk-doc/
4dbf30
4dbf30
%files trust
4dbf30
%{_bindir}/trust
4dbf30
%{_mandir}/man1/trust.1.gz
4dbf30
%{_libdir}/pkcs11/p11-kit-trust.so
4dbf30
%{_datadir}/p11-kit/modules/p11-kit-trust.module
4dbf30
%{_libexecdir}/p11-kit/trust-extract-compat
4dbf30
4dbf30
4dbf30
%changelog
4dbf30
* Mon Jun 12 2017 Daiki Ueno <dueno@redhat.com> - 0.23.5-3
4dbf30
- Avoid reference to thread-unsafe strerror rhbz#1378947
4dbf30
- Fix PKCS#11 OAEP interface rhbz#1191209
4dbf30
- Update documentation to follow RFC7512 rhbz#1165977
4dbf30
4dbf30
* Thu May 18 2017 Daiki Ueno <dueno@redhat.com> - 0.23.5-2
4dbf30
- Make "trust anchor --remove" work again
4dbf30
4dbf30
* Mon Mar  6 2017 Daiki Ueno <dueno@redhat.com> - 0.23.5-1
4dbf30
- Rebase to upstream version 0.23.5
4dbf30
4dbf30
* Wed Feb 22 2017 Daiki Ueno <dueno@redhat.com> - 0.23.4-1
4dbf30
- Rebase to upstream version 0.23.4
4dbf30
4dbf30
* Thu Jan 08 2015 Stef Walter <stefw@redhat.com> - 0.20.7-3
4dbf30
- Fix incorrect alternative links for s390 and s390x rhbz#1174178
4dbf30
4dbf30
* Sun Oct 05 2014 Stef Walter <stefw@redhat.com> - 0.20.7-2
4dbf30
- Fix deadlock related to forking and pthread_atfork rhbz#1148774
4dbf30
4dbf30
* Thu Sep 18 2014 Stef Walter <stefw@redhat.com> - 0.20.7-1
4dbf30
- Update to upstream stable 0.20.7 release
4dbf30
- Expose pkcs11x.h header and defines for attached extensions rhbz#1142305
4dbf30
4dbf30
* Tue Sep 09 2014 Stef Walter <stefw@redhat.com> - 0.20.6-1
4dbf30
- Update to upstream stable 0.20.6 release
4dbf30
- Respect critical = no in p11-kit-proxy.so rhbz#1128615
4dbf30
4dbf30
* Fri Sep 05 2014 Stef Walter <stefw@redhat.com> - 0.20.5-1
4dbf30
- Update to upstream version 0.20.5
4dbf30
- Fixes several issues highlighted at rhbz#1128218
4dbf30
4dbf30
* Thu Aug 07 2014 Stef Walter <stefw@redhat.com> - 0.20.4-1
4dbf30
- Rebase to upstream version 0.20.x (#1122528)
4dbf30
4dbf30
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 0.18.7-4
4dbf30
- Mass rebuild 2014-01-24
4dbf30
4dbf30
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 0.18.7-3
4dbf30
- Mass rebuild 2013-12-27
4dbf30
4dbf30
* Mon Nov 04 2013 Stef Walter <stefw@redhat.com> - 0.18.7-2
4dbf30
- Move devel docs into subpackage due to gtk-doc multilib incompatibility (#983176)
4dbf30
4dbf30
* Thu Oct 10 2013 Stef Walter <stefw@redhat.com> - 0.18.7-1
4dbf30
- Update to new upstream point release for RHEL bug fixes
4dbf30
4dbf30
* Thu Jul 18 2013 Stef Walter <stefw@redhat.com> - 0.18.5-1
4dbf30
- Update to new upstream point release
4dbf30
- Use freebl for hash algorithms
4dbf30
- Don't load configs in home dir when setuid or setgid
4dbf30
- Use $TMPDIR instead of $TEMP while testing
4dbf30
- Open files and fds with O_CLOEXEC
4dbf30
- Abort initialization if critical module fails to load
4dbf30
- Don't use thread-unsafe: strerror, getpwuid
4dbf30
- Fix p11_kit_space_strlen() result when empty string
4dbf30
4dbf30
* Tue Jun 25 2013 Stef Walter <stefw@redhat.com> - 0.18.4-1
4dbf30
- Fix running the extract-trust external command
4dbf30
4dbf30
* Wed Jun 05 2013 Stef Walter <stefw@redhat.com> - 0.18.3-1
4dbf30
- Update to new upstream stable release
4dbf30
- Fix intermittent firefox cert validation issues (#960230)
4dbf30
- Include the manual pages in the package
4dbf30
4dbf30
* Tue May 14 2013 Stef Walter <stefw@redhat.com> - 0.18.2-1
4dbf30
- Update to new upstream stable release
4dbf30
- Reduce the libtasn1 dependency minimum version
4dbf30
4dbf30
* Thu May 02 2013 Stef Walter <stefw@redhat.com> - 0.18.1-1
4dbf30
- Update to new upstream stable release
4dbf30
- 'p11-kit extract-trust' lives in libdir
4dbf30
4dbf30
* Thu Apr 04 2013 Stef Walter <stefw@redhat.com> - 0.18.0-1
4dbf30
- Update to new upstream stable release
4dbf30
- Various logging tweaks (#928914, #928750)
4dbf30
- Make the 'p11-kit extract-trust' explicitly reject
4dbf30
  additional arguments
4dbf30
4dbf30
* Fri Mar 29 2013 Stef Walter <stefw@redhat.com> - 0.17.5-2
4dbf30
- Fix problem with empathy connecting to Google Talk (#928913)
4dbf30
4dbf30
* Thu Mar 28 2013 Stef Walter <stefw@redhat.com> - 0.17.5-1
4dbf30
- Make 'p11-kit extract-trust' call update-ca-trust
4dbf30
- Work around 32-bit oveflow of certificate dates
4dbf30
- Build fixes
4dbf30
4dbf30
* Tue Mar 26 2013 Stef Walter <stefw@redhat.com> - 0.17.4-2
4dbf30
- Pull in patch from upstream to fix build on ppc (#927394)
4dbf30
4dbf30
* Wed Mar 20 2013 Stef Walter <stefw@redhat.com> - 0.17.4-1
4dbf30
- Update to upstream version 0.17.4
4dbf30
4dbf30
* Mon Mar 18 2013 Stef Walter <stefw@redhat.com> - 0.17.3-1
4dbf30
- Update to upstream version 0.17.3
4dbf30
- Put the trust input paths in the right order
4dbf30
4dbf30
* Tue Mar 12 2013 Stef Walter <stefw@redhat.com> - 0.16.4-1
4dbf30
- Update to upstream version 0.16.4
4dbf30
4dbf30
* Fri Mar 08 2013 Stef Walter <stefw@redhat.com> - 0.16.3-1
4dbf30
- Update to upstream version 0.16.3
4dbf30
- Split out system trust module into its own package.
4dbf30
- p11-kit-trust provides an alternative to an nss module
4dbf30
4dbf30
* Tue Mar 05 2013 Stef Walter <stefw@redhat.com> - 0.16.1-1
4dbf30
- Update to upstream version 0.16.1
4dbf30
- Setup source directories as appropriate for Shared System Certificates feature
4dbf30
4dbf30
* Tue Mar 05 2013 Stef Walter <stefw@redhat.com> - 0.16.0-1
4dbf30
- Update to upstream version 0.16.0
4dbf30
4dbf30
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.14-2
4dbf30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
4dbf30
4dbf30
* Mon Sep 17 2012 Kalev Lember <kalevlember@gmail.com> - 0.14-1
4dbf30
- Update to 0.14
4dbf30
4dbf30
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.13-2
4dbf30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
4dbf30
4dbf30
* Mon Jul 16 2012 Kalev Lember <kalevlember@gmail.com> - 0.13-1
4dbf30
- Update to 0.13
4dbf30
4dbf30
* Tue Mar 27 2012 Kalev Lember <kalevlember@gmail.com> - 0.12-1
4dbf30
- Update to 0.12
4dbf30
- Run self tests in %%check
4dbf30
4dbf30
* Sat Feb 11 2012 Kalev Lember <kalevlember@gmail.com> - 0.11-1
4dbf30
- Update to 0.11
4dbf30
4dbf30
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-2
4dbf30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
4dbf30
4dbf30
* Tue Dec 20 2011 Matthias Clasen <mclasen@redhat.com> - 0.9-1
4dbf30
- Update to 0.9
4dbf30
4dbf30
* Wed Oct 26 2011 Kalev Lember <kalevlember@gmail.com> - 0.8-1
4dbf30
- Update to 0.8
4dbf30
4dbf30
* Mon Sep 19 2011 Matthias Clasen <mclasen@redhat.com> - 0.6-1
4dbf30
- Update to 0.6
4dbf30
4dbf30
* Sun Sep 04 2011 Kalev Lember <kalevlember@gmail.com> - 0.5-1
4dbf30
- Update to 0.5
4dbf30
4dbf30
* Sun Aug 21 2011 Kalev Lember <kalevlember@gmail.com> - 0.4-1
4dbf30
- Update to 0.4
4dbf30
- Install the example config file to documentation directory
4dbf30
4dbf30
* Wed Aug 17 2011 Kalev Lember <kalevlember@gmail.com> - 0.3-2
4dbf30
- Tighten -devel subpackage deps (#725905)
4dbf30
4dbf30
* Fri Jul 29 2011 Kalev Lember <kalevlember@gmail.com> - 0.3-1
4dbf30
- Update to 0.3
4dbf30
- Upstream rewrote the ASL 2.0 bits, which makes the whole package
4dbf30
  BSD-licensed
4dbf30
4dbf30
* Tue Jul 12 2011 Kalev Lember <kalevlember@gmail.com> - 0.2-1
4dbf30
- Initial RPM release