Sisyphus repositório
Última atualização: 22 outubro 2019 | SRPMs: 17517 | Visitas: 15406575
en ru br
ALT Linux repositórios

Group :: Sistema/Configurações/Rede
RPM: softhsm

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

%define softhsm_module "SoftHSM PKCS #11 Module"
%define nssdb %_sysconfdir/pki/nssdb

Name: softhsm
Version: 2.1.0

Release: alt3
Summary: Software version of a PKCS#11 Hardware Security Module
License: BSD
Group: System/Configuration/Other


# repacked

Source0: %name-%version.tar

Source2: softhsm.module
# taken from coolkey which is not build on all arches we build on
Source3: softhsm2-pk11install.c
Patch1: softhsm2-1378800-openssl.patch

# Automatically added by buildreq on Wed Nov 02 2016

# optimized out: libcom_err-devel libkrb5-devel libnspr-devel libstdc++-devel perl pkg-config python-base python-modules
BuildRequires: gcc-c++ libnss-devel libsqlite3-devel libssl-devel sqlite3 zlib-devel

%{?!_without_check:%{?!_disable_check:BuildRequires: cppunit-devel pkg-config}}

Requires: lib%name = %EVR

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 with other cryptographic products because of the PKCS#11

%package -n lib%name
Summary: Library for Software Hardware Security Module
Group: System/Libraries

%description -n lib%name
This package contains development files for SoftHSM library.

%package devel
Summary: Development package of softhsm that includes the header files
Group: Development/C
Requires: lib%name = %EVR

%description devel
The devel package contains the libsofthsm include files.

%setup -n %name-%version
%patch1 -p1

find . -iname '*.am' -print0 | xargs -0 \
   sed -i \
       -e 's:cppunit-config --cflags:pkg-config --cflags cppunit:g' \
       -e 's:cppunit-config --libs:pkg-config --libs cppunit:g'


# remove softhsm/ subdir auto-added to --libdir

sed -i "s:full_libdir/softhsm:full_libdir:g" configure
sed -i 's:^full_libdir=":#full_libdir=":g'
sed -i "s:libdir)/ at PACKAGE at :libdir):"

%configure \
--localstatedir=/var \
--libdir=%_libdir/pkcs11 \
--with-openssl=%prefix \
--enable-ecc \
--disable-gost \
--with-migrate \
--enable-visibility \

# install our copy of pk11install taken from coolkey package
cp %SOURCE3 .
cc $(pkg-config --cflags nss) %optflags -c softhsm2-pk11install.c
cc softhsm2-pk11install.o $(pkg-config --libs nss) \
-lpthread  -lsoftokn3 -ldl -lz %optflags \
-o softhsm2-pk11install

make check

install -D %SOURCE2 %buildroot/%_datadir/p11-kit/modules/softhsm.module

rm %buildroot/%_sysconfdir/softhsm2.conf.sample
rm -f %buildroot/%_libdir/pkcs11/*a
mkdir -p %buildroot%_includedir/softhsm
cp src/lib/*.h %buildroot%_includedir/softhsm
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/ %buildroot/%_libdir/softhsm/
# rhbz#1272423 NSS needs it to be in the search path too
ln -s pkcs11/ %buildroot/%_libdir

getent group ods >/dev/null || groupadd -r ods
getent passwd ods >/dev/null || \
   useradd -r -g ods -d %_sharedstatedir/softhsm -s /sbin/nologin \
   -c "softhsm private keys owner" ods
exit 0

isThere=`modutil -rawlist -dbdir %nssdb | grep %softhsm_module || echo NO`
if [ "$isThere" = "NO" ]; then
     softhsm2-pk11install -p %nssdb 'name=%softhsm_module'
if [ $1 -eq 0 ]; then
  modutil -delete %softhsm_module -dbdir %nssdb -force || :

%dir %_libdir/softhsm
%attr(0770,ods,ods) %dir %_sharedstatedir/softhsm
%attr(0770,ods,ods) %dir %_sharedstatedir/softhsm/tokens

%files -n lib%name
%config(noreplace) %_sysconfdir/softhsm2.conf

%files devel


Todas as alterações você pod ver aqui

projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009