[csw-devel] SF.net SVN: gar:[20431] csw/mgar/pkg/openssl1/trunk

chninkel at users.sourceforge.net chninkel at users.sourceforge.net
Mon Mar 11 19:18:47 CET 2013


Revision: 20431
          http://gar.svn.sourceforge.net/gar/?rev=20431&view=rev
Author:   chninkel
Date:     2013-03-11 18:18:47 +0000 (Mon, 11 Mar 2013)
Log Message:
-----------
openssl1/trunk: moved update-t4-patch script in a separate file

Modified Paths:
--------------
    csw/mgar/pkg/openssl1/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/openssl1/trunk/files/update-t4-patch.sh

Modified: csw/mgar/pkg/openssl1/trunk/Makefile
===================================================================
--- csw/mgar/pkg/openssl1/trunk/Makefile	2013-03-11 17:30:41 UTC (rev 20430)
+++ csw/mgar/pkg/openssl1/trunk/Makefile	2013-03-11 18:18:47 UTC (rev 20431)
@@ -135,6 +135,9 @@
 # see http://bubbva.blogspot.fr/2011/11/exciting-crypto-advances-with-t4.html
 #     https://blogs.oracle.com/DanX/entry/sparc_t4_openssl_engine
 # patch taken from https://hg.openindiana.org/upstream/oracle/userland-gate/
+# To update the patch, do:
+#   cd files && ./update-t4-patch.sh OPENSSL_VERSION
+#
 ifeq ($(shell /usr/bin/uname -p),sparc) 
 ifeq ($(shell /usr/bin/uname -r),5.11)
 	PATCHFILES += openssl-1.0.1e-t4-engine.sparc-patch
@@ -230,25 +233,3 @@
 
 post-merge: merge-doc install-conf-misc 
 
-
-T4_ENGINE_FILES =  eng_t4_aes_asm.h eng_t4_bignum.h eng_t4_des_asm.h eng_t4_err.h eng_t4_sha2_asm.h 
-T4_ENGINE_FILES += eng_t4.c eng_t4_des.c eng_t4_err.c eng_t4_md5.c eng_t4_montmul.c eng_t4_sha1.c eng_t4_sha256.c eng_t4_sha512.c
-T4_ENGINE_FILES += t4_aes.S t4_des.S t4_md5.S t4_sha1.S t4_sha2.S
-MERCURIAL_URL = https://hg.openindiana.org/upstream/oracle/userland-gate/raw-file/tip/components/openssl/openssl-1.0.1/
-PATCH_DATE = $(shell date +"%Y-%m-%d %H:%M:%S.%N %z")
-TMP_PATCH_FILE = "/tmp/t4_engine_tmp.patch"
-update-t4-patch:
-	@echo "Updating t4 engine patch from $(MERCURIAL_URL)..."
-	@( wget --quiet --output-document=- $(MERCURIAL_URL)/patches/openssl-$(VERSION)-t4-engine.sparc-patch; \
-	   for FILE in $(T4_ENGINE_FILES); do \
-		DIR="engine"; \
-		if echo $$FILE | grep "\.S$$" >/dev/null; then DIR="`basename $$FILE .S | cut -d_ -f2 | cut -b1-3`/asm"; fi; \
-		wget --quiet --output-document=$(TMP_PATCH_FILE) $(MERCURIAL_URL)/engines/t4/$$FILE | sed -e 's/^/+/'; \
-		echo "Index: crypto/$$DIR/$$FILE"; \
-		echo "==================================================================="; \
-		echo "diff -uNr openssl-$(VERSION)/$$DIR/$$FILE openssl-$(VERSION)/$$DIR/$$FILE"; \
-		echo "--- openssl-$(VERSION)/crypto/$$DIR/$$FILE 1970-01-01 01:00:00.000000000 +0100"; \
-		echo "+++ openssl-$(VERSION)/crypto/$$DIR/$$FILE $(PATCH_DATE)"; \
-		echo "@@ -0,0 +1,`wc -l $(TMP_PATCH_FILE) | awk '{ print $$1 }'` @@"; \
-		sed -e 's/^/+/' "$(TMP_PATCH_FILE)"; \
-	   done; ) > "$(FILEDIR)/openssl-$(VERSION)-t4-engine.sparc-patch"

Added: csw/mgar/pkg/openssl1/trunk/files/update-t4-patch.sh
===================================================================
--- csw/mgar/pkg/openssl1/trunk/files/update-t4-patch.sh	                        (rev 0)
+++ csw/mgar/pkg/openssl1/trunk/files/update-t4-patch.sh	2013-03-11 18:18:47 UTC (rev 20431)
@@ -0,0 +1,55 @@
+#!/bin/bash
+#
+# update-t4-patch - retrieve the last t4 engine patch from
+#                   hg.openindiana.org repository 
+#           
+
+T4_ENGINE_FILES="eng_t4_aes_asm.h eng_t4_bignum.h eng_t4_des_asm.h eng_t4_err.h eng_t4_sha2_asm.h \
+                 eng_t4.c eng_t4_des.c eng_t4_err.c eng_t4_md5.c eng_t4_montmul.c eng_t4_sha1.c eng_t4_sha256.c eng_t4_sha512.c \
+                 t4_aes.S t4_des.S t4_md5.S t4_sha1.S t4_sha2.S"
+MERCURIAL_URL="https://hg.openindiana.org/upstream/oracle/userland-gate/raw-file/tip/components/openssl/openssl-1.0.1/"
+WGET_OPTIONS="--quiet"
+
+
+if [[ -z "$1" ]]; then
+	echo "Usage: update-t4-patch.sh OPENSSL_VERSION"
+	exit 1
+fi
+
+VERSION="$1"
+PATCH_FILE="openssl-${VERSION}-t4-engine.sparc-patch"
+PATCH_DATE=$(date +"%Y-%m-%d %H:%M:%S.%N %z")
+
+echo "Updating t4 engine patch from ${MERCURIAL_URL}..."
+(
+	# ar in in /usr/ccs/bin under Solaris 9 and 10 so we change the path
+	wget $WGET_OPTIONS --output-document=- ${MERCURIAL_URL}/patches/openssl-${VERSION}-t4-engine.sparc-patch | \
+		sed -e 's/\/usr\/bin\/ar/\/usr\/ccs\/bin\/ar/g'
+
+	# in the repository, the new files are not part of the patch, but we merge them
+	# in a single patch
+	for FILE in $T4_ENGINE_FILES; do \
+		if [[ "${FILE##*.}" != "S" ]]; then
+			DIR="engine"
+		else
+			DIR="${FILE:3:3}/asm"
+		fi
+
+		wget $WGET_OPTIONS --output-document="${PATCH_FILE}.tmp" "${MERCURIAL_URL}/engines/t4/$FILE"
+		NB_LINES=$(wc -l "${PATCH_FILE}.tmp" | awk '{ print $1 }')
+
+		echo "Index: crypto/$DIR/$FILE"
+		echo "==================================================================="
+		echo "diff -uNr openssl-${VERSION}/$DIR/$FILE openssl-${VERSION}/$DIR/$FILE"
+		echo "--- openssl-${VERSION}/crypto/$DIR/$FILE 1970-01-01 01:00:00.000000000 +0100"
+		echo "+++ openssl-${VERSION}/crypto/$DIR/$FILE ${PATCH_DATE}"
+		echo "@@ -0,0 +1,${NB_LINES} @@"
+		sed -e 's/^/+/' "${PATCH_FILE}.tmp"
+	done
+) > "${PATCH_FILE}"
+
+rm -f "${PATCH_FILE}.tmp"
+echo "Updated patch in ${PATCH_FILE}"
+
+
+

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