2 # - cleanup dead links from /etc/openssl/certs after -update uninstall
3 # - deal with removed (renamed) certs on upgrade (as new config is created as
4 # .rpmnew). create some merge tool (or split /etc/ca-certificates.conf to
5 # /etc/ca-certificates.d): http://pastebin.com/04hZd2x0
7 # - https://bugzilla.mozilla.org/show_bug.cgi?id=549701 and
8 # http://groups.google.com/group/mozilla.dev.security.policy/browse_thread/thread/b6493a285ba79998#
10 Summary: Common CA Certificates PEM files
11 Summary(pl.UTF-8): Pliki PEM popularnych certyfikatów CA
15 License: distributable
17 Source0: ftp://ftp.debian.org/debian/pool/main/c/ca-certificates/%{name}_%{version}.tar.gz
18 # Source0-md5: 59edcd927a76cf78ec5bb43f248ea68d
19 Source1: https://www.verisign.com/support/thawte-roots.zip
20 # Source1-md5: a3709cc0279ef3fca4f86ea775066b18
21 Source2: http://www.certum.pl/keys/CA.pem
22 # Source2-md5: 35610177afc9c64e70f1ce62c1885496
23 Source3: http://www.certum.pl/keys/level1.pem
24 # Source3-md5: ba2d2e234ef9cfd2e6e5f810c964862e
25 Source4: http://www.certum.pl/keys/level2.pem
26 # Source4-md5: d06578a04e8cb23071f3870430ea0cf0
27 Source5: http://www.certum.pl/keys/level3.pem
28 # Source5-md5: 47b67c63a52236576fc0d1150327c962
29 Source6: http://www.certum.pl/keys/level4.pem
30 # Source6-md5: f1f8a65d177745311a1e99f029ae5d71
31 Source7: http://www.certum.pl/keys/vs.pem
32 # Source7-md5: 8da19ffc48c5dcc2868b1aa55f1d5983
33 Source8: http://www.certum.pl/keys/na.pem
34 # Source8-md5: ba571cb35e7672ff7ae95132ac1bfec4
35 Source9: http://www.certum.pl/keys/tsa.pem
36 # Source9-md5: 1a7b3faf8ed00f4d80297de74862e102
37 Source10: http://www.certum.pl/keys/class1.pem
38 # Source10-md5: 058436b132ea2df6972821f546104a16
39 Source11: http://www.certum.pl/keys/class2.pem
40 # Source11-md5: 5caf7fe99b1fc6e63c40b3d081711d1b
41 Source12: http://www.certum.pl/keys/class3.pem
42 # Source12-md5: 07bc97e21da092ba53535c7379e1b58b
43 Source13: http://www.certum.pl/keys/class4.pem
44 # Source13-md5: 99ef61d509539af89f1c025b67245965
45 Source14: http://crt.tcs.terena.org/TERENASSLCA.crt
46 # Source14-md5: f62cd1546a8ef14e31ba1ce8eecd234a
47 Source15: http://crt.tcs.terena.org/TERENAeScienceSSLCA.crt
48 # Source15-md5: 5feea35ab01a373f115219706f1f57bd
49 Source16: http://crt.tcs.terena.org/TERENAPersonalCA.crt
50 # Source16-md5: 53eaa497c8fb0b79f14fe9f69693689a
51 Source17: http://crt.tcs.terena.org/TERENAeSciencePersonalCA.crt
52 # Source17-md5: e25cc655d3ebe920ca9c187e3dde9191
53 Source18: http://crt.tcs.terena.org/TERENACodeSigningCA.crt
54 # Source18-md5: 74c9f511ab03a4e6b7462e310abfa89b
55 Source19: http://www.sk.ee/upload/files/JUUR-SK.PEM.cer
56 # Source19-md5: 805784c06c9eff3771a4b9bd631cd3f5
57 Source20: http://www.sk.ee/upload/files/ESTEID-SK.PEM.cer
58 # Source20-md5: 387beee5b8539ab7d91628f486295899
59 Source21: http://www.sk.ee/upload/files/ESTEID-SK%202007.PEM.cer#/ESTEID-SK_2007.PEM.cer
60 # Source21-md5: 2b1a2a77f565d68fdf5f19f6cc3a5600
61 Source22: http://www.sk.ee/upload/files/ESTEID-SK%202011.pem.cer#/ESTEID-SK_2011.pem.cer
62 # Source22-md5: cfcc1e592cb0ff305158a7e32730546c
63 Patch0: %{name}-undebianize.patch
64 Patch1: %{name}-more-certs.patch
65 Patch2: %{name}-etc-certs.patch
66 Patch3: %{name}-c_rehash.sh.patch
67 Patch4: %{name}-endline.patch
68 Patch5: %{name}-mozilla.patch
69 Patch6: %{name}-DESTDIR.patch
70 URL: http://www.cacert.org/
71 BuildRequires: openssl-tools
73 BuildRequires: python-modules
74 BuildRequires: rpm >= 4.4.9-56
75 BuildRequires: sed >= 4.0
77 Obsoletes: certificates
79 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
81 %define certsdir /etc/certs
82 %if "%{pld_release}" == "th"
83 %define openssldir /etc/openssl/certs
85 %define openssldir /var/lib/openssl/certs
89 Common CA Certificates PEM files.
91 %description -l pl.UTF-8
92 Pliki PEM popularnych certyfikatów CA.
95 Summary: Script for updating CA Certificates database
96 Summary(pl.UTF-8): Skrypt do odświeżania bazy certyfikatów CA
98 Requires: %{name} = %{version}-%{release}
100 %if "%{pld_release}" == "ac"
101 Requires: openssl-tools >= 0.9.7m-2
103 Requires: openssl-tools >= 0.9.8i-3
107 Script and data for updating CA Certificates database.
109 %description update -l pl.UTF-8
110 Skrypt i dane do odświeżania bazy certyfikatów CA.
122 %{__sed} -i -e 's,@openssldir@,%{openssldir},' sbin/update-ca-certificates*
124 %{__unzip} -qq %{SOURCE1} -d thawte
126 find thawte/ -name *.pem -o -name *.txt| while read f ; do
127 if (file "$f" | grep -q "PEM"); then
128 ff=$(echo $f | sed -e 's|[ ,]|_|g' -e 's|[()]|=|g')
129 nname=$(basename "$ff" .pem)
130 nname=$(basename "$nname" .txt)
131 nname=$(basename "$nname" _b64)
132 cp -pi "$f" "thawte/${nname}.crt"
134 echo "Skipping $f, doesn't look like PEM CERT"
139 cp -pi %{SOURCE2} certum
140 cp -pi %{SOURCE3} certum
141 cp -pi %{SOURCE4} certum
142 cp -pi %{SOURCE5} certum
143 cp -pi %{SOURCE6} certum
144 cp -pi %{SOURCE7} certum
145 cp -pi %{SOURCE8} certum
146 cp -pi %{SOURCE9} certum
147 cp -pi %{SOURCE10} certum
148 cp -pi %{SOURCE11} certum
149 cp -pi %{SOURCE12} certum
150 cp -pi %{SOURCE13} certum
151 for a in certum/*.pem; do
152 mv -i "$a" "${a%.pem}.crt"
156 openssl x509 -inform DER -in %{SOURCE14} -outform PEM -out terena/$(basename %{SOURCE14})
157 openssl x509 -inform DER -in %{SOURCE15} -outform PEM -out terena/$(basename %{SOURCE15})
158 openssl x509 -inform DER -in %{SOURCE16} -outform PEM -out terena/$(basename %{SOURCE16})
159 openssl x509 -inform DER -in %{SOURCE17} -outform PEM -out terena/$(basename %{SOURCE17})
160 openssl x509 -inform DER -in %{SOURCE18} -outform PEM -out terena/$(basename %{SOURCE18})
162 # http://www.sk.ee/en/Repository/certs/rootcertificates
163 # JUUR-SK, ESTEID-SK and ESTEID-SK 2007, ESTEID-SK 2011
165 cp -pi %{SOURCE19} esteid
166 cp -pi %{SOURCE20} esteid
167 cp -pi %{SOURCE21} esteid/ESTEID-SK_2007.crt
168 cp -pi %{SOURCE22} esteid/ESTEID-SK_2011.crt
169 for a in esteid/*.PEM.cer; do
170 mv -i "$a" "${a%.PEM.cer}.crt"
176 # We have those and more in specific dirs
177 rm mozilla/{Thawte,thawte,Certum,IGC_A,Deutsche_Telekom_Root_CA_2,Juur-SK}*.crt
180 # rm mozilla/RSA_Security_1024_v3.crt
183 rm -rf $RPM_BUILD_ROOT
184 install -d $RPM_BUILD_ROOT{%{_datadir}/%{name},%{_sbindir},%{certsdir}}
187 DESTDIR=$RPM_BUILD_ROOT
189 find $RPM_BUILD_ROOT%{_datadir}/ca-certificates -name '*.crt' -exec sed -i -e 's/\r$//' {} \;
192 cd $RPM_BUILD_ROOT%{_datadir}/ca-certificates
193 find . -name '*.crt' | sort | cut -b3-
194 ) > $RPM_BUILD_ROOT%{_sysconfdir}/ca-certificates.conf
196 # build %{certsdir}/ca-certificates.crt
197 install -d $RPM_BUILD_ROOT%{openssldir}
198 ./sbin/update-ca-certificates --destdir $RPM_BUILD_ROOT
199 rm -rf $RPM_BUILD_ROOT%{openssldir}
202 rm -rf $RPM_BUILD_ROOT
205 %{_sbindir}/update-ca-certificates --fresh || :
208 %defattr(644,root,root,755)
209 %config(noreplace) %verify(not md5 mtime size) %{certsdir}/ca-certificates.crt
212 %defattr(644,root,root,755)
213 %attr(755,root,root) %{_sbindir}/update-ca-certificates
214 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ca-certificates.conf
215 %{_datadir}/ca-certificates