1 |
jcrisp |
1.2 |
# $Id: phpki.spec,v 1.1 2020/11/24 14:36:05 brianr Exp $ |
2 |
brianr |
1.1 |
# Authority: vip-ire |
3 |
|
|
# Name: Daniel Berteaud |
4 |
|
|
|
5 |
|
|
%define name phpki |
6 |
|
|
%define version 0.82 |
7 |
jcrisp |
1.2 |
%define release 24 |
8 |
brianr |
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: phpki-0.82.tar.gz |
17 |
|
|
Patch1: phpki-0.82-email_signing.patch |
18 |
|
|
Patch2: phpki-0.82-sme_openvpn_bridge_compat.patch |
19 |
|
|
Patch3: phpki-0.82-sme_admin_user.patch |
20 |
|
|
Patch4: phpki-0.82-openvpn_static_key.patch |
21 |
|
|
Patch5: phpki-0.82-expirey.patch |
22 |
|
|
Patch6: phpki-0.82-dl_display_ta_dh.patch |
23 |
|
|
Patch7: phpki-0.82-dl_crl_in_pem.patch |
24 |
|
|
Patch8: phpki-0.82-remove_email_from_upload_file_name.patch |
25 |
|
|
Patch9: phpki-0.82-display_root_pem.patch |
26 |
|
|
Patch10: phpki-0.82-disable_download_after_create.patch |
27 |
|
|
Patch11: phpki-0.82-remove_security_warning.patch |
28 |
|
|
Patch12: phpki-0.82-remove_email_from_upload_file_name.patch2 |
29 |
|
|
Patch13: phpki-0.82-ca_help.patch |
30 |
|
|
Patch14: phpki-0.82-empty_pass_php_5.2.patch |
31 |
|
|
Patch15: phpki-0.82-update_crl_via_cron.patch |
32 |
|
|
Patch16: phpki-0.82-use_sha1.patch |
33 |
|
|
Patch17: phpki-0.82-ca_admin_users.patch |
34 |
|
|
Patch18: phpki-0.82.bz10622.fixphpwarnings.patch |
35 |
|
|
Patch19: phpki-0.82-potential_xss_php_self.patch |
36 |
|
|
Patch20: phpki-0.82-fix-preg_match.patch |
37 |
|
|
Patch21: phpki-0.82-fix-dates.patch |
38 |
|
|
Patch22: phpki-0.82-fix-dates-2.patch |
39 |
|
|
Patch23: phpki-0.82-fix-dates-3.patch |
40 |
|
|
|
41 |
|
|
BuildArch: noarch |
42 |
|
|
BuildRoot: /var/tmp/%{name}-%{version} |
43 |
|
|
|
44 |
|
|
BuildRequires: e-smith-devtools |
45 |
|
|
|
46 |
jcrisp |
1.2 |
Requires: e-smith-release >= 10.0 |
47 |
brianr |
1.1 |
Requires: php |
48 |
|
|
Requires: openssl |
49 |
|
|
Requires: openvpn |
50 |
|
|
AutoReqProv: no |
51 |
|
|
|
52 |
|
|
%description |
53 |
|
|
http://sourceforge.net/projects/phpki/ |
54 |
|
|
PHPki is an Open Source Web application for managing a multi-agency PKI for HIPAA compliance. |
55 |
|
|
With it, you may create and centrally manage X.509 certificates for use with S/MIME enabled |
56 |
|
|
e-mail clients, SSL servers, and VPN applications. |
57 |
|
|
|
58 |
|
|
%changelog |
59 |
jcrisp |
1.2 |
* Tue Nov 24 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.82-24.sme |
60 |
|
|
- Fix error in phpki-0.82-fix-dates.patch |
61 |
|
|
|
62 |
brianr |
1.1 |
* Thu Apr 02 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.82-23.sme |
63 |
|
|
- Add secondary date sort after Status sort |
64 |
|
|
|
65 |
|
|
* Thu Apr 02 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.82-22.sme |
66 |
|
|
- Add the patch file which I forgot |
67 |
|
|
|
68 |
|
|
* Thu Apr 02 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.82-21.sme |
69 |
|
|
- Modify the dates fix to sort digitally |
70 |
|
|
|
71 |
|
|
* Tue Mar 03 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.82-20.sme |
72 |
|
|
- Backporting some fixes from 0.83+ |
73 |
|
|
- Fix start/finish/revoke dates |
74 |
|
|
- expand preg match statements |
75 |
|
|
- Fix some formatting |
76 |
|
|
- Bump the required release version |
77 |
|
|
- Fix country code check [SME:8911] |
78 |
|
|
|
79 |
|
|
* Sat Nov 17 2018 Terry Fage <tfage@yahoo.com.au> 0.82-19.sme |
80 |
|
|
- Fix preg_match warnings [SME:10622] |
81 |
|
|
|
82 |
|
|
* Mon Oct 8 2018 Daniel B. <daniel@firewall-services.com> 0.82-18.sme |
83 |
|
|
- Fix potential XSS with unsafe use of PHP_SELF [SME: 10626] |
84 |
|
|
|
85 |
|
|
* Thu Sep 6 2018 brian r. <brianr@bjsystems.co.uk> 0.82-17.sme |
86 |
|
|
- Replace use of ereg by preg_replace as per deprecated in php 5.3 and removed in 7.0 |
87 |
|
|
- [SME: 10622] |
88 |
|
|
|
89 |
|
|
* Mon Dec 12 2011 Daniel B. <daniel@firewall-services.com> 0.82-16.sme |
90 |
|
|
- Remove php-posix dependency (not available, nor needed on SME 7.x) [SME: 6805] |
91 |
|
|
|
92 |
|
|
* Wed Oct 26 2011 Daniel B. <daniel@firewall-services.com> 0.82-15.sme |
93 |
|
|
- Requires php-posix |
94 |
|
|
|
95 |
|
|
* Wed Jun 29 2011 Daniel B. <daniel@firewall-services.com> 0.82-14.sme |
96 |
|
|
- Don't check issuer (everyone allowed to access /ca can manage |
97 |
|
|
all the certificates, access to /ca is controlled by apache) |
98 |
|
|
|
99 |
|
|
* Tue Mar 15 2011 Daniel B. <daniel@firewall-services.com> 0.82-13.sme |
100 |
|
|
- Replace md5 with sha1 for signing |
101 |
|
|
|
102 |
|
|
* Fri May 28 2010 Daniel B. <daniel@firewall-services.com> [0.82-12] |
103 |
|
|
- Weekly update the CRL via cron so MS Crypto API will be happy |
104 |
|
|
|
105 |
|
|
* Thu Mar 18 2010 Daniel B. <daniel@firewall-services.com> [0.82-11] |
106 |
|
|
- Fixe empty password with PHP 5.2 (SME 8b5) |
107 |
|
|
|
108 |
|
|
* Wed Aug 26 2009 Daniel B. <daniel@firewall-services.com> [0.82-10] |
109 |
|
|
- Fixe links for CA help page |
110 |
|
|
|
111 |
|
|
* Mon Mar 23 2009 Daniel B. <daniel@firewall-services.com> [0.82-9] |
112 |
|
|
- Remove links after uninstall so you can easily re-install the contrib |
113 |
|
|
later [SME: 5091] |
114 |
|
|
|
115 |
|
|
* Tue Mar 03 2009 Daniel B. <daniel@firewall-services.com> [0.82-8] |
116 |
|
|
- Add e-smith-devtools as a dependencie |
117 |
|
|
|
118 |
|
|
* Tue Jan 20 2009 Daniel B. <daniel@firewall-services.com> [0.82-7] |
119 |
|
|
- Don't replace config file on upgrades |
120 |
|
|
|
121 |
|
|
* Wed Jan 07 2009 Daniel B. <daniel@firewall-services.com> [0.82-6] |
122 |
|
|
- Remove the email address from the file name during upload (in search page) |
123 |
|
|
- Remove secure.sh script |
124 |
|
|
|
125 |
|
|
* Tue Dec 16 2008 Daniel B. <daniel@firewall-services.com> [0.82-5] |
126 |
|
|
- Link index.php to setup-presetup.php |
127 |
|
|
|
128 |
|
|
* Mon Dec 08 2008 Daniel B. <daniel@firewall-services.com> [0.82-4] |
129 |
|
|
- Changes so certificates imported from openvpn-bridge are recognized |
130 |
|
|
- Configure default admin user to 'admin' |
131 |
|
|
- Create a static key for OpenVPN TLS auth (requires openvpn) |
132 |
|
|
- Add expirey values (3 Months, 6 Months) |
133 |
|
|
- Display or download takey.pem and dhparam1024.pem from |
134 |
|
|
the certificate management menue |
135 |
|
|
- Display the Root certificate in PEM format |
136 |
|
|
- Possibility to download the CRL in PEM format |
137 |
|
|
- Remove the email address from the file name during upload |
138 |
|
|
- Disable download of certificate after creating a new one |
139 |
|
|
- Remove security warning after setup |
140 |
|
|
|
141 |
jcrisp |
1.2 |
* Fri Dec 05 2008 Daniel B. <daniel@firewall-services.com> [0.82-3] |
142 |
brianr |
1.1 |
- Correct extension name for email_signing certificates |
143 |
|
|
- Remove links, and recreate them in the %post section so upgrade can be done smoothly |
144 |
|
|
|
145 |
|
|
* Wed Nov 26 2008 Daniel B. <daniel@firewall-services.com> [0.82-0] |
146 |
|
|
- initial release |
147 |
|
|
- builds from unchanged .tar.gz |
148 |
|
|
|
149 |
|
|
%prep |
150 |
|
|
%setup -c -n %{name} |
151 |
|
|
%patch1 -p1 |
152 |
|
|
%patch2 -p1 |
153 |
|
|
%patch3 -p1 |
154 |
|
|
%patch4 -p1 |
155 |
|
|
%patch5 -p1 |
156 |
|
|
%patch6 -p1 |
157 |
|
|
%patch7 -p1 |
158 |
|
|
%patch8 -p1 |
159 |
|
|
%patch9 -p1 |
160 |
|
|
%patch10 -p1 |
161 |
|
|
%patch11 -p1 |
162 |
|
|
%patch12 -p1 |
163 |
|
|
%patch13 -p1 |
164 |
|
|
%patch14 -p1 |
165 |
|
|
%patch15 -p1 |
166 |
|
|
%patch16 -p1 |
167 |
|
|
%patch17 -p1 |
168 |
|
|
%patch18 -p1 |
169 |
|
|
%patch19 -p1 |
170 |
|
|
%patch20 -p1 |
171 |
|
|
%patch21 -p1 |
172 |
|
|
%patch22 -p1 |
173 |
|
|
%patch23 -p1 |
174 |
|
|
|
175 |
|
|
%build |
176 |
|
|
%{__mkdir_p} root/opt/phpki/html |
177 |
|
|
%{__mkdir_p} root/opt/phpki/phpki-store |
178 |
|
|
%{__mkdir_p} root/opt/phpki/bin |
179 |
|
|
%{__mkdir_p} root/%{_sysconfdir}/cron.weekly/ |
180 |
|
|
%{__mv} %{name}-%{version}/gen_crl.php root/opt/phpki/bin/ |
181 |
|
|
%{__mv} %{name}-%{version}/* root/opt/phpki/html/ |
182 |
|
|
|
183 |
|
|
|
184 |
|
|
cat <<"HERE" > root/%{_sysconfdir}/cron.weekly/phpki_update_crl |
185 |
|
|
#!/bin/bash |
186 |
|
|
|
187 |
|
|
cd /opt/phpki/bin |
188 |
|
|
php ./gen_crl.php 2>&1 > /dev/null |
189 |
|
|
|
190 |
|
|
HERE |
191 |
|
|
|
192 |
|
|
|
193 |
|
|
# Remove links to setup page so upgrades can be done smoothly |
194 |
|
|
%{__rm} -f root/opt/phpki/html/index.php |
195 |
|
|
%{__rm} -f root/opt/phpki/html/ca/index.php |
196 |
|
|
%{__rm} -f root/opt/phpki/html/setup.php |
197 |
|
|
|
198 |
|
|
# This script shouldn't be here |
199 |
|
|
%{__rm} -f root/opt/phpki/html/secure.sh |
200 |
|
|
|
201 |
|
|
|
202 |
|
|
%install |
203 |
|
|
rm -rf $RPM_BUILD_ROOT |
204 |
|
|
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
205 |
|
|
rm -f %{name}-%{version}-filelist |
206 |
|
|
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
207 |
|
|
--file '/opt/phpki/html/config.php' 'attr(660,root,phpki) %config(noreplace)' \ |
208 |
|
|
--file '/opt/phpki/html/openssl.cnf' 'attr(660,root,phpki) %config(noreplace)' \ |
209 |
|
|
--file '%{_sysconfdir}/cron.weekly/phpki_update_crl' 'attr(744,root,root)' \ |
210 |
|
|
--dir '/opt/phpki/html' 'attr(770,root,phpki)' \ |
211 |
|
|
--dir '/opt/phpki/html/ca' 'attr(770,root,phpki)' \ |
212 |
|
|
--dir '/opt/phpki/phpki-store' 'attr(750,phpki,phpki)' \ |
213 |
|
|
> %{name}-%{version}-filelist |
214 |
|
|
|
215 |
|
|
%files -f %{name}-%{version}-filelist |
216 |
|
|
%defattr(-,root,root) |
217 |
|
|
|
218 |
|
|
%clean |
219 |
|
|
cd .. |
220 |
|
|
rm -rf $RPM_BUILD_ROOT |
221 |
|
|
|
222 |
|
|
%pre |
223 |
|
|
if ! /usr/bin/id phpki &>/dev/null; then |
224 |
|
|
/usr/sbin/useradd -c 'Phpki User' -s /sbin/nologin -r -d /opt/phpki/phpki-store phpki &>/dev/null || \ |
225 |
|
|
%logmsg "Unexpected error adding user \"phpki\". Abort installation." |
226 |
|
|
fi |
227 |
|
|
|
228 |
|
|
%preun |
229 |
|
|
|
230 |
|
|
%post |
231 |
|
|
# First install, point index.php to setup.php |
232 |
|
|
if [ $1 == 1 ]; then |
233 |
|
|
%{__ln_s} /opt/phpki/html/setup.php-presetup /opt/phpki/html/index.php |
234 |
|
|
%{__ln_s} /opt/phpki/html/setup.php-presetup /opt/phpki/html/setup.php |
235 |
|
|
echo "<?php |
236 |
|
|
header(\"Location: ./../index.php\"); |
237 |
|
|
?> |
238 |
|
|
" > /opt/phpki/html/ca/index.php |
239 |
|
|
fi |
240 |
|
|
|
241 |
|
|
%postun |
242 |
|
|
# Remove the links to index.php after uninstall |
243 |
|
|
if [ $1 == 0 ]; then |
244 |
|
|
%{__rm} -f /opt/phpki/html/index.php |
245 |
|
|
%{__rm} -f /opt/phpki/html/setup.php |
246 |
|
|
%{__rm} -f /opt/phpki/html/ca/index.php |
247 |
|
|
fi |
248 |
|
|
|
249 |
|
|
|
250 |
|
|
true |