[Pkg-openssl-changes] r875 - openssl/branches/1.1.0/debian

Sebastian Andrzej Siewior bigeasy at moszumanska.debian.org
Thu Jan 19 21:57:14 UTC 2017


Author: bigeasy
Date: 2017-01-19 21:57:14 +0000 (Thu, 19 Jan 2017)
New Revision: 875

Modified:
   openssl/branches/1.1.0/debian/rules
Log:
redo the rules more and use build directory for the build

so in the clean part we can just wipe that directory out
and don't need to move the .a files away after the static build



Modified: openssl/branches/1.1.0/debian/rules
===================================================================
--- openssl/branches/1.1.0/debian/rules	2016-12-31 14:30:04 UTC (rev 874)
+++ openssl/branches/1.1.0/debian/rules	2017-01-19 21:57:14 UTC (rev 875)
@@ -41,101 +41,91 @@
 	CONFARGS += enable-ec_nistp_64_gcc_128
 endif
 
-MAKE_TEST = $(MAKE) test HARNESS_VERBOSE=yes
-ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
-	MAKE_TEST = :
-endif
-
 %:
 	dh $@ --without autoreconf
 
 override_dh_auto_configure:
-
-override_dh_auto_build:
-#	perl util/ssldir.pl /usr/lib/ssl
-#	chmod +x debian/libtool
-	./Configure no-shared $(CONFARGS) debian-$(DEB_HOST_ARCH)
-	$(MAKE) depend
-	$(MAKE) -f Makefile all
-	$(MAKE_TEST)
-	mv libcrypto.a libcrypto.static
-	mv libssl.a libssl.static
-	$(MAKE) -f Makefile clean
 	test -z "$(OPTS)" || for opt in $(OPTS); \
 	do \
 		set -xe; \
-		./Configure shared $(CONFARGS) debian-$(DEB_HOST_ARCH)-$$opt; \
-		$(MAKE) -f Makefile all; \
-		$(MAKE_TEST); \
-		mkdir -p $$opt; \
-		mv libcrypto.so* libssl.so* $$opt/; \
-		$(MAKE) -f Makefile clean; \
+		mkdir build_$$opt; \
+		cd build_$$opt ; \
+		../Configure shared $(CONFARGS) debian-$(DEB_HOST_ARCH)-$$opt; \
+		cd .. ;\
 	done
+	mkdir build_static; cd build_static; ../Configure no-shared $(CONFARGS) debian-$(DEB_HOST_ARCH)
 	# Debian Perl policy 5.1 (Script Magic)
-	HASHBANGPERL=/usr/bin/perl ./Configure shared $(CONFARGS) debian-$(DEB_HOST_ARCH)
-	#$(MAKE) -f Makefile depend
+	mkdir build_shared; cd build_shared; HASHBANGPERL=/usr/bin/perl ../Configure shared $(CONFARGS) debian-$(DEB_HOST_ARCH)
+
+override_dh_auto_build-indep:
+	$(MAKE) -C build_shared all
+
+override_dh_auto_build-arch:
+	$(MAKE) -C build_static all
+	test -z "$(OPTS)" || for opt in $(OPTS); \
+	do \
+		set -xe; \
+		$(MAKE) -C build_$$opt all; \
+	done
 	ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/
-#	$(MAKE) -f Makefile linux-shared
-	$(MAKE) -f Makefile all
-	$(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)
-#	$(MAKE) -f Makefile all
+	$(MAKE) -C build_shared all
 
-# we test as part of the build
-override_dh_auto_test:
+override_dh_auto_test-indep:
 
+override_dh_auto_test-arch:
+ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
+	@echo Skipping tests
+else
+	test -z "$(OPTS)" || for opt in $(OPTS); \
+	do \
+		set -xe; \
+		$(MAKE) -C build_$$opt test HARNESS_VERBOSE=yes; \
+	done
+	$(MAKE) -C build_static test HARNESS_VERBOSE=yes
+	$(MAKE) -C build_shared test HARNESS_VERBOSE=yes
+endif
+
 override_dh_auto_clean:
-	-./Configure $(CONFARGS) debian-$(DEB_HOST_ARCH)
-	[ ! -f Makefile ] || $(MAKE) -f Makefile clean
-	#-$(MAKE) -f Makefile  dclean
-#	perl util/ssldir.pl /usr/local/ssl
-	-rm -f test/.rnd test/testkey.pem test/testreq.pem test/certCA.srl
-	-rm -f util/mk1mf.bak Makefile.bak `find . -name Makefile.save` 
-	-rm -f crypto/pem/ctx_size pod2htmd.tmp
-	-rm -f `find . -name "*~"`
-	-rm -f `find . -name "*.orig" -o -name "*.rej"`
-	-rm -f certs/*.0 certs/*.1
-#	-rm -rf debian/tmp debian/files* core `find debian/* -type d`
-	-rm -rf core $(OPTS)
-	-rm doc/*.pod
-	-rm -f libcrypto.* libssl.*
-	-cd test && rm -f .rnd tmp.bntest tmp.bctest *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff bntest ectest  ecdsatest ecdhtest ideatest md2test  md4test md5test hmactest rc2test rc4test rc5test destest shatest sha1test sha256t sha512t mdc2test rmdtest randtest dhtest enginetest bftest casttest ssltest exptest dsatest rsa_test evp_test *.ss *.srl log dummytest newkey.pem igetest
-	-rm Makefile apps/CA.pl tools/c_rehash crypto/opensslconf.h crypto/x86_64cpuid.S
-	rm -f test/asn1test test/wp_test test/srptest test/jpaketest
-	rm -f certs/demo/*.0
-	rm -rf crypto/aes/aes-armv4.S crypto/bn/armv4-gf2m.S crypto/modes/ghash-armv4.S crypto/sha/*.S
-	rm -f configdata.pm crypto/include/internal/bn_conf.h crypto/include/internal/dso_conf.h include/openssl/opensslconf.h
-	rm -f crypto.map ssl.map engines/afalg/afalg.so test/req-check.err test/req-fff.p test/sid-fff.p
-	find . -type l -exec rm '{}' \;
+	rm -rf build_static build_shared
+	test -z "$(OPTS)" || for opt in $(OPTS); \
+	do \
+		set -xe; \
+		rm -rf build_$$opt; \
+	done
+	rm -f doc/openssl.pod doc/crypto.pod doc/ssl.pod
+	dh_auto_clean
 
-override_dh_auto_install:
-	$(MAKE) -f Makefile install DESTDIR=`pwd`/debian/tmp
+override_dh_auto_install-indep:
+	$(MAKE) -C build_shared install DESTDIR=`pwd`/debian/tmp
+	# Those two ensure that it is not installed in case we build both
+	# (ARCH and INDEP) in one go
+	mkdir -p debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/openssl
+	mv debian/tmp/usr/include/openssl/opensslconf.h debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/openssl/
+
+override_dh_auto_install-arch:
+	$(MAKE) -C build_shared install DESTDIR=`pwd`/debian/tmp
 	# pic static libraries, nobody should need them
-#	mv debian/tmp/usr/lib/libcrypto.a debian/tmp/usr/lib/libcrypto_pic.a
-#	mv debian/tmp/usr/lib/libssl.a debian/tmp/usr/lib/libssl_pic.a
-	cp -pf libcrypto.static debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libcrypto.a
-	cp -pf libssl.static debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libssl.a
+	cp -pf build_static/libcrypto.a debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libcrypto.a
+	cp -pf build_static/libssl.a debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libssl.a
 	mkdir -p debian/tmp/etc/ssl
 	mv debian/tmp/usr/lib/ssl/{certs,openssl.cnf,private} debian/tmp/etc/ssl/
 	ln -s /etc/ssl/{certs,openssl.cnf,private} debian/tmp/usr/lib/ssl/
 	cp -pf debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libcrypto.so.* debian/libcrypto1.1-udeb/usr/lib/
 	cp -pf debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libssl.so.* debian/libssl1.1-udeb/usr/lib/
-	cp -auv lib*.so* debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/
+	cp -auv build_shared/lib*.so* debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/
 	for opt in $(OPTS); \
 		do set -xe; \
 		mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/$$opt; \
-		cp -auv $$opt/lib*.so* debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/$$opt/; \
+		cp -auv build_$$opt/lib*.so* debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/$$opt/; \
 	done
 	mkdir -p debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/openssl
 	mv debian/tmp/usr/include/openssl/opensslconf.h debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/openssl/
 
-override_dh_installchangelogs-binary:
+override_dh_installchangelogs:
 	dh_installchangelogs -a CHANGES
 
 override_dh_fixperms:
-	chmod 700 debian/openssl/etc/ssl/private
+	test -d debian/openssl/etc/ssl/private && chmod 700 debian/openssl/etc/ssl/private
 	dh_fixperms -a -X etc/ssl/private
 
 override_dh_makeshlibs:




More information about the Pkg-openssl-changes mailing list