SIP: Add DTMF support (receive INFO only)
[lcr.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3
4 # Uncomment this to turn on verbose mode.
5 #export DH_VERBOSE=1
6
7 # quilt
8 include /usr/share/quilt/quilt.make
9
10 DEBVERSION:=$(shell head -n 1 debian/changelog \
11                     | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
12 LOCAL_TAR_VER:=$(shell echo $(DEBVERSION) | sed -e 's/^.*://' -e 's/-[0-9.]*$$//')
13 UP_MAJOR_VER:=$(shell echo $(LOCAL_TAR_VER) | sed -e 's/~[0-9.]*//')
14 UP_DATE_VER:=$(shell echo $(LOCAL_TAR_VER) | sed -e 's/[0-9.]*~//')
15
16 UPFILENAME := lcr_$(UP_DATE_VER).tar.gz
17 FILENAME := lcr_$(LOCAL_TAR_VER).orig.tar.gz
18 URL := http://isdn.eversberg.eu/download/lcr-$(UP_MAJOR_VER)/$(UPFILENAME)
19
20 # These are used for cross-compiling and for saving the configure script
21 # from having to guess our platform (since we know it already)
22 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
23 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
24 ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
25 CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
26 else
27 CROSS= --build $(DEB_BUILD_GNU_TYPE)
28 endif
29
30
31
32 config.status: patch configure
33         dh_testdir
34         # Add here commands to configure the package.
35 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
36         cp -f /usr/share/misc/config.sub config.sub
37 endif
38 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
39         cp -f /usr/share/misc/config.guess config.guess
40 endif
41         CPPFLAGS="-I/usr/include/mISDNuser" ./configure $(CROSS) --without-ssl --without-gsm --prefix=/usr --localstatedir=/var --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" # LDFLAGS="-Wl,-z,defs"
42
43 build: build-stamp
44 build-stamp:  config.status 
45         dh_testdir
46         $(MAKE)
47         touch $@
48
49 clean: clean-patched unpatch
50 clean-patched: 
51         dh_testdir
52         dh_testroot
53         rm -f build-stamp 
54         [ ! -f Makefile ] || $(MAKE) distclean
55         rm -f config.sub config.guess
56         dh_clean 
57
58 install: build
59         dh_testdir
60         dh_testroot
61         dh_prep
62         dh_installdirs
63         $(MAKE) DESTDIR=$(CURDIR)/debian/lcr install
64         rm $(CURDIR)/debian/lcr/usr/sbin/genrc
65
66
67 # Build architecture-independent files here.
68 binary-indep: install
69 # We have nothing to do by default.
70
71 # Build architecture-dependent files here.
72 binary-arch: install
73         dh_testdir
74         dh_testroot
75         dh_installchangelogs
76         dh_installdocs
77         dh_installlogrotate
78         dh_installinit  -- defaults 21
79         dh_installman
80         dh_link
81         dh_strip
82         dh_compress
83         dh_fixperms
84         dh_installdeb
85         dh_shlibdeps
86         dh_gencontrol
87         dh_md5sums
88         dh_builddeb
89
90 binary: binary-indep binary-arch
91
92 print-version:
93         @@echo "Debian version:          $(DEBVERSION)"
94         @@echo "Upstream version:        $(UP_DATE_VER)"
95
96 get-orig-source:
97         @@dh_testdir
98         @@[ -d ../tarballs/. ] || mkdir -p ../tarballs
99         @@wget -nv -T10 -t3 --verbose -O ../tarballs/$(FILENAME) $(URL)
100
101 .PHONY: build clean binary-indep binary-arch binary install patch unpatch