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