3
# Sample debian/rules that uses debhelper.
4
# This file was originally written by Joey Hess and Craig Small.
5
# As a special exception, when this file is copied by dh-make into a
6
# dh-make output file, you may use that output file without restriction.
7
# This special exception was added by Craig Small in version 0.37 of dh-make.
9
# Uncomment this to turn on verbose mode.
12
# Include dpatch rules
13
include /usr/share/dpatch/dpatch.make
15
# These are used for cross-compiling and for saving the configure script
16
# from having to guess our platform (since we know it already)
17
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
18
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
20
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
21
confflags += --build $(DEB_HOST_GNU_TYPE)
23
confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
29
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
35
DEBVERSION:=$(shell head -n 1 debian/changelog \
36
| sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
37
UPVERSION:=$(shell echo $(DEBVERSION) | sed -e 's/^.*://' -e 's/-[0-9.]*$$//' -e 's/.dfsg$$//')
39
FILENAME := iaxmodem_$(UPVERSION).dfsg.orig.tar.gz
40
UPFILENAME := iaxmodem_$(UPVERSION).orig.tar.gz
41
URL := http://switch.dl.sourceforge.net/iaxmodem/iaxmodem-$(UPVERSION).tar.gz
44
-rm -f ./lib/libiax2/config.sub ./lib/libiax2/config.guess
45
ln -s /usr/share/misc/config.sub ./lib/libiax2/config.sub
46
ln -s /usr/share/misc/config.guess ./lib/libiax2/config.guess
48
-rm -f ./lib/spandsp/config/config.sub ./lib/spandsp/config/config.guess
49
ln -s /usr/share/misc/config.sub ./lib/spandsp/config/config.sub
50
ln -s /usr/share/misc/config.guess ./lib/spandsp/config/config.guess
55
configure-stamp: autotools-stamp
58
# Check that problematic files have been removed prior to packaging
59
( grep -q Debian lib/spandsp/src/spandsp/mmx.h && \
60
[ ! -d lib/spandsp/src/msvc ] && [ ! -f lib/spandsp/libspandsp.vcproj ] && \
61
[ ! -d lib/spandsp/autom4te.cache ] && [ ! -d lib/libiax2/autom4te.cache ] ) || \
62
(echo "WARNING: sources are not clean!"; false)
64
# Add here commands to configure the package.
65
(cd lib/libiax2 && ./configure $(confflags) --disable-shared)
66
(cd lib/spandsp && ./configure $(confflags) --disable-shared)
73
build-stamp: patch-stamp configure-stamp
76
# Add here commands to compile the package.
77
$(MAKE) -C ./lib/libiax2
78
$(MAKE) -C ./lib/spandsp
84
clean: real-clean unpatch
88
rm -f build-stamp configure-stamp autotools-stamp
90
# Add here commands to clean up after the build process.
91
-$(MAKE) -C ./lib/libiax2 distclean
92
-rm -f ./lib/libiax2/config.sub ./lib/libiax2/config.guess
93
-$(MAKE) -C ./lib/spandsp distclean
94
rm -rf ./lib/spandsp/autom4te.cache
95
-rm -f ./lib/spandsp/config/config.sub ./lib/spandsp/config/config.guess
97
-rm -f iaxmodem iaxmodem.o
107
# Add here commands to install the package into debian/iaxmodem.
108
cp iaxmodem debian/iaxmodem/usr/bin
111
# Build architecture-independent files here.
112
binary-indep: build install
113
# We have nothing to do by default.
115
# Build architecture-dependent files here.
116
binary-arch: build install
119
dh_installchangelogs CHANGES
124
# start before hylafax (20), stop after hylafax (20) and before asterisk (21)
125
dh_installinit -- defaults 19 20
126
dh_installman iaxmodem.1
139
@@echo "Debian version: $(DEBVERSION)"
140
@@echo "Upstream version: $(UPVERSION)"
144
@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
145
@@echo Downloading $(UPFILENAME) from $(URL) ...
146
@@wget -N -nv -T10 -t3 -O ../tarballs/$(UPFILENAME) $(URL)
147
@@echo Repacking as DFSG-free...
148
@@rm -rf ../tarballs/iaxmodem-$(UPVERSION).tmp
149
@@mkdir -p ../tarballs/iaxmodem-$(UPVERSION).tmp/;cd ../tarballs/iaxmodem-$(UPVERSION).tmp && \
150
tar xfz ../$(UPFILENAME) && \
151
for file in lib/spandsp/src/spandsp/mmx.h lib/spandsp/src/msvc/\
152
lib/spandsp/libspandsp.vcproj lib/libiax2/autom4te.cache/ \
153
lib/spandsp/autom4te.cache/ lib/spandsp/config/config.sub \
154
lib/spandsp/config/config.guess lib/libiax2/config.sub \
155
lib/libiax2/config.guess lib/libiax2/CVS lib/libiax2/src/CVS; do rm -rf iaxmodem-$(UPVERSION)/$$file; done && \
156
tar cfz ../$(FILENAME) *
157
@@echo Cleaning up...
158
@@$(RM) -rf ../tarballs/iaxmodem-$(UPVERSION).tmp
160
binary: binary-indep binary-arch
161
.PHONY: build clean binary-indep binary-arch binary install patch unpatch real-clean