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