From 86c7502f5ac578b5d97d659f68badf449bea4cb8 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Mon, 6 Aug 2012 17:31:19 -0500
Subject: ca-certificates 20122063

---
 abs/core/ca-certificates/PKGBUILD                | 34 ++++++++++++++----------
 abs/core/ca-certificates/ca-certificates.install | 23 ++++++++++++++--
 2 files changed, 41 insertions(+), 16 deletions(-)

diff --git a/abs/core/ca-certificates/PKGBUILD b/abs/core/ca-certificates/PKGBUILD
index 35b08ca..4b35562 100644
--- a/abs/core/ca-certificates/PKGBUILD
+++ b/abs/core/ca-certificates/PKGBUILD
@@ -1,32 +1,38 @@
-# $Id: PKGBUILD 15695 2008-10-17 11:18:31Z pierre $
+# $Id: PKGBUILD 162841 2012-07-01 11:43:58Z pierre $
 # Maintainer: Pierre Schmitz <pierre@archlinux.de>
 
 pkgname=ca-certificates
-pkgver=20080809
-pkgrel=30
+pkgver=20120623
+pkgrel=1
 pkgdesc='Common CA certificates'
-arch=('i686' 'x86_64')
+arch=('any')
 url='http://packages.qa.debian.org/c/ca-certificates.html'
 license=('MPL' 'GPL')
 source=("http://ftp.debian.org/debian/pool/main/c/${pkgname}/${pkgname}_${pkgver}.tar.gz")
 depends=('bash' 'run-parts' 'openssl' 'findutils' 'coreutils' 'sed')
-makedepends=('ruby')
-install=ca-certificates.install
+makedepends=('python2')
+install='ca-certificates.install'
 backup=('etc/ca-certificates.conf')
-md5sums=('c155f5059006b94ad0aea7018161ab37')
+sha256sums=('878cd1130ba056fe5f96decde7e5fc1b71d35eb8565a1515744912e100731ee9')
 
 build() {
-	cd $srcdir/$pkgname
-
-	install -d -m755 $pkgdir/{etc/ca-certificates/update.d,usr/{sbin,share/ca-certificates}}
-	install -D -m644 sbin/update-ca-certificates.8 $pkgdir/usr/share/man/man8/update-ca-certificates.8
+	cd ${srcdir}/${pkgname}-${pkgver}
+	sed 's|/usr/bin/python|/usr/bin/python2|g' -i mozilla/certdata2pem.py
+	sed 's|python|python2|g' -i mozilla/Makefile
 	make
-	make install DESTDIR=$pkgdir
+}
+
+package() {
+	cd ${srcdir}/${pkgname}-${pkgver}
+	install -d -m755 ${pkgdir}/{etc/ca-certificates/update.d,usr/{sbin,share/ca-certificates},etc/ssl/certs}
+	make install DESTDIR=${pkgdir}
+	install -D -m644 sbin/update-ca-certificates.8 ${pkgdir}/usr/share/man/man8/update-ca-certificates.8
 
 	(
 	echo "# Automatically generated by ${pkgname}-${pkgver}-${pkgrel}"
+	echo "# see update-ca-certificates man page"
 	echo "# "
-	cd $pkgdir/usr/share/ca-certificates
+	cd ${pkgdir}/usr/share/ca-certificates
 	find . -name '*.crt' | sort | cut -b3-
-	) > $pkgdir/etc/ca-certificates.conf
+	) > ${pkgdir}/etc/ca-certificates.conf
 }
diff --git a/abs/core/ca-certificates/ca-certificates.install b/abs/core/ca-certificates/ca-certificates.install
index bd3cf6d..3d8b87d 100644
--- a/abs/core/ca-certificates/ca-certificates.install
+++ b/abs/core/ca-certificates/ca-certificates.install
@@ -1,7 +1,26 @@
+export LC_ALL=C
+
 post_install() {
-	usr/sbin/update-ca-certificates --fresh  &> /dev/null
+	usr/sbin/update-ca-certificates --fresh >/dev/null 2>&1
 }
 
 post_upgrade() {
-	post_install
+	if [ $(vercmp $2 20110421-1) -lt 0 ]; then
+		echo 'Updating certificates. This might take a while...'
+	fi
+	usr/sbin/update-ca-certificates --fresh >/dev/null 2>&1
+}
+
+pre_remove() {
+	# clean up certificates
+	local _backup=$(mktemp)
+	mv etc/ca-certificates.conf ${_backup}
+	echo > etc/ca-certificates.conf
+	usr/sbin/update-ca-certificates --fresh >/dev/null 2>&1
+	mv ${_backup} etc/ca-certificates.conf
+}
+
+post_remove() {
+	# remove the cert file if it is empty
+	[[ -s etc/ssl/certs/ca-certificates.crt ]] || rm -f etc/ssl/certs/ca-certificates.crt
 }
-- 
cgit v0.12

