]> git.pld-linux.org Git - packages/ca-certificates.git/blob - ca-certificates.spec
df3443ff381d36bce9c9dc5d2ad3f657f9e939e8
[packages/ca-certificates.git] / ca-certificates.spec
1 # TODO
2 # - cleanup dead links from /etc/openssl/certs after -update uninstall
3 # - https://bugzilla.mozilla.org/show_bug.cgi?id=549701 and
4 #   http://groups.google.com/group/mozilla.dev.security.policy/browse_thread/thread/b6493a285ba79998#
5 # - make amsn use system certs
6 # - make pidgin use system certs
7 # - swap %{certsdir}/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt regards file vs symlink
8 #
9 %bcond_without  tests
10 Summary:        Common CA Certificates PEM files
11 Summary(pl.UTF-8):      Pliki PEM popularnych certyfikatów CA
12 Name:           ca-certificates
13 Version:        20160104
14 Release:        2
15 License:        GPL v2 (scripts), MPL v2 (mozilla certs), distributable (other certs)
16 Group:          Libraries
17 Source0:        ftp://ftp.debian.org/debian/pool/main/c/ca-certificates/%{name}_%{version}.tar.xz
18 # Source0-md5:  d9665a83d0d3ef8176a38e6aa20458e9
19 Source1:        https://www.verisign.com/support/thawte-roots.zip
20 # Source1-md5:  21a284ebdc6e8f4178d5cc10fb9e1ef2
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://www.certum.pl/CTNCA.pem
46 # Source14-md5: 231b5b8bf05c5e93a9b2ebc4186eb6f7
47 Source15:       http://repository.certum.pl/class1casha2.pem
48 # Source15-md5: b52dde6e2618a21965afbe6d6676d09f
49 Source16:       http://repository.certum.pl/dvcasha2.pem
50 # Source16-md5: 88ce64a84375c95ab6f7c8515dd2a117
51 Source17:       http://repository.certum.pl/ovcasha2.pem
52 # Source17-md5: 3149c923bd23469d6b14caa6334f8b63
53 Source18:       http://repository.certum.pl/evcasha2.pem
54 # Source18-md5: ac54dc6cf3af7e243879b1c8b4aca8a3
55 #Source19:      http://repository.certum.pl/dvcasha2.pem
56 ## Source19-md5:        88ce64a84375c95ab6f7c8515dd2a117
57 Source20:       http://repository.certum.pl/gscasha2.pem
58 # Source20-md5: a29d37f95dafc08cef36015922e3b0d3
59 Source21:       http://crt.tcs.terena.org/TERENASSLCA.crt
60 # Source21-md5: f62cd1546a8ef14e31ba1ce8eecd234a
61 Source22:       http://crt.tcs.terena.org/TERENAeScienceSSLCA.crt
62 # Source22-md5: 5feea35ab01a373f115219706f1f57bd
63 Source23:       http://crt.tcs.terena.org/TERENAPersonalCA.crt
64 # Source23-md5: 53eaa497c8fb0b79f14fe9f69693689a
65 Source24:       http://crt.tcs.terena.org/TERENAeSciencePersonalCA.crt
66 # Source24-md5: e25cc655d3ebe920ca9c187e3dde9191
67 Source25:       http://crt.tcs.terena.org/TERENACodeSigningCA.crt
68 # Source25-md5: 74c9f511ab03a4e6b7462e310abfa89b
69 Source26:       http://www.sk.ee/upload/files/JUUR-SK.PEM.cer
70 # Source26-md5: 805784c06c9eff3771a4b9bd631cd3f5
71 Source27:       http://www.sk.ee/upload/files/ESTEID-SK.PEM.cer
72 # Source27-md5: 387beee5b8539ab7d91628f486295899
73 Source28:       http://www.sk.ee/upload/files/ESTEID-SK%202007.PEM.cer?/ESTEID-SK_2007.PEM.cer
74 # Source28-md5: 2b1a2a77f565d68fdf5f19f6cc3a5600
75 Source29:       http://www.sk.ee/upload/files/ESTEID-SK%202011.pem.cer?/ESTEID-SK_2011.pem.cer
76 # Source29-md5: cfcc1e592cb0ff305158a7e32730546c
77 Source30:       http://www.terena.org/activities/tcs/repository/sha2/TERENA_SSL_CA_2.pem
78 # Source30-md5: 96700974350cecfcfbd904d52c3a3942
79 Source31:       http://www.terena.org/activities/tcs/repository/sha2/TERENA_Personal_CA_2.pem
80 # Source31-md5: d40e5c821f8559faf5bcd55eac5e1371
81 Source32:       http://www.terena.org/activities/tcs/repository/sha2/TERENA_Code_Signing_CA_2.pem
82 # Source32-md5: 69ff653e730adf87ff59bf373950b357
83 Source33:       http://www.terena.org/activities/tcs/repository-g3/TERENA_SSL_CA_3.pem
84 # Source33-md5: b22ed904900ed6b3bc129f9a35ba5a66
85 Source34:       http://www.terena.org/activities/tcs/repository-g3/TERENA_Personal_CA_3.pem
86 # Source34-md5: eb5ddefe94750c2f8d4f11cb1f3af911
87 Source35:       http://www.terena.org/activities/tcs/repository-g3/TERENA_Code_Signing_CA_3.pem
88 # Source35-md5: 43375a208fba0a5e73f1912faa4db86d
89 Source36:       http://www.terena.org/activities/tcs/repository-g3/TERENA_SSL_High_Assurance_CA_3.pem
90 # Source36-md5: 6e00d9ede4460e739eb285ea023299f0
91 Patch0:         %{name}-undebianize.patch
92 Patch1:         %{name}-more-certs.patch
93 Patch2:         %{name}-etc-certs.patch
94 Patch3:         %{name}-c_rehash.sh.patch
95 Patch5:         %{name}-DESTDIR.patch
96 Patch6:         %{name}.d.patch
97 URL:            https://packages.debian.org/sid/ca-certificates
98 BuildRequires:  openssl-tools
99 BuildRequires:  python
100 BuildRequires:  python-modules
101 BuildRequires:  rpm >= 4.4.9-56
102 BuildRequires:  sed >= 4.0
103 BuildRequires:  tar >= 1:1.22
104 BuildRequires:  unzip
105 BuildRequires:  xz
106 Obsoletes:      certificates
107 BuildArch:      noarch
108 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
109
110 %define         certsdir        /etc/certs
111 %define         openssldir      /etc/openssl/certs
112
113 %description
114 Common CA Certificates PEM files.
115
116 %description -l pl.UTF-8
117 Pliki PEM popularnych certyfikatów CA.
118
119 %package update
120 Summary:        Script for updating CA Certificates database
121 Summary(pl.UTF-8):      Skrypt do odświeżania bazy certyfikatów CA
122 Group:          Libraries
123 Requires:       %{name} = %{version}-%{release}
124 Requires:       mktemp
125 %if "%{pld_release}" == "ac"
126 Requires:       openssl-tools >= 0.9.7m-6.3
127 %else
128 Requires:       openssl-tools >= 0.9.8i-3
129 %endif
130
131 %description update
132 Script and data for updating CA Certificates database.
133
134 %description update -l pl.UTF-8
135 Skrypt i dane do odświeżania bazy certyfikatów CA.
136
137 %prep
138 %setup -qc
139 mv %{name}/* .
140 %patch0 -p1
141 %patch1 -p1
142 %patch2 -p1
143 %patch3 -p1
144 %patch5 -p1
145 %patch6 -p1
146
147 %{__sed} -i -e 's,@openssldir@,%{openssldir},' sbin/update-ca-certificates*
148
149 %{__unzip} -qq %{SOURCE1} -d thawte
150
151 find thawte/ -name *.pem -o -name *.txt| while read f ; do
152         if (file "$f" | grep -q "PEM"); then
153                 ff=$(echo $f | sed -e 's|[ ,]|_|g' -e 's|[()]|=|g')
154                 nname=$(basename "$ff" .pem)
155                 nname=$(basename "$nname" .txt)
156                 nname=$(basename "$nname" _b64)
157                 cp -pi "$f" "thawte/${nname}.crt"
158         else
159                 echo "Skipping $f, doesn't look like PEM CERT"
160         fi
161 done
162
163 install -d certum
164 cp -pi %{SOURCE2} certum
165 cp -pi %{SOURCE3} certum
166 cp -pi %{SOURCE4} certum
167 cp -pi %{SOURCE5} certum
168 cp -pi %{SOURCE6} certum
169 cp -pi %{SOURCE7} certum
170 cp -pi %{SOURCE8} certum
171 cp -pi %{SOURCE9} certum
172 cp -pi %{SOURCE10} certum
173 cp -pi %{SOURCE11} certum
174 cp -pi %{SOURCE12} certum
175 cp -pi %{SOURCE13} certum
176 cp -pi %{SOURCE14} certum
177 cp -pi %{SOURCE15} certum
178 cp -pi %{SOURCE16} certum
179 cp -pi %{SOURCE17} certum
180 cp -pi %{SOURCE18} certum
181 #cp -pi %{SOURCE19} certum
182 cp -pi %{SOURCE20} certum
183 for a in certum/*.pem; do
184         mv -i "$a" "${a%.pem}.crt"
185 done
186
187 # http://www.sk.ee/en/Repository/certs/rootcertificates
188 # JUUR-SK, ESTEID-SK and ESTEID-SK 2007, ESTEID-SK 2011
189 install -d esteid
190 cp -pi %{SOURCE26} esteid
191 cp -pi %{SOURCE27} esteid
192 cp -pi %{SOURCE28} esteid/ESTEID-SK_2007.crt
193 cp -pi %{SOURCE29} esteid/ESTEID-SK_2011.crt
194 for a in esteid/*.PEM.cer; do
195         mv -i "$a" "${a%.PEM.cer}.crt"
196 done
197
198 %build
199 install -d terena
200 openssl x509 -inform DER -in %{SOURCE21} -outform PEM -out terena/$(basename %{SOURCE21})
201 openssl x509 -inform DER -in %{SOURCE22} -outform PEM -out terena/$(basename %{SOURCE22})
202 openssl x509 -inform DER -in %{SOURCE23} -outform PEM -out terena/$(basename %{SOURCE23})
203 openssl x509 -inform DER -in %{SOURCE24} -outform PEM -out terena/$(basename %{SOURCE24})
204 openssl x509 -inform DER -in %{SOURCE25} -outform PEM -out terena/$(basename %{SOURCE25})
205 cp %{SOURCE30} terena/$(basename %{SOURCE30} .pem).crt
206 cp %{SOURCE31} terena/$(basename %{SOURCE31} .pem).crt
207 cp %{SOURCE32} terena/$(basename %{SOURCE32} .pem).crt
208 sed 's/\r//' %{SOURCE33} > terena/$(basename %{SOURCE33} .pem).crt
209 sed 's/\r//' %{SOURCE34} > terena/$(basename %{SOURCE34} .pem).crt
210 sed 's/\r//' %{SOURCE35} > terena/$(basename %{SOURCE35} .pem).crt
211 sed 's/\r//' %{SOURCE36} > terena/$(basename %{SOURCE36} .pem).crt
212
213 %{__make}
214
215 # We have those and more in specific dirs
216 rm mozilla/{thawte,Certum,IGC_A,Deutsche_Telekom_Root_CA_2,Juur-SK}*.crt
217
218 # Duplicate with Verisign_Class_3_Public_Primary_Certification_Authority_2.crt
219 rm thawte/Class_3_Public_Primary_Certification_Authority.crt
220
221 # See TODO
222 # rm mozilla/RSA_Security_1024_v3.crt
223
224 %install
225 rm -rf $RPM_BUILD_ROOT
226 install -d $RPM_BUILD_ROOT{%{_datadir}/%{name},%{_sbindir},%{certsdir},/etc/pki/tls/certs,%{_sysconfdir}/ca-certificates.d}
227 %{__make} install \
228         DESTDIR=$RPM_BUILD_ROOT
229
230 find $RPM_BUILD_ROOT%{_datadir}/ca-certificates -name '*.crt' -exec sed -i -e 's/\r$//' {} \;
231
232 (
233 cd $RPM_BUILD_ROOT%{_datadir}/ca-certificates
234 find . -name '*.crt' | sort | cut -b3-
235 ) > $RPM_BUILD_ROOT%{_sysconfdir}/ca-certificates.conf
236
237 # build %{certsdir}/ca-certificates.crt
238 install -d $RPM_BUILD_ROOT%{openssldir}
239 ./sbin/update-ca-certificates --destdir $RPM_BUILD_ROOT
240 rm -rf $RPM_BUILD_ROOT%{openssldir}
241
242 ln -s %{certsdir}/ca-certificates.crt $RPM_BUILD_ROOT/etc/pki/tls/certs/ca-bundle.crt
243
244 %if %{with tests}
245 install -d pld-tests
246 cd pld-tests
247
248 # check for duplicates (to avoid X509_STORE_add_cert "cert already in hash table" problem)
249 cat $RPM_BUILD_ROOT/%{certsdir}/ca-certificates.crt | awk '/BEGIN/ { i++; } /BEGIN/, /END/ { print > i ".extracted.crt" }'
250 for cert in *.extracted.crt; do
251         openssl x509 -in "$cert" -noout -sha1 -fingerprint > "$cert.fingerprint"
252 done
253 DUPLICATES=$(sort *.fingerprint | uniq -c | sort -nr | awk ' { if ($1 != 1) { print $0; } } ')
254 if [ -n "$DUPLICATES" ]; then
255         echo -e "\n\nFound duplicates for certificates (count, type, fingerprint):\n\n$DUPLICATES\n\nFailing..."
256         exit 1
257 fi
258 cd ..
259 %endif
260
261 %clean
262 rm -rf $RPM_BUILD_ROOT
263
264 %post update
265 %{_sbindir}/update-ca-certificates --fresh || :
266
267 %files
268 %defattr(644,root,root,755)
269 %doc debian/README.Debian debian/changelog
270 %dir /etc/pki/tls
271 %dir /etc/pki/tls/certs
272 %config(noreplace) %verify(not md5 mtime size) /etc/pki/tls/certs/ca-bundle.crt
273 %config(noreplace) %verify(not md5 mtime size) %{certsdir}/ca-certificates.crt
274
275 %files update
276 %defattr(644,root,root,755)
277 %attr(755,root,root) %{_sbindir}/update-ca-certificates
278 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ca-certificates.conf
279 %dir %{_sysconfdir}/ca-certificates.d
280 %{_datadir}/ca-certificates
This page took 0.043736 seconds and 2 git commands to generate.