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