2015-09-02 14:08:13 +00:00
|
|
|
#global prever rc1
|
|
|
|
|
2011-10-28 18:52:17 +00:00
|
|
|
Summary: Software version of a PKCS#11 Hardware Security Module
|
|
|
|
Name: softhsm
|
2015-09-02 14:08:13 +00:00
|
|
|
Version: 2.0.0
|
2016-02-05 00:16:21 +00:00
|
|
|
Release: %{?prever:0.}1%{?prever:.%{prever}}%{?dist}.1
|
2011-10-28 18:52:17 +00:00
|
|
|
License: BSD
|
|
|
|
Url: http://www.opendnssec.org/
|
2015-09-02 14:08:13 +00:00
|
|
|
Source: http://dist.opendnssec.org/source/%{?prever:testing/}%{name}-%{version}.tar.gz
|
|
|
|
Source1: http://dist.opendnssec.org/source/%{?prever:testing/}%{name}-%{version}.tar.gz.sig
|
2015-06-03 07:57:40 +00:00
|
|
|
Source2: softhsm.module
|
2014-10-07 17:36:15 +00:00
|
|
|
# taken from coolkey which is not build on all arches we build on
|
2015-06-03 07:57:40 +00:00
|
|
|
Source3: softhsm2-pk11install.c
|
2014-10-08 05:03:49 +00:00
|
|
|
|
2011-10-28 18:52:17 +00:00
|
|
|
Group: Applications/System
|
2015-06-26 14:42:08 +00:00
|
|
|
BuildRequires: openssl-devel >= 1.0.1k-6, sqlite-devel >= 3.4.2, cppunit-devel
|
2014-10-07 17:36:15 +00:00
|
|
|
BuildRequires: gcc-c++, pkgconfig, p11-kit-devel, nss-devel
|
|
|
|
|
2011-10-28 18:52:17 +00:00
|
|
|
Requires(pre): shadow-utils
|
2014-10-07 17:36:15 +00:00
|
|
|
Requires: p11-kit, nss-tools
|
2015-06-26 14:42:08 +00:00
|
|
|
Requires: openssl-libs >= 1.0.1k-6
|
2014-10-07 17:36:15 +00:00
|
|
|
|
|
|
|
%global _hardened_build 1
|
2014-04-19 00:56:56 +00:00
|
|
|
|
|
|
|
%global softhsm_module "SoftHSM PKCS #11 Module"
|
|
|
|
%global nssdb %{_sysconfdir}/pki/nssdb
|
2011-10-28 18:52:17 +00:00
|
|
|
|
|
|
|
%description
|
2014-10-07 17:36:15 +00:00
|
|
|
OpenDNSSEC is providing a software implementation of a generic
|
|
|
|
cryptographic device with a PKCS#11 interface, the SoftHSM. SoftHSM is
|
|
|
|
designed to meet the requirements of OpenDNSSEC, but can also work together
|
2011-10-28 18:52:17 +00:00
|
|
|
with other cryptographic products because of the PKCS#11 interface.
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Development package of softhsm that includes the header files
|
|
|
|
Group: Development/Libraries
|
2014-10-07 17:36:15 +00:00
|
|
|
Requires: %{name} = %{version}-%{release}, openssl-devel, sqlite-devel
|
2015-09-02 14:08:13 +00:00
|
|
|
%if 0%{?prever:1}
|
2015-06-03 07:57:40 +00:00
|
|
|
BuildRequires: autoconf, libtool, automake
|
2015-09-02 14:08:13 +00:00
|
|
|
%endif
|
2011-10-28 18:52:17 +00:00
|
|
|
|
|
|
|
%description devel
|
|
|
|
The devel package contains the libsofthsm include files
|
|
|
|
|
|
|
|
%prep
|
2015-09-02 14:08:13 +00:00
|
|
|
%setup -q -n %{name}-%{version}%{?prever}
|
|
|
|
%if 0%{?prever:1}
|
2015-06-03 07:57:40 +00:00
|
|
|
autoreconf -fiv
|
2015-09-02 14:08:13 +00:00
|
|
|
%endif
|
2014-10-08 05:03:49 +00:00
|
|
|
|
2014-10-07 17:36:15 +00:00
|
|
|
# remove softhsm/ subdir auto-added to --libdir
|
|
|
|
sed -i "s:full_libdir/softhsm:full_libdir:g" configure
|
2015-09-02 14:08:13 +00:00
|
|
|
%if 0%{?prever:1}
|
2014-10-08 05:03:49 +00:00
|
|
|
sed -i 's:^full_libdir=":#full_libdir=":g' configure.ac
|
2015-09-02 14:08:13 +00:00
|
|
|
%endif
|
2014-10-07 17:36:15 +00:00
|
|
|
sed -i "s:libdir)/@PACKAGE@:libdir):" Makefile.in
|
2011-10-28 18:52:17 +00:00
|
|
|
|
|
|
|
%build
|
2014-10-08 05:03:49 +00:00
|
|
|
%configure --libdir=%{_libdir}/pkcs11 --with-openssl=%{_prefix} --enable-ecc --disable-gost \
|
2014-10-07 17:36:15 +00:00
|
|
|
--with-migrate --enable-visibility
|
|
|
|
|
2011-10-28 18:52:17 +00:00
|
|
|
make %{?_smp_mflags}
|
2014-10-07 17:36:15 +00:00
|
|
|
# install our copy of pk11install taken from coolkey package
|
2015-06-03 07:57:40 +00:00
|
|
|
cp %{SOURCE3} .
|
2014-10-07 17:36:15 +00:00
|
|
|
gcc $(pkg-config --cflags nss) %{optflags} -c softhsm2-pk11install.c
|
|
|
|
gcc $(pkg-config --libs nss) -lpthread -lsoftokn3 -ldl -lz %{optflags} softhsm2-pk11install.o -o softhsm2-pk11install
|
2011-10-28 18:52:17 +00:00
|
|
|
|
|
|
|
%check
|
|
|
|
make check
|
|
|
|
|
|
|
|
%install
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
make DESTDIR=%{buildroot} install
|
2015-06-03 07:57:40 +00:00
|
|
|
install -D %{SOURCE2} %{buildroot}/%{_datadir}/p11-kit/modules/softhsm.module
|
2014-04-19 00:56:56 +00:00
|
|
|
|
2014-10-07 17:36:15 +00:00
|
|
|
rm %{buildroot}/%{_sysconfdir}/softhsm2.conf.sample
|
|
|
|
rm -f %{buildroot}/%{_libdir}/pkcs11/*a
|
2011-10-28 18:52:17 +00:00
|
|
|
mkdir -p %{buildroot}%{_includedir}/softhsm
|
|
|
|
cp src/lib/*.h %{buildroot}%{_includedir}/softhsm
|
2014-10-07 17:36:15 +00:00
|
|
|
mkdir -p %{buildroot}/%{_sharedstatedir}/softhsm/tokens
|
|
|
|
install -m0755 -D softhsm2-pk11install %{buildroot}/%{_bindir}/softhsm2-pk11install
|
|
|
|
|
|
|
|
# leave a softlink where softhsm-1 installed its library. Programs like
|
|
|
|
# opendnssec have that filename in their configuration file.
|
|
|
|
mkdir -p %{buildroot}/%{_libdir}/softhsm/
|
|
|
|
ln -s ../pkcs11/libsofthsm2.so %{buildroot}/%{_libdir}/softhsm/libsofthsm.so
|
2011-10-28 18:52:17 +00:00
|
|
|
|
2014-10-07 17:36:15 +00:00
|
|
|
%files
|
|
|
|
%config(noreplace) %{_sysconfdir}/softhsm2.conf
|
2011-10-28 18:52:17 +00:00
|
|
|
%{_bindir}/*
|
2014-10-07 17:36:15 +00:00
|
|
|
%dir %{_libdir}/softhsm
|
|
|
|
%{_libdir}/pkcs11/libsofthsm2.so
|
2011-10-28 18:52:17 +00:00
|
|
|
%{_libdir}/softhsm/libsofthsm.so
|
2014-10-07 17:36:15 +00:00
|
|
|
%attr(0664,root,root) %{_datadir}/p11-kit/modules/softhsm.module
|
|
|
|
%attr(0770,ods,ods) %dir %{_sharedstatedir}/softhsm
|
|
|
|
%attr(0770,ods,ods) %dir %{_sharedstatedir}/softhsm/tokens
|
|
|
|
%doc LICENSE README.md NEWS
|
2011-10-28 18:52:17 +00:00
|
|
|
%{_mandir}/*/*
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
%attr(0755,root,root) %dir %{_includedir}/softhsm
|
|
|
|
%{_includedir}/softhsm/*.h
|
|
|
|
|
|
|
|
%pre
|
2012-04-03 19:37:40 +00:00
|
|
|
getent group ods >/dev/null || groupadd -r ods
|
|
|
|
getent passwd ods >/dev/null || \
|
2015-09-02 14:08:13 +00:00
|
|
|
useradd -r -g ods -d %{_sharedstatedir}/softhsm -s /sbin/nologin \
|
2014-04-19 00:56:56 +00:00
|
|
|
-c "softhsm private keys owner" ods
|
2011-10-28 18:52:17 +00:00
|
|
|
exit 0
|
|
|
|
|
2014-04-19 00:56:56 +00:00
|
|
|
%post
|
|
|
|
isThere=`modutil -rawlist -dbdir %{nssdb} | grep %{softhsm_module} || echo NO`
|
|
|
|
if [ "$isThere" == "NO" ]; then
|
2014-10-07 17:36:15 +00:00
|
|
|
softhsm2-pk11install -p %{nssdb} 'name=%{softhsm_module} library=libsofthsm2.so'
|
2014-04-19 00:56:56 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
modutil -delete %{softhsm_module} -dbdir %{nssdb} -force || :
|
|
|
|
fi
|
|
|
|
|
2014-10-07 17:36:15 +00:00
|
|
|
%triggerpostun -- softhsm < 2.0.0
|
|
|
|
if [ -f /var/softhsm/slot0.db ]; then
|
|
|
|
runuser -g ods ods -c 'softhsm2-migrate --db /var/softhsm/slot0.db --pin 1234 --slot 0' || :
|
|
|
|
fi
|
|
|
|
|
2011-10-28 18:52:17 +00:00
|
|
|
%changelog
|
2016-02-05 00:16:21 +00:00
|
|
|
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-1.1
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
|
|
|
|
2015-09-02 14:08:13 +00:00
|
|
|
* Wed Sep 02 2015 Paul Wouters <pwouters@redhat.com> - 2.0.0-1
|
|
|
|
- Resolves: rhbz#1244461 Update to softhsm-2.0.0
|
|
|
|
- Resolves: rhbz#1177086 A marked as trusted certificate cannot be written in a softhsmv2 db
|
|
|
|
- Resolves: rhbz#1159827 Typo in homedir in /etc/passwd
|
|
|
|
- Added global prever to toggle snapshot vs full release build changes
|
|
|
|
|
2015-06-26 14:42:08 +00:00
|
|
|
* Fri Jun 26 2015 Petr Spacek <pspacek@redhat.com> - 2.0.0rc1-3
|
|
|
|
- Add dependency on OpenSSL with fixed AES wrapping support
|
|
|
|
|
2015-06-19 01:13:50 +00:00
|
|
|
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0rc1-2
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
|
|
|
|
2015-06-03 07:57:40 +00:00
|
|
|
* Mon Jun 01 2015 Petr Spacek <pspacek@redhat.com> - 2.0.0rc1-1
|
|
|
|
- Rebase to latest upstream release
|
|
|
|
|
2015-05-02 15:52:29 +00:00
|
|
|
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 2.0.0b1-4
|
|
|
|
- Rebuilt for GCC 5 C++11 ABI change
|
|
|
|
|
2014-10-07 17:36:15 +00:00
|
|
|
* Tue Sep 30 2014 Paul Wouters <pwouters@redhat.com> - 2.0.0b1-3
|
2014-10-08 05:03:49 +00:00
|
|
|
- Add support for CKM_RSA_PKCS_OAEP key un/wrapping [Petr Spacek]
|
|
|
|
- Use OpenSSL EVP interface for AES key wrapping [Petr Spacek]
|
2014-10-07 17:36:15 +00:00
|
|
|
- Fix softhsm2-pk11install buid and post call
|
|
|
|
- Do not use --with-objectstore-backend-db (causes issues on i686)
|
|
|
|
- Change install directory to /usr/lib*/pkcs11/
|
|
|
|
- Install pkcs11 module file
|
|
|
|
- Use official upstream tar ball
|
|
|
|
- Create ods user to own softhsm/token files
|
|
|
|
- Enable migration tools (for softhsm-v1 installs)
|
|
|
|
- Add softlink for softhsm-v1 .so (needed for opendnssec's conf.xml)
|
|
|
|
- Require p11-kit, nss-tools, for SoftHSM PKCS #11 Module file
|
|
|
|
- Copy pk11install.c from coolkey package
|
|
|
|
- Enable hardened build
|
|
|
|
- Add upstream official source url
|
|
|
|
|
2014-08-18 02:59:17 +00:00
|
|
|
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.6-3
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
|
|
|
|
2014-06-08 06:42:36 +00:00
|
|
|
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.6-2
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
|
|
|
|
2014-04-19 00:56:56 +00:00
|
|
|
* Fri Apr 18 2014 Paul Wouters <pwouters@redhat.com> - 1.3.6-1
|
|
|
|
- Updated to 1.3.6 (rhbz#1070196)
|
|
|
|
- Provide a p11-kit module file (rhbz#1085327)
|
|
|
|
|
2013-11-03 18:27:32 +00:00
|
|
|
* Sun Nov 03 2013 Paul Wouters <pwouters@redhat.com> - 1.3.5-1
|
|
|
|
- Updated to 1.3.5 (rhbz#987721)
|
|
|
|
|
2013-07-30 16:03:16 +00:00
|
|
|
* Tue Jul 30 2013 Paul Wouters <pwouters@redhat.com> - 1.3.3-4
|
|
|
|
- Rebuilt for new botan - requires --with-botan argument
|
|
|
|
|
2013-02-15 00:13:21 +00:00
|
|
|
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.3-3
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
|
|
|
|
2012-07-21 20:10:22 +00:00
|
|
|
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.3-2
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
|
|
|
|
2012-06-04 21:55:28 +00:00
|
|
|
* Mon Jun 04 2012 Paul Wouters <pwouters@redhat.com> - 1.3.3-1
|
|
|
|
- Updated to 1.3.3
|
|
|
|
|
2012-04-03 19:37:40 +00:00
|
|
|
* Tue Apr 03 2012 Paul Wouters <pwouters@redhat.com> - 1.3.2-1
|
|
|
|
- Updated to 1.3.2.
|
|
|
|
- Changed user from opendnssec to ods, as used in the opendnssec package
|
|
|
|
|
2012-01-14 04:06:37 +00:00
|
|
|
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-4
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
|
|
|
|
2011-10-28 18:52:17 +00:00
|
|
|
* Thu Oct 27 2011 Paul Wouters <paul@xelerance.com> - 1.3.0-3
|
|
|
|
- Initial Fedora package
|
|
|
|
- Do not install the .a file
|
|
|
|
- Use a separate "opendnssec" user to own /var/sofhsm
|
|
|
|
|
|
|
|
* Tue Oct 25 2011 Paul Wouters <paul@xelerance.com> - 1.3.0-2
|
|
|
|
- Fix description texts w.r.t. include files
|
|
|
|
|
|
|
|
* Wed Oct 05 2011 Paul Wouters <paul@xelerance.com> - 1.3.0-1
|
|
|
|
- Upgraded to 1.3.0
|
|
|
|
|
|
|
|
* Thu Mar 3 2011 Paul Wouters <paul@xelerance.com> - 1.2.0-1
|
|
|
|
- Initial package for Fedora
|