]> git.pld-linux.org Git - packages/ca-certificates.git/blame - ca-certificates.spec
up to 20190110
[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
8acd65db 15%define ver_date 20190110
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
8acd65db 21# Source0-md5: e91d3d9259127ba2dbb65fda58d73f31
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
8acd65db 140%setup -q
ed111db5
JR
141%patch0 -p1
142%patch1 -p1
c7360e68 143%patch2 -p1
0e9b9979 144
835b9580 145%patch5 -p1
94338ec5 146%patch6 -p1
ad8e5716 147%patch7 -p1
ed111db5 148
9af0daca
ER
149%{__sed} -i -e 's,@openssldir@,%{openssldir},' sbin/update-ca-certificates*
150
ed111db5 151install -d certum
1180a18f
ER
152cp -pi %{SOURCE2} certum
153cp -pi %{SOURCE3} certum
154cp -pi %{SOURCE4} certum
155cp -pi %{SOURCE5} certum
156cp -pi %{SOURCE6} certum
157cp -pi %{SOURCE7} certum
158cp -pi %{SOURCE8} certum
159cp -pi %{SOURCE9} certum
160cp -pi %{SOURCE10} certum
161cp -pi %{SOURCE11} certum
162cp -pi %{SOURCE12} certum
163cp -pi %{SOURCE13} certum
a4e3ff05
AZ
164cp -pi %{SOURCE14} certum
165cp -pi %{SOURCE15} certum
166cp -pi %{SOURCE16} certum
167cp -pi %{SOURCE17} certum
168cp -pi %{SOURCE18} certum
169#cp -pi %{SOURCE19} certum
170cp -pi %{SOURCE20} certum
ebf0e82f 171for a in certum/*.pem; do
ca146b29 172 mv -i "$a" "${a%.pem}.crt"
ed111db5
JR
173done
174
1180a18f
ER
175# http://www.sk.ee/en/Repository/certs/rootcertificates
176# JUUR-SK, ESTEID-SK and ESTEID-SK 2007, ESTEID-SK 2011
2190f9b1 177install -d esteid
a4e3ff05
AZ
178cp -pi %{SOURCE26} esteid
179cp -pi %{SOURCE27} esteid
180cp -pi %{SOURCE28} esteid/ESTEID-SK_2007.crt
181cp -pi %{SOURCE29} esteid/ESTEID-SK_2011.crt
2190f9b1 182for a in esteid/*.PEM.cer; do
ca146b29 183 mv -i "$a" "${a%.PEM.cer}.crt"
2190f9b1
ER
184done
185
ed111db5 186%build
277121c2 187install -d terena
a4e3ff05
AZ
188openssl x509 -inform DER -in %{SOURCE21} -outform PEM -out terena/$(basename %{SOURCE21})
189openssl x509 -inform DER -in %{SOURCE22} -outform PEM -out terena/$(basename %{SOURCE22})
190openssl x509 -inform DER -in %{SOURCE23} -outform PEM -out terena/$(basename %{SOURCE23})
191openssl x509 -inform DER -in %{SOURCE24} -outform PEM -out terena/$(basename %{SOURCE24})
192openssl x509 -inform DER -in %{SOURCE25} -outform PEM -out terena/$(basename %{SOURCE25})
a0243bec
AO
193cp %{SOURCE30} terena/$(basename %{SOURCE30} .pem).crt
194cp %{SOURCE31} terena/$(basename %{SOURCE31} .pem).crt
195cp %{SOURCE32} terena/$(basename %{SOURCE32} .pem).crt
196sed 's/\r//' %{SOURCE33} > terena/$(basename %{SOURCE33} .pem).crt
197sed 's/\r//' %{SOURCE34} > terena/$(basename %{SOURCE34} .pem).crt
198sed 's/\r//' %{SOURCE35} > terena/$(basename %{SOURCE35} .pem).crt
199sed 's/\r//' %{SOURCE36} > terena/$(basename %{SOURCE36} .pem).crt
277121c2 200
ed111db5
JR
201%{__make}
202
203# We have those and more in specific dirs
2615c0a7 204%{__rm} mozilla/{Certum,Deutsche_Telekom_Root_CA_2}*.crt
2e4da516 205
7d6b3825 206# See TODO
460ad8a7 207# %{__rm} mozilla/RSA_Security_1024_v3.crt
7d6b3825 208
8bb152c1
ER
209%install
210rm -rf $RPM_BUILD_ROOT
354e0f44 211install -d $RPM_BUILD_ROOT{%{_datadir}/%{name},%{_sbindir},%{certsdir},/etc/pki/tls/certs,%{_sysconfdir}/ca-certificates.d}
8bb152c1
ER
212%{__make} install \
213 DESTDIR=$RPM_BUILD_ROOT
214
55905e01
JR
215find $RPM_BUILD_ROOT%{_datadir}/ca-certificates -name '*.crt' -exec sed -i -e 's/\r$//' {} \;
216
8bb152c1
ER
217(
218cd $RPM_BUILD_ROOT%{_datadir}/ca-certificates
219find . -name '*.crt' | sort | cut -b3-
220) > $RPM_BUILD_ROOT%{_sysconfdir}/ca-certificates.conf
221
94338ec5
ER
222# build %{certsdir}/ca-certificates.crt
223install -d $RPM_BUILD_ROOT%{openssldir}
224./sbin/update-ca-certificates --destdir $RPM_BUILD_ROOT
225rm -rf $RPM_BUILD_ROOT%{openssldir}
8bb152c1 226
354e0f44
ER
227ln -s %{certsdir}/ca-certificates.crt $RPM_BUILD_ROOT/etc/pki/tls/certs/ca-bundle.crt
228
2e4da516
AM
229%if %{with tests}
230install -d pld-tests
231cd pld-tests
232
233# check for duplicates (to avoid X509_STORE_add_cert "cert already in hash table" problem)
1b451e70 234cat $RPM_BUILD_ROOT%{certsdir}/ca-certificates.crt | awk '/BEGIN/ { i++; } /BEGIN/, /END/ { print > i ".extracted.crt" }'
2e4da516
AM
235for cert in *.extracted.crt; do
236 openssl x509 -in "$cert" -noout -sha1 -fingerprint > "$cert.fingerprint"
237done
238DUPLICATES=$(sort *.fingerprint | uniq -c | sort -nr | awk ' { if ($1 != 1) { print $0; } } ')
239if [ -n "$DUPLICATES" ]; then
240 echo -e "\n\nFound duplicates for certificates (count, type, fingerprint):\n\n$DUPLICATES\n\nFailing..."
241 exit 1
242fi
243cd ..
244%endif
245
f1df9d48
JK
246# The Debian path might be hard-coded in some binaries we cannot fix
247# like the Steam client
0923a3c6
JK
248install -d $RPM_BUILD_ROOT/etc/ssl/certs
249ln -s %{certsdir}/ca-certificates.crt $RPM_BUILD_ROOT/etc/ssl/certs
f1df9d48 250
8bb152c1
ER
251%clean
252rm -rf $RPM_BUILD_ROOT
253
302ace1c 254%post update
ed9496cb 255%{_sbindir}/update-ca-certificates --fresh || :
8bb152c1
ER
256
257%files
258%defattr(644,root,root,755)
3dc5e4ea 259%doc debian/README.Debian debian/changelog
a4417de9 260%dir /etc/pki/tls
354e0f44 261%dir /etc/pki/tls/certs
f1df9d48 262%dir /etc/ssl
0923a3c6
JK
263%dir /etc/ssl/certs
264/etc/ssl/certs/ca-certificates.crt
354e0f44 265%config(noreplace) %verify(not md5 mtime size) /etc/pki/tls/certs/ca-bundle.crt
850133d0 266%config(noreplace) %verify(not md5 mtime size) %{certsdir}/ca-certificates.crt
302ace1c
JR
267
268%files update
269%defattr(644,root,root,755)
8bb152c1 270%attr(755,root,root) %{_sbindir}/update-ca-certificates
302ace1c 271%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ca-certificates.conf
53d36f70 272%dir %{_sysconfdir}/ca-certificates.d
8bb152c1 273%{_datadir}/ca-certificates
This page took 0.151948 seconds and 4 git commands to generate.