#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) CROSS = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) else CROSS = --build $(DEB_BUILD_GNU_TYPE) endif CFLAGS := $(shell dpkg-buildflags --get CFLAGS) CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) CFLAGS += -Wall configure-stamp: dh_testdir dh_update_autotools_config rm -rf debian/build rm -f src/libneon/PLUGIN/REQ mkdir debian/build cd debian/build && \ CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' \ AUTOCONF_CROSS='$(CROSS)' AUTOCONF_CFLAGS='$(CFLAGS)' \ AUTOCONF_CPPFLAGS='$(CPPFLAGS)' AUTOCONF_LDFLAGS='$(LDFLAGS)' \ ../../src/configure --prefix=/usr --with cc gcc touch configure-stamp build-indep: build-arch: build-stamp build: build-stamp build-stamp: configure-stamp dh_testdir $(MAKE) -j1 -C debian/build CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' # Temporary skipping arm where the testsuite is know to be broken # There is a bug somewhere that this causes recompilation of almost everything. # Someone might take a look to find it... if [ "$(DEB_BUILD_ARCH)" != "arm" ]; \ then \ $(MAKE) -j1 CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' -C debian/build test || exit 1; \ fi touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp dh_autoreconf_clean dh_clean $(RM) -r debian/build install: build-stamp dh_testdir dh_testroot dh_prep dh_installdirs # Installing package $(MAKE) -j1 -C debian/build install destdir=$(CURDIR)/debian/tla \ CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' install -m 0755 src/tla/=gpg-check.awk debian/tla/usr/bin/tla-gpg-check # Installing documentation install -d -m 0755 debian/tla-doc/usr/share/doc/tla-doc cp -a src/docs-tla debian/tla-doc/usr/share/doc/tla-doc/html install -d -m 0755 debian/tla-doc/usr/share/doc/tla ln -s ../tla-doc/html debian/tla-doc/usr/share/doc/tla/html # Removing double files rm -f debian/tla-doc/usr/share/doc/tla-doc/html/ChangeLog rm -rf debian/tla-doc/usr/share/doc/tla-doc/html/PLUGIN find debian/tla-doc/usr/share/doc/tla-doc/html -name "=*" -exec rm -f {} \; # Installing lintian overrides for LINTIAN in debian/lintian/*; \ do \ install -D -m 644 $$LINTIAN debian/`basename $$LINTIAN`/usr/share/lintian/overrides/`basename $$LINTIAN` || exit 1; \ done binary-indep: install dh_testdir -i dh_testroot -i dh_installchangelogs -ptla-doc src/docs-tla/ChangeLog dh_installdocs -i dh_install -i dh_link -i dh_strip -i dh_compress -i -Xusr/share/doc/tla-doc/html dh_fixperms -i dh_installdeb -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i binary-arch: install dh_testdir -a dh_testroot -a dh_installchangelogs -ptla src/tla/ChangeLog dh_installdocs -a dh_install -a dh_installman -a dh_link -a dh_strip -a dh_compress -a dh_fixperms -a dh_installdeb -a dh_shlibdeps -a dh_gencontrol -a dh_md5sums -a dh_builddeb -a binary: binary-indep binary-arch .PHONY: build-arch build-indep build clean binary-indep binary-arch binary install # Provide a repackaging target UPSTREAM_VERSION=1.3.5 DFSG=dfsg1 get-orig-source: # Download upstream tarball wget http://www.atai.org/gnuarch/releases/tla-$(UPSTREAM_VERSION).tar.gz tar xaf tla-$(UPSTREAM_VERSION).tar.gz # Remove non-free bits from source rm -rf tla-$(UPSTREAM_VERSION)/src/docs-hackerlab rm tla-$(UPSTREAM_VERSION)/src/hackerlab/libhackerlab/libhackerlab.doc rm tla-$(UPSTREAM_VERSION)/src/build-tools/standards/standards.doc # Repackage tarball mv tla-$(UPSTREAM_VERSION) tla-$(UPSTREAM_VERSION)+$(DFSG) tar caf tla-$(UPSTREAM_VERSION)+$(DFSG).orig.tar.xz tla-$(UPSTREAM_VERSION)+$(DFSG) # Clean up temporary files rm -rf tla-$(UPSTREAM_VERSION) tla-$(UPSTREAM_VERSION)+$(DFSG) tla-$(UPSTREAM_VERSION).tar.gz .PHONY: get-orig-source