4 # Uncomment this to turn on verbose mode.
8 include /usr/share/quilt/quilt.make
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.]*~//')
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)
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)
27 CROSS= --build $(DEB_BUILD_GNU_TYPE)
32 config.status: patch configure
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
38 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
39 cp -f /usr/share/misc/config.guess config.guess
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"
44 build-stamp: config.status
49 clean: clean-patched unpatch
54 [ ! -f Makefile ] || $(MAKE) distclean
55 rm -f config.sub config.guess
63 $(MAKE) DESTDIR=$(CURDIR)/debian/lcr install
64 rm $(CURDIR)/debian/lcr/usr/sbin/genrc
67 # Build architecture-independent files here.
69 # We have nothing to do by default.
71 # Build architecture-dependent files here.
78 dh_installinit -- defaults 21
90 binary: binary-indep binary-arch
93 @@echo "Debian version: $(DEBVERSION)"
94 @@echo "Upstream version: $(UP_DATE_VER)"
98 @@[ -d ../tarballs/. ] || mkdir -p ../tarballs
99 @@wget -nv -T10 -t3 --verbose -O ../tarballs/$(FILENAME) $(URL)
101 .PHONY: build clean binary-indep binary-arch binary install patch unpatch