#!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) confflags += --build $(DEB_HOST_GNU_TYPE) else confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) endif CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif DEBVERSION:=$(shell head -n 1 debian/changelog \ | sed -e 's/^[^(]*(\([^)]*\)).*/\1/') UPVERSION:=$(shell echo $(DEBVERSION) | sed -e 's/^.*://' -e 's/-[0-9.]*$$//' -e 's/~dfsg[0-9]*$$//') FILENAME := iaxmodem_$(UPVERSION)~dfsg.orig.tar.gz UPFILENAME := iaxmodem_$(UPVERSION).orig.tar.gz URL := http://heanet.dl.sourceforge.net/iaxmodem/iaxmodem-$(UPVERSION).tar.gz %: dh $@ --with-autotools_dev # The build target must not be empty. Sadly because of how make # works, we have do duplicate the target in this case. (#888601) build: dh $@ --with-autotools_dev override_dh_auto_configure: # Check that problematic files have been removed prior to packaging ( [ ! -e lib/spandsp/src/spandsp/mmx.h ] && \ [ ! -d lib/spandsp/src/msvc ] && [ ! -f lib/spandsp/libspandsp.vcproj ] && \ [ ! -d lib/spandsp/autom4te.cache ] && [ ! -d lib/libiax2/autom4te.cache ] ) || \ (echo "WARNING: sources are not clean!"; false) # Add here commands to configure the package. (cd lib/libiax2 && ./configure $(confflags) --disable-shared) (cd lib/spandsp && ./configure $(confflags) --disable-shared) override_dh_auto_build: # Add here commands to compile the package. $(MAKE) -C ./lib/libiax2 $(MAKE) -C ./lib/spandsp ./build static override_dh_auto_clean: [ ! -f lib/libiax2/Makefile ] || $(MAKE) -C ./lib/libiax2 distclean [ ! -f lib/spandsp/Makefile ] || $(MAKE) -C ./lib/spandsp distclean rm -rf ./lib/spandsp/autom4te.cache override_dh_installchangelogs: dh_installchangelogs CHANGES overridedh_installinit: # start before hylafax (20), stop after hylafax (20) and before asterisk (21) dh_installinit -- defaults 19 20 print-version: @@echo "Debian version: $(DEBVERSION)" @@echo "Upstream version: $(UPVERSION)" get-orig-source: @@dh_testdir @@[ -d ../tarballs/. ]||mkdir -p ../tarballs @@echo Downloading $(UPFILENAME) from $(URL) ... @@wget -nv -T10 -t3 -O ../tarballs/$(UPFILENAME) $(URL) @@echo Repacking as DFSG-free... @@rm -rf ../tarballs/iaxmodem-$(UPVERSION).tmp @@mkdir -p ../tarballs/iaxmodem-$(UPVERSION).tmp/;cd ../tarballs/iaxmodem-$(UPVERSION).tmp && \ tar xfz ../$(UPFILENAME) && \ for file in lib/spandsp/src/spandsp/mmx.h lib/spandsp/src/msvc/\ lib/spandsp/libspandsp.vcproj lib/libiax2/autom4te.cache/ \ lib/spandsp/autom4te.cache/ lib/libiax2/CVS lib/libiax2/src/CVS; \ do rm -rf iaxmodem-$(UPVERSION)/$$file; done && tar cfz ../$(FILENAME) * @@echo Cleaning up... @@$(RM) -rf ../tarballs/iaxmodem-$(UPVERSION).tmp .PHONY: build