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