/[smecontribs]/rpms/phpki-ng/contribs10/phpki-ng.spec
ViewVC logotype

Annotation of /rpms/phpki-ng/contribs10/phpki-ng.spec

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.11 - (hide annotations) (download)
Tue Apr 6 00:24:42 2021 UTC (3 years, 7 months ago) by jcrisp
Branch: MAIN
CVS Tags: phpki-ng-0_84-10_el7_sme
Changes since 1.10: +9 -4 lines
* Tue Apr 06 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-9.sme
- And tidy up the copying wording. [SME: 11192]
- Credit to Terry Fage for persisting with testing

1 jcrisp 1.1 # $Id: phpki-ng.spec,v 1.4 2018/11/17 13:20:42 jcrisp Exp $
2     # Authority: vip-ire
3     # Name: Daniel Berteaud
4    
5     %define name phpki-ng
6     %define version 0.84
7 jcrisp 1.11 %define release 10
8 jcrisp 1.1 Summary: Phpki is a simple certificate management suite
9     Name: %{name}
10     Version: %{version}
11     Release: %{release}%{?dist}
12     License: GNU GPL version 2
13     URL: http://sourceforge.net/projects/phpki/
14     Group: SMEserver/addon
15     #wget http://www.fooweb.com/downloads/foo-3.6.431.tar.gz
16     Source: %{name}-%{version}.tar.gz
17 jcrisp 1.2 Patch1: phpki-ng-0.84-fix-for-php74-code-tidy.patch
18 jcrisp 1.3 Patch2: phpki-ng-0.84-fix-pregmatch-revoke-certs.patch
19 jcrisp 1.4 Patch3: phpki-ng-0.84-fix-crl.patch
20 jcrisp 1.5 Patch4: phpki-ng-0.84-fix-missing-slash-certtype-detection.patch
21 jcrisp 1.7 Patch5: phpki-ng-0.84-fix-html-directory-check.patch
22 jcrisp 1.8 Patch6: phpki-ng-0.84-fix-download-cert.patch
23 jcrisp 1.1
24     BuildArch: noarch
25     BuildRoot: /var/tmp/%{name}-%{version}
26    
27     BuildRequires: e-smith-devtools
28    
29 jcrisp 1.2 Requires: e-smith-release >= 10.0
30     Requires: php74-php-fpm
31 jcrisp 1.1 Requires: openssl
32     Requires: openvpn
33     Conflicts: phpki
34     AutoReqProv: no
35    
36     %description
37     http://sourceforge.net/projects/phpki/
38     https://github.com/radicand/phpki
39 jcrisp 1.2 https://github.com/reetp/phpki
40 jcrisp 1.1 PHPki is an Open Source Web application for managing a multi-agency PKI for HIPAA compliance.
41     With it, you may create and centrally manage X.509 certificates for use with S/MIME enabled
42     e-mail clients, SSL servers, and VPN applications.
43    
44     %changelog
45 jcrisp 1.11 * Tue Apr 06 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-9.sme
46     - And tidy up the copying wording. [SME: 11192]
47     - Credit to Terry Fage for persisting with testing
48    
49 jcrisp 1.10 * Mon Apr 05 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-9.sme
50     - Really fix the copy this time [SME: 11192]
51    
52     * Sat Apr 03 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-8.sme
53     - copy phpki-store as a backup instead of move [SME: 11192]
54 jcrisp 1.9
55 jcrisp 1.8 * Thu Apr 01 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-7.sme
56     - Fix broken Download Certificate in Cert generation [SME: 11513]
57    
58 jcrisp 1.7 * Thu Mar 18 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-6.sme
59 jcrisp 1.10 - Update html header info [SME: 11192]
60 jcrisp 1.7 - Remove obsolete align
61     - Remove accidentally duplicated html
62     - Fix typo
63     - Fix directory check
64     - move function flush_exec to functions file
65    
66 jcrisp 1.5 * Tue Mar 09 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-5.sme
67     - Fix missing / [SME:11435]
68     - Update cert type detection for renew [SME: 11436]
69     - Code formatting
70    
71 jcrisp 1.4 * Mon Mar 08 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-4.sme
72     - Fix crl creation [SME: 11141]
73     - Extra notes in setup page
74    
75 jcrisp 1.3 * Mon Mar 08 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-3.sme
76     - Fix Typo in certificate password [SME: 11435]
77     - Fix typos and preg_match issues [SME: 11436]
78 jcrisp 1.4 - Add Certificate creation notification [SME: 11437]
79     - Bit of file formatting
80 jcrisp 1.3
81 jcrisp 1.4 * Wed Mar 03 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-2.sme
82 jcrisp 1.2 - Change version to 0.84
83     - Fix undefined constant errors [SME: 11397]
84     - fix tempdir [SME: 11398]
85     - update code to be PHP 7.4+ compliant
86     - format with CodeSniff to PSR2
87    
88 jcrisp 1.1 * Wed Apr 01 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-1.sme
89 jcrisp 1.2 - Rename to php-ng 0.84 [SME: 11192]
90 jcrisp 1.1 - Fix date sorting in certificates
91    
92     * Thu Mar 19 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-9.sme
93     - Update DH to 2048
94    
95     * Mon Mar 09 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-8.sme
96     - move warning and exit to %pre
97    
98     * Sat Mar 07 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-7.sme
99     - Lots of formatting - adding quotes to items and tidying up
100     - set default md to 512
101    
102     * Wed Mar 04 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-6.sme
103     - Fix renew-cert
104     - revert DH setup so you can see progress
105    
106     * Wed Mar 04 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-5.sme
107     - Fix create cert without password
108    
109     * Wed Mar 04 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-4.sme
110     - Fix openvpn error
111    
112     * Tue Mar 03 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-3.sme
113     - more fixes
114    
115     * Sat Feb 29 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-2.sme
116     - small fixes
117    
118     * Fri Feb 28 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-1.sme
119     - Update to 0.83
120    
121 jcrisp 1.2 * Sat Nov 17 2018 Terry Fage <tfage@yahoo.com.au> 0.82-19.sme
122 jcrisp 1.1 - Fix preg_match warnings [SME:10622]
123    
124     * Mon Oct 8 2018 Daniel B. <daniel@firewall-services.com> 0.82-18.sme
125     - Fix potential XSS with unsafe use of PHP_SELF [SME: 10626]
126    
127     * Thu Sep 6 2018 brian r. <brianr@bjsystems.co.uk> 0.82-17.sme
128     - Replace use of ereg by preg_replace as per deprecated in php 5.3 and removed in 7.0
129     - [SME: 10622]
130    
131     * Mon Dec 12 2011 Daniel B. <daniel@firewall-services.com> 0.82-16.sme
132     - Remove php-posix dependency (not available, nor needed on SME 7.x) [SME: 6805]
133    
134     * Wed Oct 26 2011 Daniel B. <daniel@firewall-services.com> 0.82-15.sme
135     - Requires php-posix
136    
137     * Wed Jun 29 2011 Daniel B. <daniel@firewall-services.com> 0.82-14.sme
138     - Don't check issuer (everyone allowed to access /ca can manage
139     all the certificates, access to /ca is controlled by apache)
140    
141     * Tue Mar 15 2011 Daniel B. <daniel@firewall-services.com> 0.82-13.sme
142     - Replace md5 with sha1 for signing
143    
144     * Fri May 28 2010 Daniel B. <daniel@firewall-services.com> [0.82-12]
145     - Weekly update the CRL via cron so MS Crypto API will be happy
146    
147     * Thu Mar 18 2010 Daniel B. <daniel@firewall-services.com> [0.82-11]
148     - Fixe empty password with PHP 5.2 (SME 8b5)
149    
150     * Wed Aug 26 2009 Daniel B. <daniel@firewall-services.com> [0.82-10]
151     - Fixe links for CA help page
152    
153     * Mon Mar 23 2009 Daniel B. <daniel@firewall-services.com> [0.82-9]
154     - Remove links after uninstall so you can easily re-install the contrib
155     later [SME: 5091]
156    
157     * Tue Mar 03 2009 Daniel B. <daniel@firewall-services.com> [0.82-8]
158     - Add e-smith-devtools as a dependencie
159    
160     * Tue Jan 20 2009 Daniel B. <daniel@firewall-services.com> [0.82-7]
161     - Don't replace config file on upgrades
162    
163     * Wed Jan 07 2009 Daniel B. <daniel@firewall-services.com> [0.82-6]
164     - Remove the email address from the file name during upload (in search page)
165     - Remove secure.sh script
166    
167     * Tue Dec 16 2008 Daniel B. <daniel@firewall-services.com> [0.82-5]
168     - Link index.php to setup-presetup.php
169    
170     * Mon Dec 08 2008 Daniel B. <daniel@firewall-services.com> [0.82-4]
171     - Changes so certificates imported from openvpn-bridge are recognized
172     - Configure default admin user to 'admin'
173     - Create a static key for OpenVPN TLS auth (requires openvpn)
174     - Add expirey values (3 Months, 6 Months)
175     - Display or download takey.pem and dhparam1024.pem from
176     the certificate management menue
177     - Display the Root certificate in PEM format
178     - Possibility to download the CRL in PEM format
179     - Remove the email address from the file name during upload
180     - Disable download of certificate after creating a new one
181     - Remove security warning after setup
182    
183     * Fri Dec 05 2008 Daniel B. <daniel@firewall-services.com> [0.82-3]
184     - Correct extension name for email_signing certificates
185     - Remove links, and recreate them in the %post section so upgrade can be done smoothly
186    
187     * Wed Nov 26 2008 Daniel B. <daniel@firewall-services.com> [0.82-0]
188     - initial release
189     - builds from unchanged .tar.gz
190    
191     %prep
192     %setup -c -n %{name}
193 jcrisp 1.2 %patch1 -p1
194 jcrisp 1.3 %patch2 -p1
195 jcrisp 1.4 %patch3 -p1
196 jcrisp 1.5 %patch4 -p1
197 jcrisp 1.7 %patch5 -p1
198 jcrisp 1.8 %patch6 -p1
199 jcrisp 1.1
200     %build
201     %{__mkdir_p} root/opt/phpki/html
202     %{__mkdir_p} root/opt/phpki/phpki-store
203     %{__mkdir_p} root/opt/phpki/bin
204     %{__mkdir_p} root/%{_sysconfdir}/cron.weekly/
205     %{__mv} %{name}-%{version}/gen_crl.php root/opt/phpki/bin/
206     %{__mv} %{name}-%{version}/* root/opt/phpki/html/
207    
208    
209     cat <<"HERE" > root/%{_sysconfdir}/cron.weekly/phpki_update_crl
210     #!/bin/bash
211    
212     cd /opt/phpki/bin
213 jcrisp 1.2 /usr/bin/php74 ./gen_crl.php 2>&1 > /dev/null
214 jcrisp 1.1
215     HERE
216    
217    
218     # Remove links to setup page so upgrades can be done smoothly
219     %{__rm} -f root/opt/phpki/html/index.php
220     %{__rm} -f root/opt/phpki/html/ca/index.php
221     %{__rm} -f root/opt/phpki/html/setup.php
222    
223     # This script shouldn't be here
224     %{__rm} -f root/opt/phpki/html/secure.sh
225    
226    
227     %install
228     rm -rf $RPM_BUILD_ROOT
229     (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
230     rm -f %{name}-%{version}-filelist
231     /sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
232     --file '/opt/phpki/html/config.php' 'attr(660,root,phpki) %config(noreplace)' \
233     --file '/opt/phpki/html/openssl.cnf' 'attr(660,root,phpki) %config(noreplace)' \
234     --file '%{_sysconfdir}/cron.weekly/phpki_update_crl' 'attr(744,root,root)' \
235     --dir '/opt/phpki/html' 'attr(770,root,phpki)' \
236     --dir '/opt/phpki/html/ca' 'attr(770,root,phpki)' \
237     --dir '/opt/phpki/phpki-store' 'attr(750,phpki,phpki)' \
238     > %{name}-%{version}-filelist
239    
240     %files -f %{name}-%{version}-filelist
241     %defattr(-,root,root)
242    
243     %clean
244     cd ..
245     rm -rf $RPM_BUILD_ROOT
246    
247     %pre
248     echo "******************************************************"
249     echo "* "
250     echo "* !!! IMPORTANT - READ THIS NOW !!! "
251     echo "* "
252     echo "******************************************************"
253     echo "* This contrib now has higher levels of encryption"
254     echo "* "
255     echo "* We cannot upgrade your existing certificates"
256     echo "* "
257 jcrisp 1.9 echo "* If you have existing certificates you want to use"
258     echo "* then start with a new CA, backup up, and then restore"
259     echo "* your phpki-store directory in /opt/phpki"
260 jcrisp 1.1 echo "* "
261     echo "******************************************************"
262     echo ""
263    
264     if [ -d /opt/phpki/phpki-store ] ; then
265     echo "Backing up your /opt/phpki/phpki-store"
266     RANDOM=$$
267     PHPKIDIR=$(( 1 + $RANDOM%99999 ))
268     echo "Number is $PHPKIDIR"
269 jcrisp 1.11 echo "Copying from /opt/phpki/phpki-store to /opt/phpki/phpki-store.$PHPKIDIR"
270 jcrisp 1.10 /bin/cp -pr /opt/phpki/phpki-store "/opt/phpki/phpki-store.$PHPKIDIR"
271 jcrisp 1.11 echo "Directory copied...continuing installaton"
272 jcrisp 1.1 else
273     echo "No directory detected...continuing installaton"
274     fi
275    
276 jcrisp 1.11
277 jcrisp 1.1
278     if ! /usr/bin/id phpki &>/dev/null; then
279 jcrisp 1.11 echo "Creating phpki user"
280 jcrisp 1.1 /usr/sbin/useradd -c 'Phpki User' -s /sbin/nologin -r -d /opt/phpki/phpki-store phpki &>/dev/null || \
281     %logmsg "Unexpected error adding user \"phpki\". Abort installation."
282     fi
283    
284     %preun
285    
286    
287     %post
288     # First install, point index.php to setup.php
289     if [ $1 == 1 ]; then
290     %{__ln_s} /opt/phpki/html/setup.php-presetup /opt/phpki/html/index.php
291     %{__ln_s} /opt/phpki/html/setup.php-presetup /opt/phpki/html/setup.php
292     echo "<?php
293     header(\"Location: ./../index.php\");
294     ?>
295     " > /opt/phpki/html/ca/index.php
296     fi
297    
298    
299     %postun
300     # Remove the links to index.php after uninstall
301     if [ $1 == 0 ]; then
302     %{__rm} -f /opt/phpki/html/index.php
303     %{__rm} -f /opt/phpki/html/setup.php
304     %{__rm} -f /opt/phpki/html/ca/index.php
305     fi
306    
307     true

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed