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