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

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

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


Revision 1.9 - (show annotations) (download)
Sat Apr 3 14:32:38 2021 UTC (3 years, 7 months ago) by jcrisp
Branch: MAIN
CVS Tags: phpki-ng-0_84-8_el7_sme
Changes since 1.8: +7 -4 lines
* Sat Apr 03 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-7.sme
- copy phpki-store as a backup instead of move

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

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