fc44bac83761578c332434b2c4f69d7fb070bfa7
[packages/ca-certificates.git] / ca-certificates.spec
1 # TODO
2 # - cleanup dead links from /etc/openssl/certs after -update uninstall
3 #
4 # - https://bugzilla.mozilla.org/show_bug.cgi?id=549701 and
5 #   http://groups.google.com/group/mozilla.dev.security.policy/browse_thread/thread/b6493a285ba79998#
6 #
7 Summary:        Common CA Certificates PEM files
8 Summary(pl.UTF-8):      Pliki PEM popularnych certyfikatów CA
9 Name:           ca-certificates
10 Version:        20090814
11 Release:        6
12 License:        distributable
13 Group:          Libraries
14 Source0:        ftp://ftp.debian.org/debian/pool/main/c/ca-certificates/%{name}_%{version}.tar.gz
15 # Source0-md5:  307052c985bec7f9a00eb84293eef779
16 Source1:        https://www.verisign.com/support/thawte-roots.zip
17 # Source1-md5:  3e50e5facce6b6bfbf68271d066005fa
18 Source2:        http://www.certum.pl/keys/CA.pem
19 # Source2-md5:  35610177afc9c64e70f1ce62c1885496
20 Source3:        http://www.certum.pl/keys/level1.pem
21 # Source3-md5:  ba2d2e234ef9cfd2e6e5f810c964862e
22 Source4:        http://www.certum.pl/keys/level2.pem
23 # Source4-md5:  d06578a04e8cb23071f3870430ea0cf0
24 Source5:        http://www.certum.pl/keys/level3.pem
25 # Source5-md5:  47b67c63a52236576fc0d1150327c962
26 Source6:        http://www.certum.pl/keys/level4.pem
27 # Source6-md5:  f1f8a65d177745311a1e99f029ae5d71
28 Source7:        http://www.certum.pl/keys/vs.pem
29 # Source7-md5:  8da19ffc48c5dcc2868b1aa55f1d5983
30 Source8:        http://www.certum.pl/keys/na.pem
31 # Source8-md5:  ba571cb35e7672ff7ae95132ac1bfec4
32 Source9:        http://www.certum.pl/keys/tsa.pem
33 # Source9-md5:  1a7b3faf8ed00f4d80297de74862e102
34 Source10:       http://www.certum.pl/keys/class1.pem
35 # Source10-md5: 058436b132ea2df6972821f546104a16
36 Source11:       http://www.certum.pl/keys/class2.pem
37 # Source11-md5: 5caf7fe99b1fc6e63c40b3d081711d1b
38 Source12:       http://www.certum.pl/keys/class3.pem
39 # Source12-md5: 07bc97e21da092ba53535c7379e1b58b
40 Source13:       http://www.certum.pl/keys/class4.pem
41 # Source13-md5: 99ef61d509539af89f1c025b67245965
42 Source14:       http://crt.tcs.terena.org/TERENASSLCA.crt
43 # Source14-md5: f62cd1546a8ef14e31ba1ce8eecd234a
44 Source15:       http://crt.tcs.terena.org/TERENAeScienceSSLCA.crt
45 # Source15-md5: 5feea35ab01a373f115219706f1f57bd
46 Source16:       http://crt.tcs.terena.org/TERENAPersonalCA.crt
47 # Source16-md5: 53eaa497c8fb0b79f14fe9f69693689a
48 Source17:       http://crt.tcs.terena.org/TERENAeSciencePersonalCA.crt
49 # Source17-md5: e25cc655d3ebe920ca9c187e3dde9191
50 Source18:       http://crt.tcs.terena.org/TERENACodeSigningCA.crt
51 # Source18-md5: 74c9f511ab03a4e6b7462e310abfa89b
52 Source19:       http://www.sk.ee/files/JUUR-SK.PEM.cer
53 # Source19-md5: 805784c06c9eff3771a4b9bd631cd3f5
54 Source20:       http://www.sk.ee/files/ESTEID-SK.PEM.cer
55 # Source20-md5: 387beee5b8539ab7d91628f486295899
56 Source21:       http://www.sk.ee/files/ESTEID-SK%202007.PEM.cer
57 # Source21-md5: 2b1a2a77f565d68fdf5f19f6cc3a5600
58 Patch0:         %{name}-undebianize.patch
59 Patch1:         %{name}-more-certs.patch
60 Patch2:         %{name}-etc-certs.patch
61 Patch3:         %{name}-c_rehash.sh.patch
62 Patch4:         %{name}-endline.patch
63 Patch5:         %{name}-mozilla.patch
64 URL:            http://www.cacert.org/
65 BuildRequires:  openssl-tools
66 BuildRequires:  python
67 BuildRequires:  python-modules
68 BuildRequires:  sed >= 4.0
69 BuildRequires:  unzip
70 Obsoletes:      certificates
71 BuildArch:      noarch
72 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
73
74 %define         certsdir        /etc/certs
75
76 %description
77 Common CA Certificates PEM files.
78
79 %description -l pl.UTF-8
80 Pliki PEM popularnych certyfikatów CA.
81
82 %package update
83 Summary:        Script for updating CA Certificates database
84 Summary(pl.UTF-8):      Skrypt do odświeżania bazy certyfikatów CA
85 Group:          Libraries
86 Requires:       %{name} = %{version}-%{release}
87 Requires:       mktemp
88 Requires:       openssl-tools >= 0.9.8i-3
89
90 %description update
91 Script and data for updating CA Certificates database.
92
93 %description update -l pl.UTF-8
94 Skrypt i dane do odświeżania bazy certyfikatów CA.
95
96 %prep
97 %setup -q
98 %patch0 -p1
99 %patch1 -p1
100 %patch2 -p1
101 %patch3 -p1
102 %patch4 -p1
103 %patch5 -p1
104
105 %{__unzip} -qq %{SOURCE1} -d thawte
106 # resolve file name clash
107 mv 'thawte/Thawte Roots/Thawte Extended Validation/thawte Primary Root CA - G1 (EV)/thawte_Primary_Root_CA.pem' \
108         'thawte/Thawte Roots/Thawte Extended Validation/thawte Primary Root CA - G1 (EV)/thawte_Primary_Root_CA_CC.pem'
109
110 find thawte/ -name *.pem | while read f ; do
111         ff=$(echo $f | sed -e 's|[ ,]|_|g' -e 's|[()]|=|g')
112         cp "$f" "thawte/$(basename "$ff" .pem).crt"
113 done
114
115 install -d certum
116 cp -a %{SOURCE2} certum
117 cp -a %{SOURCE3} certum
118 cp -a %{SOURCE4} certum
119 cp -a %{SOURCE5} certum
120 cp -a %{SOURCE6} certum
121 cp -a %{SOURCE7} certum
122 cp -a %{SOURCE8} certum
123 cp -a %{SOURCE9} certum
124 cp -a %{SOURCE10} certum
125 cp -a %{SOURCE11} certum
126 cp -a %{SOURCE12} certum
127 cp -a %{SOURCE13} certum
128 for a in certum/*.pem; do
129         mv "$a" "${a%.pem}.crt"
130 done
131
132 install -d terena
133 openssl x509 -inform DER -in %{SOURCE14} -outform PEM -out terena/$(basename %{SOURCE14})
134 openssl x509 -inform DER -in %{SOURCE15} -outform PEM -out terena/$(basename %{SOURCE15})
135 openssl x509 -inform DER -in %{SOURCE16} -outform PEM -out terena/$(basename %{SOURCE16})
136 openssl x509 -inform DER -in %{SOURCE17} -outform PEM -out terena/$(basename %{SOURCE17})
137 openssl x509 -inform DER -in %{SOURCE18} -outform PEM -out terena/$(basename %{SOURCE18})
138
139 # http://www.sk.ee/pages.php/0203040502#Root_certificates
140 # JUUR-SK, ESTEID-SK and ESTEID-SK 2007
141 install -d esteid
142 cp -a %{SOURCE19} esteid
143 cp -a %{SOURCE20} esteid
144 cp -a %{SOURCE21} esteid
145 for a in esteid/*.PEM.cer; do
146         mv "$a" "${a%.PEM.cer}.crt"
147 done
148
149 %build
150 %{__make}
151
152 # We have those and more in specific dirs
153 rm mozilla/{Thawte,thawte,Certum,IGC_A,Deutsche_Telekom_Root_CA_2}*.crt
154
155 # See TODO
156 # rm mozilla/RSA_Security_1024_v3.crt
157
158 %install
159 rm -rf $RPM_BUILD_ROOT
160 install -d $RPM_BUILD_ROOT{%{_datadir}/%{name},%{_sbindir},%{certsdir}}
161
162 %{__make} install \
163         DESTDIR=$RPM_BUILD_ROOT
164
165 find $RPM_BUILD_ROOT%{_datadir}/ca-certificates -name '*.crt' -exec sed -i -e 's/\r$//' {} \;
166
167 (
168 cd $RPM_BUILD_ROOT%{_datadir}/ca-certificates
169 find . -name '*.crt' | sort | cut -b3-
170 ) > $RPM_BUILD_ROOT%{_sysconfdir}/ca-certificates.conf
171
172 find $RPM_BUILD_ROOT%{_datadir}/ca-certificates -name '*.crt' | while read cert ; do
173         cat "$cert" >> $RPM_BUILD_ROOT%{certsdir}/ca-certificates.crt
174         echo >>$RPM_BUILD_ROOT%{certsdir}/ca-certificates.crt
175 done
176
177 %clean
178 rm -rf $RPM_BUILD_ROOT
179
180 %post update
181 %{_sbindir}/update-ca-certificates --fresh || :
182
183 %files
184 %defattr(644,root,root,755)
185 %config(noreplace) %verify(not md5 mtime size) %{certsdir}/ca-certificates.crt
186
187 %files update
188 %defattr(644,root,root,755)
189 %attr(755,root,root) %{_sbindir}/update-ca-certificates
190 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ca-certificates.conf
191 %{_datadir}/ca-certificates
This page took 0.07994 seconds and 2 git commands to generate.