source: spec/trunk/SPECS/ca-certificates.spec@ 1036

Last change on this file since 1036 was 792, checked in by Yuri Dario, 9 years ago

spec: ca-certificates, update with latest certificates from Mozilla. closes ticket#105.

File size: 3.5 KB
Line 
1#
2# YD must point to local java installation!
3%define java_dir d:/os2/java160
4
5# certdata.txt is generated by extracting it from Mozilla HG.
6# This is done by downloading latest certdata.txt from:
7#
8# https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt
9
10%define pkidir %{_sysconfdir}/pki
11
12Summary: The Mozilla CA root certificate bundle
13Name: ca-certificates
14Version: 2016.06
15Release: 1%{?dist}
16License: Public Domain
17Group: System Environment/Base
18URL: http://www.mozilla.org/
19
20Source0: ca-certificates.zip
21
22BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
23#BuildRequires: java-openjdk, rcs
24BuildRequires: perl, python
25BuildArch: noarch
26
27%description
28This package contains the set of CA certificates chosen by the
29Mozilla Foundation for use with the Internet PKI.
30
31%prep
32%setup -c
33mkdir certs java
34
35%build
36
37cp certdata.txt certs
38cp blacklist.txt certs
39cd certs
40python ../certdata2pem.py
41cd ..
42
43 (
44 cat <<EOF
45# This is a bundle of X.509 certificates of public Certificate
46# Authorities. It was generated from the Mozilla root CA list.
47#
48# Source: mozilla/security/nss/lib/ckfw/builtins/certdata.txt
49#
50# Generated from:
51EOF
52 ident -q certdata.txt | sed '1d;s/^/#/';
53 echo '#';
54 ) > ca-bundle.crt
55 (
56 cat <<EOF
57# This is a bundle of X.509 certificates of public Certificate
58# Authorities. It was generated from the Mozilla root CA list.
59# These certificates are in the OpenSSL "TRUSTED CERTIFICATE"
60# format and have trust bits set accordingly.
61#
62# Source: mozilla/security/nss/lib/ckfw/builtins/certdata.txt
63#
64# Generated from:
65EOF
66 ident -q certdata.txt | sed '1d;s/^/#/';
67 echo '#';
68 ) > ca-bundle.trust.crt
69 for f in certs/*.crt; do
70 tbits=`sed -n '/^# openssl-trust/{s/^.*=//;p;}' $f`
71 case $tbits in
72 *serverAuth*) openssl x509 -text -in "$f" >> ca-bundle.crt ;;
73 esac
74 if [ -n "$tbits" ]; then
75 targs=""
76 for t in $tbits; do
77 targs="${targs} -addtrust $t"
78 done
79 openssl x509 -text -in "$f" -trustout $targs >> ca-bundle.trust.crt
80 fi
81 done
82
83 export PATH="%{java_dir}/bin${PATH:+;$PATH}"
84 export BEGINLIBPATH="%{java_dir}/bin${BEGINLIBPATH:+;$BEGINLIBPATH}"
85
86 cd java
87 test -s ../ca-bundle.crt || exit 1
88 %{__perl} ../generate-cacerts.pl %{java_dir}/bin/keytool.exe ../ca-bundle.crt
89 touch -r ../certdata.txt cacerts
90 cd ..
91
92%install
93rm -rf $RPM_BUILD_ROOT
94
95mkdir -p $RPM_BUILD_ROOT%{pkidir}/tls/certs
96mkdir -p $RPM_BUILD_ROOT%{pkidir}/java
97
98install -p -m 644 ca-bundle.crt $RPM_BUILD_ROOT%{pkidir}/tls/certs/ca-bundle.crt
99install -p -m 644 ca-bundle.trust.crt $RPM_BUILD_ROOT%{pkidir}/tls/certs/ca-bundle.trust.crt
100ln -s certs/ca-bundle.crt $RPM_BUILD_ROOT%{pkidir}/tls/cert.pem
101touch -r certdata.txt $RPM_BUILD_ROOT%{pkidir}/tls/certs/ca-bundle.crt
102touch -r certdata.txt $RPM_BUILD_ROOT%{pkidir}/tls/certs/ca-bundle.trust.crt
103
104# Install Java cacerts file.
105mkdir -p -m 700 $RPM_BUILD_ROOT%{pkidir}/java
106install -p -m 644 java/cacerts $RPM_BUILD_ROOT%{pkidir}/java/
107
108# /etc/ssl/certs symlink for 3rd-party tools
109mkdir -p -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/ssl
110ln -s ../pki/tls/certs $RPM_BUILD_ROOT%{_sysconfdir}/ssl/certs
111
112%clean
113rm -rf $RPM_BUILD_ROOT
114
115%files
116%defattr(-,root,root,-)
117%dir %{pkidir}/java
118%config(noreplace) %{pkidir}/java/cacerts
119%dir %{pkidir}/tls
120%dir %{pkidir}/tls/certs
121%config(noreplace) %{pkidir}/tls/certs/ca-bundle.*crt
122%{pkidir}/tls/cert.pem
123%dir %{_sysconfdir}/ssl
124%{_sysconfdir}/ssl/certs
125
126%changelog
127* Tue Jun 14 2016 yd <yd@os2power.com> 2016.06-1
128- update with latest certificates from Mozilla.
129
130* Thu Jan 5 2012 yd
131- initial build
Note: See TracBrowser for help on using the repository browser.