File: rules

package info (click to toggle)
rtpproxy 1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 1,020 kB
  • ctags: 332
  • sloc: sh: 8,380; ansic: 5,195; xml: 698; makefile: 106
file content (110 lines) | stat: -rwxr-xr-x 2,904 bytes parent folder | download
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/make -f

include /usr/share/quilt/quilt.make

export DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export 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

PKGNAME := rtpproxy
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$$//')

FILENAME := $(PKGNAME)_$(UPVERSION).orig.tar.gz
URL := http://b2bua.org/chrome/site/rtpproxy-$(UPVERSION).tar.gz

MANPAGE := debian/$(PKGNAME).8

configure:
	autoreconf --force --install

configure-stamp: $(QUILT_STAMPFN) configure
	dh_testdir
	rm -f config.sub config.guess
	ln -sf /usr/share/misc/config.sub .
	ln -sf /usr/share/misc/config.guess .
	rm -f config.cache
	./configure CFLAGS="$(CFLAGS)" --prefix=/usr --sysconfdir=/etc
	touch configure-stamp

$(MANPAGE): debian/manpage.xml
	xsltproc -nonet -o $@ /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl $<

build: build-stamp
build-stamp: configure-stamp $(MANPAGE)
	dh_testdir
	$(MAKE)
	touch build-stamp

clean: unpatch
	dh_testdir
	dh_testroot
	-rm -f build-stamp configure-stamp
	-rm -f debian/rtpproxy.8 
	[ ! -f Makefile ] || $(MAKE) distclean
	-rm -f Makefile.in aclocal.m4 config.sub config.guess config.h.in \
		configure depcomp install-sh ltmain.sh missing mkinstalldirs
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k 
	dh_installdirs
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp

binary-indep: build install

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_install
	dh_installinit
	dh_installman
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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

get-orig-source:
	@@dh_testdir
	@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
	@@echo Downloading $(FILENAME) from $(URL) ...
	@@wget -N -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL)
	@@echo Repacking without upstream debian/...
	@@mkdir -p ../tarballs/rtpproxy-$(UPVERSION).tmp/
	@@cd ../tarballs/rtpproxy-$(UPVERSION).tmp ; \
	   tar xfz ../$(FILENAME)
	@@rm -fR  ../tarballs/rtpproxy-$(UPVERSION).tmp/rtpproxy-$(UPVERSION)/debian
	@@cd ../tarballs/rtpproxy-$(UPVERSION).tmp ; \
	   tar cfz ../$(FILENAME) *
	@@echo Cleaning up...
	@@rm -rf ../tarballs/rtpproxy-$(UPVERSION).tmp/

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install print-version get-orig-source