--- openssl.old/debian/rules Mon Aug 4 19:23:39 2008 +++ /opt/emdebian/trunk/o/openssl/trunk/openssl-0.9.8g/debian/rules Mon Aug 4 19:41:12 2008 @@ -17,6 +17,11 @@ # The binary architeture DEB_HOST_ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH) +DEB_HOST_GNU_TYPE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) +CROSS=CC=$(DEB_HOST_GNU_TYPE)-gcc +endif CONFARGS = --prefix=/usr --openssldir=/usr/lib/ssl no-idea no-mdc2 no-rc5 zlib enable-tlsext OPT_alpha = ev4 ev5 @@ -26,14 +31,18 @@ OPTS = $($(ARCHOPTS)) WANTED_LIBC_VERSION = 2.3.1-10 +ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) +USE_TEST=make test +endif + build: dh_testdir perl util/perlpath.pl /usr/bin # perl util/ssldir.pl /usr/lib/ssl # chmod +x debian/libtool ./Configure no-shared $(CONFARGS) debian-$(DEB_HOST_ARCH) - make -f Makefile all - make test + make $(CROSS) -f Makefile all + $(USE_TEST) mv libcrypto.a libcrypto.static mv libssl.a libssl.static make -f Makefile clean @@ -41,18 +50,20 @@ do \ set -xe; \ ./Configure shared $(CONFARGS) debian-$(DEB_HOST_ARCH)-$$opt; \ - make -f Makefile all; \ - make test; \ + make $(CROSS) -f Makefile all; \ + $(USE_TEST) \ mkdir -p $$opt; \ mv libcrypto.so* libssl.so* $$opt/; \ make -f Makefile clean; \ done ./Configure shared $(CONFARGS) debian-$(DEB_HOST_ARCH) #make -f Makefile depend +ifeq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS))) ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/ +endif # make -f Makefile linux-shared - make -f Makefile all - make test + make $(CROSS) -f Makefile all + $(USE_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) @@ -70,11 +81,12 @@ -perl util/perlpath.pl /usr/local/bin/perl # 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 util/mk1mf.bak Makefile.bak `find . -name Makefile.save` -rm -f crypto/pem/ctx_size -rm -f `find . -name "*~"` -rm -f `find . -name "*.orig" -o -name "*.rej"` -rm -f certs/*.0 certs/*.1 + -rm -f certs/.0 # -rm -rf debian/tmp debian/files* core `find debian/* -type d` -rm -rf core $(OPTS) -rm doc/*.pod @@ -101,6 +113,11 @@ dh_installdirs #openssl install make -f Makefile install INSTALL_PREFIX=`pwd`/debian/tmp +ifneq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS))) + rm -rf debian/tmp/usr/share/man/ +endif + $(RM) debian/tmp/usr/bin/c_rehash + $(RM) debian/tmp/usr/lib/ssl/misc/CA.pl # rm debian/tmp/usr/share/man/man1/openssl.1 # rm debian/tmp/usr/share/man/man3/crypto.3 # rm debian/tmp/usr/share/man/man3/ssl.3 @@ -129,19 +146,19 @@ # cp -auv lib*.a debian/tmp/usr/lib/ for opt in $(OPTS); do set -xe; mkdir -p debian/tmp/usr/lib/$$opt; cp -auv $$opt/lib*.so* debian/tmp/usr/lib/$$opt/; done install debian/copyright debian/libssl0.9.8/usr/share/doc/libssl0.9.8/ +ifneq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS))) + gzip -9 debian/libssl0.9.8/usr/share/doc/libssl0.9.8/copyright +else install debian/changelog debian/libssl0.9.8/usr/share/doc/libssl0.9.8/changelog.Debian install debian/copyright debian/libssl-dev/usr/share/doc/libssl-dev/ install debian/changelog debian/libssl-dev/usr/share/doc/libssl-dev/changelog.Debian +endif # (cd debian/tmp/usr/doc/openssl/doc; for f in *.doc*; do mv "$$f" "$$(echo $$f | sed -e 's/doc/txt/')";done) # (cd doc; for f in *; do install "$$f" ../debian/tmp/usr/share/doc/openssl/doc/"$$(echo $$f | sed -e 's/doc/txt/')";done) # debstd -u CHANGES* LICENSE README NEWS - dh_installdocs CHANGES.SSLeay README NEWS debian/README.optimization - dh_installexamples - dh_installchangelogs CHANGES # dh_installmenu # dh_installcron - dh_installman -popenssl dh_installdebconf # dh_undocumented c_rehash.1 dh_movefiles