- %prep that depends BR moved to build
[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#
5f860554 5# - add certs noted in TODO file
7d6b3825 6#
8bb152c1 7Summary: Common CA Certificates PEM files
500a6231 8Summary(pl.UTF-8): Pliki PEM popularnych certyfikatów CA
8bb152c1 9Name: ca-certificates
c26c6065 10Version: 20120623
a8481605 11Release: 4
c26c6065 12License: GPL v2 (scripts), MPL v2 (mozilla certs), distributable (other certs)
8bb152c1 13Group: Libraries
83311e47 14Source0: ftp://ftp.debian.org/debian/pool/main/c/ca-certificates/%{name}_%{version}.tar.gz
c26c6065 15# Source0-md5: 5105d4cc086f0d4ecf7bf2e4c4667289
6c894e75 16Source1: https://www.verisign.com/support/thawte-roots.zip
1d6b4a6a 17# Source1-md5: a3709cc0279ef3fca4f86ea775066b18
ed111db5
JR
18Source2: http://www.certum.pl/keys/CA.pem
19# Source2-md5: 35610177afc9c64e70f1ce62c1885496
20Source3: http://www.certum.pl/keys/level1.pem
21# Source3-md5: ba2d2e234ef9cfd2e6e5f810c964862e
22Source4: http://www.certum.pl/keys/level2.pem
23# Source4-md5: d06578a04e8cb23071f3870430ea0cf0
24Source5: http://www.certum.pl/keys/level3.pem
25# Source5-md5: 47b67c63a52236576fc0d1150327c962
26Source6: http://www.certum.pl/keys/level4.pem
27# Source6-md5: f1f8a65d177745311a1e99f029ae5d71
28Source7: http://www.certum.pl/keys/vs.pem
29# Source7-md5: 8da19ffc48c5dcc2868b1aa55f1d5983
30Source8: http://www.certum.pl/keys/na.pem
31# Source8-md5: ba571cb35e7672ff7ae95132ac1bfec4
32Source9: http://www.certum.pl/keys/tsa.pem
33# Source9-md5: 1a7b3faf8ed00f4d80297de74862e102
34Source10: http://www.certum.pl/keys/class1.pem
35# Source10-md5: 058436b132ea2df6972821f546104a16
36Source11: http://www.certum.pl/keys/class2.pem
37# Source11-md5: 5caf7fe99b1fc6e63c40b3d081711d1b
38Source12: http://www.certum.pl/keys/class3.pem
39# Source12-md5: 07bc97e21da092ba53535c7379e1b58b
40Source13: http://www.certum.pl/keys/class4.pem
41# Source13-md5: 99ef61d509539af89f1c025b67245965
835b9580
JR
42Source14: http://crt.tcs.terena.org/TERENASSLCA.crt
43# Source14-md5: f62cd1546a8ef14e31ba1ce8eecd234a
44Source15: http://crt.tcs.terena.org/TERENAeScienceSSLCA.crt
45# Source15-md5: 5feea35ab01a373f115219706f1f57bd
46Source16: http://crt.tcs.terena.org/TERENAPersonalCA.crt
47# Source16-md5: 53eaa497c8fb0b79f14fe9f69693689a
48Source17: http://crt.tcs.terena.org/TERENAeSciencePersonalCA.crt
49# Source17-md5: e25cc655d3ebe920ca9c187e3dde9191
50Source18: http://crt.tcs.terena.org/TERENACodeSigningCA.crt
51# Source18-md5: 74c9f511ab03a4e6b7462e310abfa89b
352cf73e 52Source19: http://www.sk.ee/upload/files/JUUR-SK.PEM.cer
2190f9b1 53# Source19-md5: 805784c06c9eff3771a4b9bd631cd3f5
352cf73e
AM
54Source20: http://www.sk.ee/upload/files/ESTEID-SK.PEM.cer
55# Source20-md5: 387beee5b8539ab7d91628f486295899
cfe3948c 56Source21: http://www.sk.ee/upload/files/ESTEID-SK%202007.PEM.cer#/ESTEID-SK_2007.PEM.cer
352cf73e 57# Source21-md5: 2b1a2a77f565d68fdf5f19f6cc3a5600
cfe3948c 58Source22: http://www.sk.ee/upload/files/ESTEID-SK%202011.pem.cer#/ESTEID-SK_2011.pem.cer
352cf73e 59# Source22-md5: cfcc1e592cb0ff305158a7e32730546c
4619b3d9 60Patch0: %{name}-undebianize.patch
ed111db5 61Patch1: %{name}-more-certs.patch
c7360e68 62Patch2: %{name}-etc-certs.patch
302ace1c 63Patch3: %{name}-c_rehash.sh.patch
55905e01 64Patch4: %{name}-endline.patch
93ad0ea1
JR
65Patch5: %{name}-DESTDIR.patch
66Patch6: %{name}.d.patch
500a6231 67URL: http://www.cacert.org/
c3918bf2 68BuildRequires: openssl-tools
156426d3 69BuildRequires: python
65bcbc85 70BuildRequires: python-modules
9af0daca 71BuildRequires: rpm >= 4.4.9-56
55905e01 72BuildRequires: sed >= 4.0
ed111db5 73BuildRequires: unzip
ed111db5 74Obsoletes: certificates
5352fc69 75BuildArch: noarch
8bb152c1
ER
76BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
77
850133d0 78%define certsdir /etc/certs
94338ec5 79%define openssldir /etc/openssl/certs
850133d0 80
8bb152c1 81%description
500a6231
JB
82Common CA Certificates PEM files.
83
84%description -l pl.UTF-8
85Pliki PEM popularnych certyfikatów CA.
8bb152c1 86
302ace1c
JR
87%package update
88Summary: Script for updating CA Certificates database
89Summary(pl.UTF-8): Skrypt do odświeżania bazy certyfikatów CA
90Group: Libraries
6c894e75 91Requires: %{name} = %{version}-%{release}
74154eae 92Requires: mktemp
9af0daca 93%if "%{pld_release}" == "ac"
9b4bd725 94Requires: openssl-tools >= 0.9.7m-6.3
9af0daca 95%else
c3918bf2 96Requires: openssl-tools >= 0.9.8i-3
9af0daca 97%endif
302ace1c
JR
98
99%description update
100Script and data for updating CA Certificates database.
101
6c894e75 102%description update -l pl.UTF-8
302ace1c
JR
103Skrypt i dane do odświeżania bazy certyfikatów CA.
104
8bb152c1 105%prep
83311e47 106%setup -q
ed111db5
JR
107%patch0 -p1
108%patch1 -p1
c7360e68 109%patch2 -p1
302ace1c 110%patch3 -p1
55905e01 111%patch4 -p1
835b9580 112%patch5 -p1
94338ec5 113%patch6 -p1
ed111db5 114
9af0daca
ER
115%{__sed} -i -e 's,@openssldir@,%{openssldir},' sbin/update-ca-certificates*
116
156426d3 117%{__unzip} -qq %{SOURCE1} -d thawte
156426d3 118
ca146b29
AM
119find thawte/ -name *.pem -o -name *.txt| while read f ; do
120 if (file "$f" | grep -q "PEM"); then
121 ff=$(echo $f | sed -e 's|[ ,]|_|g' -e 's|[()]|=|g')
122 nname=$(basename "$ff" .pem)
123 nname=$(basename "$nname" .txt)
124 nname=$(basename "$nname" _b64)
1180a18f 125 cp -pi "$f" "thawte/${nname}.crt"
ca146b29
AM
126 else
127 echo "Skipping $f, doesn't look like PEM CERT"
128 fi
ed111db5
JR
129done
130
131install -d certum
1180a18f
ER
132cp -pi %{SOURCE2} certum
133cp -pi %{SOURCE3} certum
134cp -pi %{SOURCE4} certum
135cp -pi %{SOURCE5} certum
136cp -pi %{SOURCE6} certum
137cp -pi %{SOURCE7} certum
138cp -pi %{SOURCE8} certum
139cp -pi %{SOURCE9} certum
140cp -pi %{SOURCE10} certum
141cp -pi %{SOURCE11} certum
142cp -pi %{SOURCE12} certum
143cp -pi %{SOURCE13} certum
ebf0e82f 144for a in certum/*.pem; do
ca146b29 145 mv -i "$a" "${a%.pem}.crt"
ed111db5
JR
146done
147
1180a18f
ER
148# http://www.sk.ee/en/Repository/certs/rootcertificates
149# JUUR-SK, ESTEID-SK and ESTEID-SK 2007, ESTEID-SK 2011
2190f9b1 150install -d esteid
1180a18f
ER
151cp -pi %{SOURCE19} esteid
152cp -pi %{SOURCE20} esteid
153cp -pi %{SOURCE21} esteid/ESTEID-SK_2007.crt
154cp -pi %{SOURCE22} esteid/ESTEID-SK_2011.crt
2190f9b1 155for a in esteid/*.PEM.cer; do
ca146b29 156 mv -i "$a" "${a%.PEM.cer}.crt"
2190f9b1
ER
157done
158
ed111db5 159%build
277121c2
ER
160install -d terena
161openssl x509 -inform DER -in %{SOURCE14} -outform PEM -out terena/$(basename %{SOURCE14})
162openssl x509 -inform DER -in %{SOURCE15} -outform PEM -out terena/$(basename %{SOURCE15})
163openssl x509 -inform DER -in %{SOURCE16} -outform PEM -out terena/$(basename %{SOURCE16})
164openssl x509 -inform DER -in %{SOURCE17} -outform PEM -out terena/$(basename %{SOURCE17})
165openssl x509 -inform DER -in %{SOURCE18} -outform PEM -out terena/$(basename %{SOURCE18})
166
ed111db5
JR
167%{__make}
168
169# We have those and more in specific dirs
881d74e1 170rm mozilla/{Thawte,thawte,Certum,IGC_A,Deutsche_Telekom_Root_CA_2,Juur-SK}*.crt
8bb152c1 171
7d6b3825
JR
172# See TODO
173# rm mozilla/RSA_Security_1024_v3.crt
174
8bb152c1
ER
175%install
176rm -rf $RPM_BUILD_ROOT
53d36f70 177install -d $RPM_BUILD_ROOT{%{_datadir}/%{name},%{_sbindir},%{certsdir},%{_sysconfdir}/ca-certificates.d}
8bb152c1
ER
178%{__make} install \
179 DESTDIR=$RPM_BUILD_ROOT
180
55905e01
JR
181find $RPM_BUILD_ROOT%{_datadir}/ca-certificates -name '*.crt' -exec sed -i -e 's/\r$//' {} \;
182
8bb152c1
ER
183(
184cd $RPM_BUILD_ROOT%{_datadir}/ca-certificates
185find . -name '*.crt' | sort | cut -b3-
186) > $RPM_BUILD_ROOT%{_sysconfdir}/ca-certificates.conf
187
94338ec5
ER
188# build %{certsdir}/ca-certificates.crt
189install -d $RPM_BUILD_ROOT%{openssldir}
190./sbin/update-ca-certificates --destdir $RPM_BUILD_ROOT
191rm -rf $RPM_BUILD_ROOT%{openssldir}
8bb152c1
ER
192
193%clean
194rm -rf $RPM_BUILD_ROOT
195
302ace1c 196%post update
ed9496cb 197%{_sbindir}/update-ca-certificates --fresh || :
8bb152c1
ER
198
199%files
200%defattr(644,root,root,755)
3dc5e4ea 201%doc debian/README.Debian debian/changelog
850133d0 202%config(noreplace) %verify(not md5 mtime size) %{certsdir}/ca-certificates.crt
302ace1c
JR
203
204%files update
205%defattr(644,root,root,755)
8bb152c1 206%attr(755,root,root) %{_sbindir}/update-ca-certificates
302ace1c 207%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ca-certificates.conf
53d36f70 208%dir %{_sysconfdir}/ca-certificates.d
8bb152c1 209%{_datadir}/ca-certificates
This page took 0.14561 seconds and 4 git commands to generate.