[csw-devel] SF.net SVN: gar:[2681] csw/mgar/pkg

chninkel at users.sourceforge.net chninkel at users.sourceforge.net
Mon Dec 22 00:49:56 CET 2008


Revision: 2681
          http://gar.svn.sourceforge.net/gar/?rev=2681&view=rev
Author:   chninkel
Date:     2008-12-21 23:49:55 +0000 (Sun, 21 Dec 2008)

Log Message:
-----------
ca_certificates: initial commit

Added Paths:
-----------
    csw/mgar/pkg/ca_certificates/
    csw/mgar/pkg/ca_certificates/branches/
    csw/mgar/pkg/ca_certificates/tags/
    csw/mgar/pkg/ca_certificates/trunk/
    csw/mgar/pkg/ca_certificates/trunk/Makefile
    csw/mgar/pkg/ca_certificates/trunk/checksums
    csw/mgar/pkg/ca_certificates/trunk/files/
    csw/mgar/pkg/ca_certificates/trunk/files/CSWcacertificates.depend
    csw/mgar/pkg/ca_certificates/trunk/files/CSWcacertificates.gspec
    csw/mgar/pkg/ca_certificates/trunk/files/CSWcacertificates.postinstall
    csw/mgar/pkg/ca_certificates/trunk/files/certdata2pem.pl
    csw/mgar/pkg/ca_certificates/trunk/files/update-ca-certificates


Property changes on: csw/mgar/pkg/ca_certificates/trunk
___________________________________________________________________
Added: svn:ignore
   + cookies
download
work


Added: svn:externals
   + gar https://gar.svn.sf.net/svnroot/gar/csw/mgar/gar/v1


Added: csw/mgar/pkg/ca_certificates/trunk/Makefile
===================================================================
--- csw/mgar/pkg/ca_certificates/trunk/Makefile	                        (rev 0)
+++ csw/mgar/pkg/ca_certificates/trunk/Makefile	2008-12-21 23:49:55 UTC (rev 2681)
@@ -0,0 +1,36 @@
+GARNAME = ca-certificates
+GARVERSION = $(shell date '+%Y%m%d')
+CATEGORIES = xtra
+
+DESCRIPTION = CA certificates
+define BLURB
+  CA certificates
+endef
+
+MASTER_SITES = http://hg.mozilla.org/mozilla-central/raw-file/default/security/nss/lib/ckfw/builtins/
+DISTFILES  = certdata.txt certdata2pem.pl update-ca-certificates
+DISTFILES += $(call admfiles,CSWcacertificates,depend postinstall)
+
+# We define upstream file regex so we can be notifed of new upstream software release
+# UFILES_REGEX = -(\d+(?:\.\d+)*).tar.gz
+
+CONFIGURE_ARGS = $(DIRPATHS)
+
+CONFIGURE_SCRIPTS =
+BUILD_SCRIPTS = 
+TEST_SCRIPTS =
+INSTALL_SCRIPTS = custom
+
+SPKG_CLASSES = none cswpreserveconf
+
+include gar/category.mk
+
+
+install-custom:
+	ginstall -d "$(DESTDIR)/$(sysconfdir)/ssl/certs"
+	ginstall -d "$(DESTDIR)/$(sharedstatedir)/ca-certificates"
+	ginstall -D "$(CURDIR)/$(WORKDIR)/update-ca-certificates" "$(DESTDIR)/$(sbindir)/update-ca-certificates"
+	cd "$(DESTDIR)/$(sharedstatedir)/ca-certificates" && perl "$(CURDIR)/$(WORKDIR)/certdata2pem.pl" < "$(CURDIR)/$(WORKDIR)/certdata.txt"
+	cd "$(DESTDIR)/$(sharedstatedir)/ca-certificates" && ls -1 > "$(CURDIR)/$(WORKDIR)/ca-certificate.conf"
+	sed -ne '/BEGIN LICENSE BLOCK/,/END LICENSE BLOCK/p' "$(CURDIR)/$(WORKDIR)/certdata.txt" | grep -v "LICENSE BLOCK" \
+		> "$(CURDIR)/$(WORKDIR)/LICENSE"

Added: csw/mgar/pkg/ca_certificates/trunk/checksums
===================================================================
--- csw/mgar/pkg/ca_certificates/trunk/checksums	                        (rev 0)
+++ csw/mgar/pkg/ca_certificates/trunk/checksums	2008-12-21 23:49:55 UTC (rev 2681)
@@ -0,0 +1,6 @@
+4dabeaecfd46395da152e51d312107e4  download/certdata.txt
+6087aaa070808190680dcd5cb03c0cb9  download/certdata2pem.pl
+f7b1df4e84e70b1cf7023779ba11698b  download/update-ca-certificates
+3bb0b5d545c0bd8f4381cfd2d500586c  download/CSWcacertificates.gspec
+df81c8c6eb55786ebefd47fc6400b8b6  download/CSWcacertificates.depend
+48e4c60f385981c1430313584f527b50  download/CSWcacertificates.postinstall

Added: csw/mgar/pkg/ca_certificates/trunk/files/CSWcacertificates.depend
===================================================================
--- csw/mgar/pkg/ca_certificates/trunk/files/CSWcacertificates.depend	                        (rev 0)
+++ csw/mgar/pkg/ca_certificates/trunk/files/CSWcacertificates.depend	2008-12-21 23:49:55 UTC (rev 2681)
@@ -0,0 +1,2 @@
+P       CSWcswclassutils
+P	CSWosslutils

Added: csw/mgar/pkg/ca_certificates/trunk/files/CSWcacertificates.gspec
===================================================================
--- csw/mgar/pkg/ca_certificates/trunk/files/CSWcacertificates.gspec	                        (rev 0)
+++ csw/mgar/pkg/ca_certificates/trunk/files/CSWcacertificates.gspec	2008-12-21 23:49:55 UTC (rev 2681)
@@ -0,0 +1,7 @@
+%var            bitname ca_certificates
+%var            pkgname CSWcacertificates
+%var            arch all
+%include        url file://%{PKGLIB}/csw_dyndepend.gspec
+%copyright      url file://%{WORKDIR}/LICENSE
+%prototype:merge
+e cswpreserveconf /opt/csw/etc/ca-certificates.conf.csw=ca-certificate.conf 0644 root bin

Added: csw/mgar/pkg/ca_certificates/trunk/files/CSWcacertificates.postinstall
===================================================================
--- csw/mgar/pkg/ca_certificates/trunk/files/CSWcacertificates.postinstall	                        (rev 0)
+++ csw/mgar/pkg/ca_certificates/trunk/files/CSWcacertificates.postinstall	2008-12-21 23:49:55 UTC (rev 2681)
@@ -0,0 +1,7 @@
+
+# Update ca lists
+if [ -n "${BASEDIR}" ]; then
+	chroot ${BASEDIR} /opt/csw/sbin/update-ca-certificates
+else
+	/opt/csw/sbin/update-ca-certificates
+fi

Added: csw/mgar/pkg/ca_certificates/trunk/files/certdata2pem.pl
===================================================================
--- csw/mgar/pkg/ca_certificates/trunk/files/certdata2pem.pl	                        (rev 0)
+++ csw/mgar/pkg/ca_certificates/trunk/files/certdata2pem.pl	2008-12-21 23:49:55 UTC (rev 2681)
@@ -0,0 +1,64 @@
+#!/usr/bin/perl
+
+sub encode_base64
+{
+	my $string = shift;
+	my $res = pack("u", $string);
+	# Remove first character of each line, remove newlines
+	$res =~ s/^.//mg;
+	$res =~ s/\n//g;
+
+	$res =~ tr|` -_|AA-Za-z0-9+/|;               # `# help emacs
+	# fix padding at the end
+	my $padding = (3 - length($string) % 3) % 3;
+	$res =~ s/.{$padding}$/'=' x $padding/e if $padding;
+	# break encoded string into lines of no more than 76 characters each
+	$res =~ s/(.{1,60})/$1\n/g;
+	
+	return $res;
+}
+
+
+while (my $line = <STDIN>) {
+	next if $line =~ /^#/;
+	
+	if ($line =~ /^\s*$/) {
+		undef $fname;
+		next;
+	}
+
+	chomp ($line);
+
+	if ($line =~ /CKA_LABEL/) {
+		my ($label, $type, $val) = split (/ /, $line, 3);
+		$val =~ s/^"//;
+		$val =~ s/"$//;
+		$val =~ s/[\/\s,]/_/g;
+		$val =~ s/[()]//g;
+		$fname = $val . ".crt";
+		next;
+	}
+
+	if ($line =~ /CKA_VALUE MULTILINE_OCTAL/) {
+		if (not $fname) {
+			print "ERROR: unexpected CKA_VALUE MULTILINE_OCTAL\n";
+			next;
+		}
+		my @cert_data;
+		while ($line = <STDIN>) {
+			last if $line =~ /^END/;
+			chomp ($line);
+			my @data = split (/\\/, $line);
+			shift (@data);
+			push (@cert_data, @data);
+		}
+		@cert_data = map (oct, @cert_data);
+		@cert_data = map (chr, @cert_data);
+		open (FH, "> $fname");
+		print FH "-----BEGIN CERTIFICATE-----\n";
+		print FH encode_base64 (join ("", @cert_data));
+		print FH "-----END CERTIFICATE-----\n";
+		close (FH);
+		print "Created $fname certificate\n";
+	}
+} 

Added: csw/mgar/pkg/ca_certificates/trunk/files/update-ca-certificates
===================================================================
--- csw/mgar/pkg/ca_certificates/trunk/files/update-ca-certificates	                        (rev 0)
+++ csw/mgar/pkg/ca_certificates/trunk/files/update-ca-certificates	2008-12-21 23:49:55 UTC (rev 2681)
@@ -0,0 +1,77 @@
+#!/bin/sh -e
+#
+# update-ca-certificates
+# Debian script adapted for Solaris by Yann Rouillard
+#
+# Copyright (c) 2003 Fumitoshi UKAI <ukai at debian.or.jp>
+# Copyright (c) 2008 Yann Rouillard <yann at pleiades.fr.eu.org>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+
+verbose=0
+fresh=0
+while [ $# -gt 0 ];
+do
+	case $1 in
+		--verbose|-v)
+			verbose=1;;
+
+		--help|-h|*)
+			echo "$0: [--verbose] [--fresh]"
+			exit;;
+	esac
+	shift
+done
+
+CERTSCONF=/opt/csw/etc/ca-certificates.conf
+CERTSDIR=/opt/csw/share/ca-certificates
+CERTBUNDLE=ca-certificates.crt
+ETCCERTSDIR=/opt/csw/etc/ssl/certs
+
+if [ ! -f "$CERTSCONF" ]; then
+	echo "ERROR: $CERTSCONF doesn't exist !" >&2
+	exit 2
+fi
+
+cd $ETCCERTSDIR
+find . -type l -print | while read SYMLINK; do
+	test -f $SYMLINK || rm -f $SYMLINK
+done
+
+printf "Updating certificates in $ETCCERTSDIR..."
+
+BUNDLETMP=`mktemp "${CERTBUNDLE}.tmp.XXXXXX"`
+sed -e '/^#/g' "$CERTSCONF" | while read CERTFILE; do
+	if [ ! -f "$CERTFILE" ]; then
+		if [ ! -f "$CERTSDIR/$CERTFILE" ]; then
+			continue
+		fi
+		CERTFILE="$CERTSDIR/$CERTFILE"
+	fi
+
+	cd "$ETCCERTSDIR" && ln -sf "$CERTFILE" "`basename $CERTFILE`.pem"
+done
+
+cd "$ETCCERTSDIR" && cat *.pem > "$BUNDLETMP"
+chmod 0644 "$BUNDLETMP"
+mv -f "$BUNDLETMP" "$ETCCERTSDIR/$CERTBUNDLE"
+
+if [ "$verbose" = 0 ]; then
+	OPENSSL=/opt/csw/bin/openssl /opt/csw/bin/c_rehash . >/dev/null 2>&1
+else
+	OPENSSL=/opt/csw/bin/openssl /opt/csw/bin/c_rehash .
+fi
+echo "done."


Property changes on: csw/mgar/pkg/ca_certificates/trunk/files/update-ca-certificates
___________________________________________________________________
Added: svn:executable
   + *


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list