# $Id: phpki.spec,v 1.10 2011/10/26 10:15:15 vip-ire Exp $ # Authority: vip-ire # Name: Daniel Berteaud %define name phpki %define version 0.82 %define release 16 Summary: Phpki is a simple certificate management suite Name: %{name} Version: %{version} Release: %{release}%{?dist} License: GNU GPL version 2 URL: http://sourceforge.net/projects/phpki/ Group: SMEserver/addon #wget http://www.fooweb.com/downloads/foo-3.6.431.tar.gz Source: phpki-0.82.tar.gz Patch1: phpki-0.82-email_signing.patch Patch2: phpki-0.82-sme_openvpn_bridge_compat.patch Patch3: phpki-0.82-sme_admin_user.patch Patch4: phpki-0.82-openvpn_static_key.patch Patch5: phpki-0.82-expirey.patch Patch6: phpki-0.82-dl_display_ta_dh.patch Patch7: phpki-0.82-dl_crl_in_pem.patch Patch8: phpki-0.82-remove_email_from_upload_file_name.patch Patch9: phpki-0.82-display_root_pem.patch Patch10: phpki-0.82-disable_download_after_create.patch Patch11: phpki-0.82-remove_security_warning.patch Patch12: phpki-0.82-remove_email_from_upload_file_name.patch2 Patch13: phpki-0.82-ca_help.patch Patch14: phpki-0.82-empty_pass_php_5.2.patch Patch15: phpki-0.82-update_crl_via_cron.patch Patch16: phpki-0.82-use_sha1.patch Patch17: phpki-0.82-ca_admin_users.patch BuildArch: noarch BuildRoot: /var/tmp/%{name}-%{version} BuildRequires: e-smith-devtools Requires: e-smith-release >= 7.0 Requires: php Requires: openssl Requires: openvpn AutoReqProv: no %description http://sourceforge.net/projects/phpki/ PHPki is an Open Source Web application for managing a multi-agency PKI for HIPAA compliance. With it, you may create and centrally manage X.509 certificates for use with S/MIME enabled e-mail clients, SSL servers, and VPN applications. %changelog * Mon Dec 12 2011 Daniel B. 0.82-16.sme - Remove php-posix dependency (not available, nor needed on SME 7.x) [SME: 6805] * Wed Oct 26 2011 Daniel B. 0.82-15.sme - Requires php-posix * Wed Jun 29 2011 Daniel B. 0.82-14.sme - Don't check issuer (everyone allowed to access /ca can manage all the certificates, access to /ca is controlled by apache) * Tue Mar 15 2011 Daniel B. 0.82-13.sme - Replace md5 with sha1 for signing * Fri May 28 2010 Daniel B. [0.82-12] - Weekly update the CRL via cron so MS Crypto API will be happy * Thu Mar 18 2010 Daniel B. [0.82-11] - Fixe empty password with PHP 5.2 (SME 8b5) * Wed Aug 26 2009 Daniel B. [0.82-10] - Fixe links for CA help page * Mon Mar 23 2009 Daniel B. [0.82-9] - Remove links after uninstall so you can easily re-install the contrib later [SME: 5091] * Tue Mar 03 2009 Daniel B. [0.82-8] - Add e-smith-devtools as a dependencie * Tue Jan 20 2009 Daniel B. [0.82-7] - Don't replace config file on upgrades * Wed Jan 07 2009 Daniel B. [0.82-6] - Remove the email address from the file name during upload (in search page) - Remove secure.sh script * Tue Dec 16 2008 Daniel B. [0.82-5] - Link index.php to setup-presetup.php * Mon Dec 08 2008 Daniel B. [0.82-4] - Changes so certificates imported from openvpn-bridge are recognized - Configure default admin user to 'admin' - Create a static key for OpenVPN TLS auth (requires openvpn) - Add expirey values (3 Months, 6 Months) - Display or download takey.pem and dhparam1024.pem from the certificate management menue - Display the Root certificate in PEM format - Possibility to download the CRL in PEM format - Remove the email address from the file name during upload - Disable download of certificate after creating a new one - Remove security warning after setup * Wed Dec 05 2008 Daniel B. [0.82-3] - Correct extension name for email_signing certificates - Remove links, and recreate them in the %post section so upgrade can be done smoothly * Wed Nov 26 2008 Daniel B. [0.82-0] - initial release - builds from unchanged .tar.gz %prep %setup -c -n %{name} %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 %patch9 -p1 %patch10 -p1 %patch11 -p1 %patch12 -p1 %patch13 -p1 %patch14 -p1 %patch15 -p1 %patch16 -p1 %patch17 -p1 %build %{__mkdir_p} root/opt/phpki/html %{__mkdir_p} root/opt/phpki/phpki-store %{__mkdir_p} root/opt/phpki/bin %{__mkdir_p} root/%{_sysconfdir}/cron.weekly/ %{__mv} %{name}-%{version}/gen_crl.php root/opt/phpki/bin/ %{__mv} %{name}-%{version}/* root/opt/phpki/html/ cat <<"HERE" > root/%{_sysconfdir}/cron.weekly/phpki_update_crl #!/bin/bash cd /opt/phpki/bin php ./gen_crl.php 2>&1 > /dev/null HERE # Remove links to setup page so upgrades can be done smoothly %{__rm} -f root/opt/phpki/html/index.php %{__rm} -f root/opt/phpki/html/ca/index.php %{__rm} -f root/opt/phpki/html/setup.php # This script shouldn't be here %{__rm} -f root/opt/phpki/html/secure.sh %install rm -rf $RPM_BUILD_ROOT (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) rm -f %{name}-%{version}-filelist /sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ --file '/opt/phpki/html/config.php' 'attr(660,root,phpki) %config(noreplace)' \ --file '/opt/phpki/html/openssl.cnf' 'attr(660,root,phpki) %config(noreplace)' \ --file '%{_sysconfdir}/cron.weekly/phpki_update_crl' 'attr(744,root,root)' \ --dir '/opt/phpki/html' 'attr(770,root,phpki)' \ --dir '/opt/phpki/html/ca' 'attr(770,root,phpki)' \ --dir '/opt/phpki/phpki-store' 'attr(750,phpki,phpki)' \ > %{name}-%{version}-filelist %files -f %{name}-%{version}-filelist %defattr(-,root,root) %clean cd .. rm -rf $RPM_BUILD_ROOT %pre if ! /usr/bin/id phpki &>/dev/null; then /usr/sbin/useradd -c 'Phpki User' -s /sbin/nologin -r -d /opt/phpki/phpki-store phpki &>/dev/null || \ %logmsg "Unexpected error adding user \"phpki\". Abort installation." fi %preun %post # First install, point index.php to setup.php if [ $1 == 1 ]; then %{__ln_s} /opt/phpki/html/setup.php-presetup /opt/phpki/html/index.php %{__ln_s} /opt/phpki/html/setup.php-presetup /opt/phpki/html/setup.php echo " " > /opt/phpki/html/ca/index.php fi %postun # Remove the links to index.php after uninstall if [ $1 == 0 ]; then %{__rm} -f /opt/phpki/html/index.php %{__rm} -f /opt/phpki/html/setup.php %{__rm} -f /opt/phpki/html/ca/index.php fi true