File: rules

package info (click to toggle)
dahdi-tools 1%3A2.11.1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 8,404 kB
  • ctags: 6,281
  • sloc: ansic: 54,472; sh: 13,747; perl: 4,025; makefile: 568; xml: 26
file content (78 lines) | stat: -rwxr-xr-x 2,226 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
endif

PREFIX:=dahdi
PACKAGE_SRC:=$(PREFIX)-tools

DEBVERSION:=$(shell head -n 1 debian/changelog \
		    | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
DEB_BASE_VERSION:=$(shell echo $(DEBVERSION) | sed -e 's/^.*://' -e 's/-[0-9.]*$$//')
UPVERSION:=$(shell echo $(DEB_BASE_VERSION) | sed -e 's/~dfsg\(~\|$$\)/\1/' -e 's/~\(rc\|beta\)/-\1/')

UPFILENAME := $(PACKAGE_SRC)_$(UPVERSION).orig.tar.gz
FILENAME := $(PACKAGE_SRC)_$(DEB_BASE_VERSION).orig.tar.gz
URL := http://downloads.asterisk.org/pub/telephony/$(PACKAGE_SRC)/releases/$(PACKAGE_SRC)-$(UPVERSION).tar.gz

CHANGED_FILES_LIST = debian/savedfiles.lst
CHANGED_FILES_ARCHIVE = debian/savedfiles.cpio

%:
	dh $@ --with autoreconf

override_dh_autoreconf:
	if [ ! -f "$(CHANGED_FILES_ARCHIVE)" -a -f Makefile.in ]; then \
	  cpio -o < $(CHANGED_FILES_LIST) > $(CHANGED_FILES_ARCHIVE); \
	fi
	dh_autoreconf

override_dh_autoreconf_clean:
	dh_autoreconf_clean
	if [ -f "$(CHANGED_FILES_ARCHIVE)" ]; then \
	  cpio -idu < $(CHANGED_FILES_ARCHIVE) && \
	  rm -f $(CHANGED_FILES_ARCHIVE); \
	fi

# An ugly workaround because those files are included in the tarball
override_dh_clean:
	dh_clean -X autom4te.cache


override_dh_auto_build:
	$(MAKE) all docs
	# FIXME: xpp/README.Astribank.html
	cat dahdi.rules xpp/xpp.rules >debian/dahdi.udev

override_dh_auto_clean:
ifeq ($(wildcard Makefile),)
	$(MAKE) -f Makefile.legacy clean
else
	$(MAKE) clean
endif

override_dh_auto_configure:
	dh_auto_configure

override_dh_auto_install:
	# also run the 'config' target, in addition to the 'install' target:
	dh_auto_install -- config
	rm $(CURDIR)/debian/tmp/usr/share/dahdi/span_config.d/50-asterisk

print-version:
	@@echo "Debian version:          $(DEBVERSION)"
	@@echo "Upstream version:        $(UPVERSION)"

TARBALL_DIR=../tarballs/zaptel-$(UPVERSION).tmp
get-orig-source:
	@@dh_testdir
	@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
	@@echo Downloading $(UPFILENAME) from $(URL) ...
	@@wget  -nv -T10 -t3 --verbose -O ../tarballs/$(FILENAME) $(URL)