[Pkg-openssl-devel] Bug#579802: debian/rules: Allow cross-compilation and add nocheck

Kyle Moffett Kyle.D.Moffett at boeing.com
Fri Apr 30 21:42:53 UTC 2010


Package: openssl
Version: 0.9.8m-2
Severity: wishlist
Tags: patch sid

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In order to cross-compile OpenSSL, we need to override the "CC"
environment variable with the target compiler.  We also need to make
sure we disable the testsuite in that case.  As an added bonus, this
adds support for DEB_BUILD_OPTIONS=nocheck.

Signed-off-by: Kyle Moffett <Kyle.D.Moffett at boeing.com>
- ---
 debian/rules |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/debian/rules b/debian/rules
index 35c883b..5319d3c 100755
- --- a/debian/rules
+++ b/debian/rules
@@ -15,8 +15,19 @@ package=openssl
 # For generating the manpages
 export VERSION=$(shell dpkg-parsechangelog | grep '^Version:' | sed -e 's/^.*://' -e 's/-.*//')
 
+MAKE_TEST := make test
+ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
+MAKE_TEST := :
+endif
+
 # The binary architeture
- -DEB_HOST_ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH)
+export DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+export CC=$(DEB_HOST_GNU_TYPE)-gcc
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+MAKE_TEST := :
+endif
 
 CONFARGS  = --prefix=/usr --openssldir=/usr/lib/ssl no-idea no-mdc2 no-rc5 zlib  enable-tlsext
 OPT_alpha = ev4 ev5
@@ -33,7 +44,7 @@ build-stamp:
 #	chmod +x debian/libtool
 	./Configure no-shared $(CONFARGS) debian-$(DEB_HOST_ARCH)
 	make -f Makefile all
- -	make test
+	$(MAKE_TEST)
 	mv libcrypto.a libcrypto.static
 	mv libssl.a libssl.static
 	make -f Makefile clean
@@ -42,7 +53,7 @@ build-stamp:
 		set -xe; \
 		./Configure shared $(CONFARGS) debian-$(DEB_HOST_ARCH)-$$opt; \
 		make -f Makefile all; \
- -		make test; \
+		$(MAKE_TEST); \
 		mkdir -p $$opt; \
 		mv libcrypto.so* libssl.so* $$opt/; \
 		make -f Makefile clean; \
@@ -52,7 +63,7 @@ build-stamp:
 	ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/
 #	make -f Makefile linux-shared
 	make -f Makefile all
- -	make test
+	$(MAKE_TEST)
 #	strip apps/openssl
 #	make -f Makefile clean
 #	./Configure --prefix=/usr --openssldir=/usr/lib/ssl no-idea no-mdc2 no-rc5 debian-$(DEB_HOST_ARCH)
- -- 
1.7.0


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBAgAGBQJL207YAAoJECdZ3NOoPg7ffAsP/Ajfxm7A+YQ50HonFikxWpor
pFIBAmGBRyzz/hDTNjOhF22QnfZ1I9vBfCzCY0aGzR3fIt8FrGpz3ilR31Bxd8lm
PpltL0t1HFPv8w2JSJ7r3Mr9k2Le5RrgA0SkqGM6sgKSKBeJ5K22S5DIcETI3ve+
yVhkJk1QA2zOdIrUVffEuUSaNn0IvGahkAOkpTDiqNzaxijMewVcSkKcAldCrsk+
/v2SDxMLf5CCQZ3fvQun8hYhFGWgYdMbMltW2UbZr30Sju5gLMePObjk16oYiphV
Y5nuU9S9LivcwhCmHWorLclAh4R0FwN4JSJ3sSYML6WWNTDHRJjIFeojtTZDtXQ7
sRA97DEK7ZEunrnFp/EoYqi/VvtV905uAxX+ooxaQDfwu3T+SiAaFZHas9EzcX7e
mQAhsIl0MhtdLAtRlw8WsUnNVLJlhdTITNtojFp87IA3O6s+/3EJ5Iz8KgoRz4WF
DDAGz6LHARUGA5JH5Udfy0qnoKu5EybkpxSrkM6yghB9dUMSwMTWKxfaQBxY4CUb
h01dqrYp8DbvTjPxVFCzQoSLBoSgRgbZr+/08p+JWl1T+DskW1BVwllvNest0/v2
96e66ZuccU5ZI5pftYKkQU/H+8Zo3Kinttstd4GyIR1LviRd8J6O7jzSNPFQjg0p
lJuMm3/xEWPvagQuab7p
=zLjA
-----END PGP SIGNATURE-----
-------------- next part --------------
>From a662747a40dd38ad7916bb541a0a1125e946d4c8 Mon Sep 17 00:00:00 2001
From: Kyle Moffett <Kyle.D.Moffett at boeing.com>
Date: Wed, 28 Apr 2010 15:44:50 -0400
Subject: [PATCH 1/2] debian/rules: Allow cross-compilation (and add "nocheck" support)

In order to cross-compile OpenSSL, we need to override the "CC"
environment variable with the target compiler.  We also need to make
sure we disable the testsuite in that case.  As an added bonus, this
adds support for DEB_BUILD_OPTIONS=nocheck.

Signed-off-by: Kyle Moffett <Kyle.D.Moffett at boeing.com>
---
 debian/rules |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/debian/rules b/debian/rules
index 35c883b..5319d3c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,8 +15,19 @@ package=openssl
 # For generating the manpages
 export VERSION=$(shell dpkg-parsechangelog | grep '^Version:' | sed -e 's/^.*://' -e 's/-.*//')
 
+MAKE_TEST := make test
+ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
+MAKE_TEST := :
+endif
+
 # The binary architeture
-DEB_HOST_ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH)
+export DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+export CC=$(DEB_HOST_GNU_TYPE)-gcc
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+MAKE_TEST := :
+endif
 
 CONFARGS  = --prefix=/usr --openssldir=/usr/lib/ssl no-idea no-mdc2 no-rc5 zlib  enable-tlsext
 OPT_alpha = ev4 ev5
@@ -33,7 +44,7 @@ build-stamp:
 #	chmod +x debian/libtool
 	./Configure no-shared $(CONFARGS) debian-$(DEB_HOST_ARCH)
 	make -f Makefile all
-	make test
+	$(MAKE_TEST)
 	mv libcrypto.a libcrypto.static
 	mv libssl.a libssl.static
 	make -f Makefile clean
@@ -42,7 +53,7 @@ build-stamp:
 		set -xe; \
 		./Configure shared $(CONFARGS) debian-$(DEB_HOST_ARCH)-$$opt; \
 		make -f Makefile all; \
-		make test; \
+		$(MAKE_TEST); \
 		mkdir -p $$opt; \
 		mv libcrypto.so* libssl.so* $$opt/; \
 		make -f Makefile clean; \
@@ -52,7 +63,7 @@ build-stamp:
 	ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/
 #	make -f Makefile linux-shared
 	make -f Makefile all
-	make test
+	$(MAKE_TEST)
 #	strip apps/openssl
 #	make -f Makefile clean
 #	./Configure --prefix=/usr --openssldir=/usr/lib/ssl no-idea no-mdc2 no-rc5 debian-$(DEB_HOST_ARCH)
-- 
1.7.0



More information about the Pkg-openssl-devel mailing list