rootcerts/rootcerts.spec

189 lines
5.6 KiB
RPMSpec
Raw Normal View History

# don't make useless debug packages
2015-08-22 12:37:35 +04:00
%define _enable_debug_packages %{nil}
2013-11-27 00:16:10 +04:00
%define debug_package %{nil}
# _without = java enabled, _with = java disabled
2015-08-22 12:37:35 +04:00
%ifnarch %mips
%bcond_without java
2015-08-22 12:37:35 +04:00
%endif
Summary: Bundle of CA Root Certificates
Name: rootcerts
# <mrl> Use this versioning style in order to be easily backportable.
# Note that the release is the last two digits on the version.
# All BuildRequires for rootcerts should be done this way:
# BuildRequires: rootcerts >= 0:20070402.00, for example
# - NEVER specifying the %%{release}
Epoch: 1
2015-08-22 12:37:35 +04:00
Version: 20150326.00
Release: 3
License: GPL
Group: System/Servers
2013-11-27 00:16:10 +04:00
URL: %{disturl}
# S0 originates from http://switch.dl.sourceforge.net/sourceforge/courier/courier-0.52.1.tar.bz2
Source0: rootcerts.tar.bz2
2015-08-22 12:37:35 +04:00
# https://hg.mozilla.org/projects/nss/raw-file/e2b98ed12caa/lib/ckfw/builtins/certdata.txt
Source1: certdata.txt
Source2: rootcerts-igp-brasil.txt
# http://www.cacert.org/certs/root.der
Source3: cacert.org.der
# http://qa.mandriva.com/show_bug.cgi?id=29612
# https://www.verisign.com/support/verisign-intermediate-ca/secure-site-intermediate/index.html
Source4: verisign-class-3-secure-server-ca.pem
2013-11-27 00:16:10 +04:00
#http://www.cacert.org/certs/root.crt
Source5: cacert.org.crt
# Java JKS keystore generator:
# http://cvs.fedora.redhat.com/viewcvs/devel/ca-certificates/generate-cacerts.pl
Source6: generate-cacerts.pl
2013-11-27 00:16:10 +04:00
# http://www.cacert.org/certs/class3.der
Source7: cacert_class3.der
# certificates from signet
# http://www.signet.pl/repository/index.html
Source8: rootca_der.crt
Source9: publicxca_der.crt
# Fix overwriting issue with generate-cacerts.pl
Patch0: generate-cacerts-fix-entrustsslca.patch
# Some hacks to make generate-cacerts.pl work with some of our certificates
Patch1: generate-cacerts-mandriva.patch
# Just rename identically named certificates that are not handled by mandriva.cpatch
Patch2: generate-cacerts-rename-duplicates.patch
2013-11-27 00:16:10 +04:00
BuildRequires: perl
BuildRequires: openssl
2015-08-22 12:37:35 +04:00
#BuildRequires: openssl-perl
2013-11-27 00:16:10 +04:00
BuildRequires: nss
BuildRequires: automake
BuildRequires: libtool
2015-08-22 12:37:35 +04:00
%if %{with java}
BuildRequires: java-devel
BuildRequires: java-rpmbuild
%endif
%description
This is a bundle of X.509 certificates of public Certificate
Authorities (CA). These were automatically extracted from Mozilla's
root CA list (the file "certdata.txt"). It contains the certificates
in both plain text and PEM format and therefore can be directly used
with an Apache/mod_ssl webserver for SSL client authentication. Just
configure this file as the SSLCACertificateFile.
2015-08-22 12:37:35 +04:00
%if %{with java}
%package java
Summary: Bundle of CA Root Certificates for Java
Group: Development/Java
%description java
Bundle of X.509 certificates of public Certificate Authorities (CA)
in a format used by Java Runtime Environment.
%endif
%prep
%setup -q -n rootcerts
#cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -p mozilla/security/nss/lib/ckfw/builtins/certdata.txt > certdata.txt
mkdir -p builtins
cp %{SOURCE1} builtins/certdata.txt
# extract the license
head -36 builtins/certdata.txt > LICENSE
# add additional CA's here, needs to have the mozilla format...
cat %{SOURCE2} >> builtins/certdata.txt
# CAcert
cp %{SOURCE3} .
2013-11-27 00:16:10 +04:00
cp %{SOURCE5} .
cp %{SOURCE6} .
2013-11-27 00:16:10 +04:00
cp %{SOURCE7} .
cp %{SOURCE8} .
cp %{SOURCE9} .
%patch0 -p0
%patch1 -p0
%patch2 -p0
2013-11-27 00:16:10 +04:00
%build
rm -f configure
libtoolize --copy --force; aclocal; autoconf; automake --foreign --add-missing --copy
# CAcert
# http://wiki.cacert.org/wiki/NSSLib
addbuiltin -n "CAcert Inc." -t "CT,C,C" < cacert.org.der >> builtins/certdata.txt
2013-11-27 00:16:10 +04:00
addbuiltin -n "CAcert Inc. Class 3" -t "CT,C,C" < cacert_class3.der >> builtins/certdata.txt
# new verisign intermediate certificate
# -t trust trust flags (cCTpPuw).
openssl x509 -in %{SOURCE4} -inform PEM -outform DER | \
addbuiltin -n "VeriSign Class 3 Secure Server CA" \
-t "CT,C,C" >> builtins/certdata.txt
perl mkcerts.pl > certs.sh
2015-08-22 12:37:35 +04:00
%configure \
2013-11-27 00:16:10 +04:00
--with-certdb=%{_sysconfdir}/pki/tls/rootcerts
%make
2013-11-27 00:16:10 +04:00
cat pem/*.pem > ca-bundle.crt
cat %{SOURCE4} >> ca-bundle.crt
2015-08-22 12:37:35 +04:00
%if %{with java}
mkdir java
cd java
LC_ALL=C perl ../generate-cacerts.pl %{java_home}/bin/keytool ../ca-bundle.crt
cd ..
%endif
%install
%makeinstall_std
install -d %{buildroot}%{_sysconfdir}/pki/tls/certs
install -d %{buildroot}%{_sysconfdir}/pki/tls/mozilla
install -d %{buildroot}%{_bindir}
install -m0644 ca-bundle.crt %{buildroot}%{_sysconfdir}/pki/tls/certs/
ln -s certs/ca-bundle.crt %{buildroot}%{_sysconfdir}/pki/tls/cert.pem
install -m0644 builtins/certdata.txt %{buildroot}%{_sysconfdir}/pki/tls/mozilla/
2015-08-22 12:37:35 +04:00
%if %{with java}
install -d %{buildroot}%{_sysconfdir}/pki/java
install -m0644 java/cacerts %{buildroot}%{_sysconfdir}/pki/java/
%endif
cat > README << EOF
R O O T C E R T S
-----------------
This is a bundle of X.509 certificates of public Certificate
Authorities (CA). These were automatically extracted from Mozilla's
root CA list (the file "certdata.txt"). It contains the certificates
in both plain text and PEM format and therefore can be directly used
with an Apache/mod_ssl webserver for SSL client authentication. Just
configure this file as the SSLCACertificateFile.
EOF
# fix #58107
install -d %{buildroot}%{_sysconfdir}/ssl
2013-11-27 00:16:10 +04:00
for d in certs private; do
ln -sf %{_sysconfdir}/pki/tls/$d %{buildroot}%{_sysconfdir}/ssl/
done
2013-11-27 00:16:10 +04:00
%files
%doc README LICENSE
%{_sysconfdir}/pki/tls/cert.pem
%config(noreplace) %{_sysconfdir}/pki/tls/certs/ca-bundle.crt
%config(noreplace) %{_sysconfdir}/pki/tls/rootcerts/*
%config(noreplace) %{_sysconfdir}/pki/tls/mozilla/certdata.txt
%{_sysconfdir}/ssl/certs
2013-11-27 00:16:10 +04:00
%{_sysconfdir}/ssl/private
2015-08-22 12:37:35 +04:00
%if %{with java}
%files java
%dir %{_sysconfdir}/pki/java
%config(noreplace) %{_sysconfdir}/pki/java/cacerts
%endif