File: rules

package info (click to toggle)
ptlib 2.10.4~dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 58,836 kB
  • sloc: cpp: 135,080; ansic: 8,534; yacc: 3,059; sh: 2,776; makefile: 1,082; lex: 390
file content (69 lines) | stat: -rwxr-xr-x 2,440 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
#!/usr/bin/make -f

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

FILENAME := ptlib_$(UPVERSION)~dfsg.orig.tar.gz
UPFILENAME := ptlib_$(UPVERSION).orig.tar.gz
URL := http://transact.dl.sourceforge.net/sourceforge/opalvoip/ptlib-$(UPVERSION).tar.bz2

%:
	dh $@ --with autotools_dev --parallel

override_dh_clean:
	if [ -f Makefile ];then \
		$(MAKE) PTLIBDIR=$(CURDIR) -C samples/hello_world clean||true ; \
		$(MAKE) distclean || true ; \
	fi
	rm -rf html
	dh_clean

override_dh_auto_configure:
	dh_auto_configure -- --enable-oss --enable-v4l --disable-avc --disable-dc --enable-exceptions

override_dh_auto_build:
	dh_auto_build -- optshared docs

override_dh_strip:
	dh_strip -a --dbg-package=libpt-dbg

override_dh_link:
	# replace jquery.js with Debian's version
	rm -f debian/libpt-doc/usr/share/doc/libpt-doc/html/jquery.js
	dh_link

override_dh_auto_test:
	$(MAKE) PTLIBDIR=$(CURDIR) -C samples/hello_world clean
	$(MAKE) PTLIBDIR=$(CURDIR) -C samples/hello_world opt
	#if (samples/hello_world/obj*/hello 2>/dev/null);then \
	#   echo opt hello_world sample incorrectly compiled static; false ; \
	#else \
	#   echo opt hello_world sample correctly compiled non-static; \
	#fi
	ln -s lib* lib ; LD_LIBRARY_PATH=$(CURDIR)/lib samples/hello_world/obj*/hello
	# if this won't work, we needn't even try going any further...
	rm lib
	# make sure samples are clean before we install them into libpt-doc
	$(MAKE) PTLIBDIR=$(CURDIR) -C samples/hello_world clean
	rm -rf samples/hello_world/obj_*

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

get-orig-source:
	@@dh_testdir
	@@[ -d ../tarballs/. ]||mkdir -p ../tarballs
	@@#this is for stable versions
	@@echo Downloading $(UPFILENAME) from $(URL) ...
	@@wget -nv -T10 -t3 -O ../tarballs/$(UPFILENAME) $(URL)
	@@echo 'Repacking as DFSG-free (removing windows EXEs)...'
	@@mkdir -p ../tarballs/ptlib-$(UPVERSION).tmp/
	@@cd ../tarballs/ptlib-$(UPVERSION).tmp ; tar xfj ../$(UPFILENAME)
	@@find ../tarballs/ptlib-$(UPVERSION).tmp/ -iname '*.exe' -delete
	@@echo Writing archive ../tarballs/$(FILENAME) ...
	@@cd ../tarballs/ptlib-$(UPVERSION).tmp ; tar cfz ../$(FILENAME) *
	@@echo Cleaning up...
	@@$(RM) -rf ../tarballs/ptlib-$(UPVERSION).tmp/ ../tarballs/$(UPFILENAME)