]> git.pld-linux.org Git - packages/ca-certificates.git/blobdiff - ca-certificates.spec
Include Debian-compatible /etc/ssl/certs symlink
[packages/ca-certificates.git] / ca-certificates.spec
index 7c95855349b7578f159098be1c8c3e6685ec71c0..939e6421e20c54177a1018cf6ea9e3e49508ce46 100644 (file)
@@ -6,17 +6,19 @@
 # - make pidgin use system certs
 # - swap %{certsdir}/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt regards file vs symlink
 #
+# Conditional build:
+%bcond_without tests   # skip duplicates check
+
 Summary:       Common CA Certificates PEM files
 Summary(pl.UTF-8):     Pliki PEM popularnych certyfikatów CA
 Name:          ca-certificates
-Version:       20150426
-Release:       2
+%define        ver_date        20180409
+Version:       %{ver_date}
+Release:       3
 License:       GPL v2 (scripts), MPL v2 (mozilla certs), distributable (other certs)
-Group:         Libraries
-Source0:       ftp://ftp.debian.org/debian/pool/main/c/ca-certificates/%{name}_%{version}.tar.xz
-# Source0-md5: 717455f13fb31fd014a11a468ea3895d
-Source1:       https://www.verisign.com/support/thawte-roots.zip
-# Source1-md5: 21a284ebdc6e8f4178d5cc10fb9e1ef2
+Group:         Base
+Source0:       http://ftp.debian.org/debian/pool/main/c/ca-certificates/%{name}_%{version}.tar.xz
+# Source0-md5: 8425f4b1219e4e528db2de764e4c6586
 Source2:       http://www.certum.pl/keys/CA.pem
 # Source2-md5: 35610177afc9c64e70f1ce62c1885496
 Source3:       http://www.certum.pl/keys/level1.pem
@@ -90,12 +92,13 @@ Source36:   http://www.terena.org/activities/tcs/repository-g3/TERENA_SSL_High_Ass
 Patch0:                %{name}-undebianize.patch
 Patch1:                %{name}-more-certs.patch
 Patch2:                %{name}-etc-certs.patch
-Patch3:                %{name}-c_rehash.sh.patch
+
 Patch5:                %{name}-DESTDIR.patch
 Patch6:                %{name}.d.patch
-URL:           http://www.cacert.org/
+Patch7:                no-openssl-rehash.patch
+URL:           https://packages.debian.org/sid/ca-certificates
 BuildRequires: openssl-tools
-BuildRequires: python
+BuildRequires: python >= 1:2.6
 BuildRequires: python-modules
 BuildRequires: rpm >= 4.4.9-56
 BuildRequires: sed >= 4.0
@@ -134,30 +137,17 @@ Script and data for updating CA Certificates database.
 Skrypt i dane do odświeżania bazy certyfikatów CA.
 
 %prep
-%setup -q
+%setup -q -n %{name}
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
-%patch3 -p1
+
 %patch5 -p1
 %patch6 -p1
+%patch7 -p1
 
 %{__sed} -i -e 's,@openssldir@,%{openssldir},' sbin/update-ca-certificates*
 
-%{__unzip} -qq %{SOURCE1} -d thawte
-
-find thawte/ -name *.pem -o -name *.txt| while read f ; do
-       if (file "$f" | grep -q "PEM"); then
-               ff=$(echo $f | sed -e 's|[ ,]|_|g' -e 's|[()]|=|g')
-               nname=$(basename "$ff" .pem)
-               nname=$(basename "$nname" .txt)
-               nname=$(basename "$nname" _b64)
-               cp -pi "$f" "thawte/${nname}.crt"
-       else
-               echo "Skipping $f, doesn't look like PEM CERT"
-       fi
-done
-
 install -d certum
 cp -pi %{SOURCE2} certum
 cp -pi %{SOURCE3} certum
@@ -211,10 +201,10 @@ sed 's/\r//' %{SOURCE36} > terena/$(basename %{SOURCE36} .pem).crt
 %{__make}
 
 # We have those and more in specific dirs
-rm mozilla/{thawte,Certum,IGC_A,Deutsche_Telekom_Root_CA_2,Juur-SK}*.crt
+%{__rm} mozilla/{Certum,Deutsche_Telekom_Root_CA_2}*.crt
 
 # See TODO
-# rm mozilla/RSA_Security_1024_v3.crt
+# %{__rm} mozilla/RSA_Security_1024_v3.crt
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -236,6 +226,28 @@ rm -rf $RPM_BUILD_ROOT%{openssldir}
 
 ln -s %{certsdir}/ca-certificates.crt $RPM_BUILD_ROOT/etc/pki/tls/certs/ca-bundle.crt
 
+%if %{with tests}
+install -d pld-tests
+cd pld-tests
+
+# check for duplicates (to avoid X509_STORE_add_cert "cert already in hash table" problem)
+cat $RPM_BUILD_ROOT%{certsdir}/ca-certificates.crt | awk '/BEGIN/ { i++; } /BEGIN/, /END/ { print > i ".extracted.crt" }'
+for cert in *.extracted.crt; do
+       openssl x509 -in "$cert" -noout -sha1 -fingerprint > "$cert.fingerprint"
+done
+DUPLICATES=$(sort *.fingerprint | uniq -c | sort -nr | awk ' { if ($1 != 1) { print $0; } } ')
+if [ -n "$DUPLICATES" ]; then
+       echo -e "\n\nFound duplicates for certificates (count, type, fingerprint):\n\n$DUPLICATES\n\nFailing..."
+       exit 1
+fi
+cd ..
+%endif
+
+# The Debian path might be hard-coded in some binaries we cannot fix
+# like the Steam client
+install -d $RPM_BUILD_ROOT/etc/ssl
+ln -s %{certsdir} $RPM_BUILD_ROOT/etc/ssl/certs
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -247,6 +259,8 @@ rm -rf $RPM_BUILD_ROOT
 %doc debian/README.Debian debian/changelog
 %dir /etc/pki/tls
 %dir /etc/pki/tls/certs
+%dir /etc/ssl
+/etc/ssl/certs
 %config(noreplace) %verify(not md5 mtime size) /etc/pki/tls/certs/ca-bundle.crt
 %config(noreplace) %verify(not md5 mtime size) %{certsdir}/ca-certificates.crt
 
This page took 0.105462 seconds and 4 git commands to generate.