~asac/connman/connman.debian.unstable

1 by Alexander Sack
Initial release of upstream 0.10 + git snapshot
1
#!/usr/bin/make -f
2
18 by Alexander Sack
* make debian/rules in bzr executable
3
GIT_URL := git://git.kernel.org/pub/scm/network/connman/connman.git
27.2.3 by Mathieu Trudel
* add GIT_BRANCH, GIT_BRANCH_NAME, DEB_MAJOR_VERSION to support daily builds
4
GIT_BRANCH := "master"
5
GIT_BRANCH_NAME := connman
18 by Alexander Sack
* make debian/rules in bzr executable
6
7
DEB_SOURCE := $(shell dpkg-parsechangelog | grep Source: | sed -e 's/Source: //')
8
DEB_VERSION := $(shell dpkg-parsechangelog | grep Version: | sed -e 's/Version: //')
9
DEB_UPSTREAM_VERSION := $(shell echo $(DEB_VERSION) | sed -e 's/-[^-]*$$//')
27.2.3 by Mathieu Trudel
* add GIT_BRANCH, GIT_BRANCH_NAME, DEB_MAJOR_VERSION to support daily builds
10
DEB_MAJOR_VERSION := $(shell echo $(DEB_UPSTREAM_VERSION) | sed -e 's/git.*//')
18 by Alexander Sack
* make debian/rules in bzr executable
11
1 by Alexander Sack
Initial release of upstream 0.10 + git snapshot
12
include /usr/share/cdbs/1/class/autotools.mk
13
include /usr/share/cdbs/1/rules/debhelper.mk
14
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
15
16
DEB_DESTDIR = $(CURDIR)/debian/tmp/
17
18
DEB_CONFIGURE_EXTRA_FLAGS += \
19
		--enable-dhclient \
17 by Alexander Sack
* enable more plugins: modemmgr and ethernet
20
		--enable-ethernet \
1 by Alexander Sack
Initial release of upstream 0.10 + git snapshot
21
		--enable-loopback \
22
		--enable-pie \
23
		--enable-wifi \
24
		--enable-hso \
25
		--enable-novatel \
26
		--enable-ppp \
27
		--with-pppd=/usr/sbin/pppd \
28
		--enable-bluetooth \
29
		--enable-udev \
30
		--enable-polkit \
31
		--enable-client \
32
		--enable-huawei \
17 by Alexander Sack
* enable more plugins: modemmgr and ethernet
33
		--enable-modemmgr \
1 by Alexander Sack
Initial release of upstream 0.10 + git snapshot
34
                $(NULL)
35
27.1.10 by Alexander Sack
* set --only-scripts parameter for dh_installinit (cdbs)
36
DEB_DH_INSTALLINIT_ARGS = --only-scripts
37
27.2.4 by Mathieu Trudel
* Add update-local-branch code to work with local git copies
38
ifneq (,$(LOCAL_BRANCH))
39
LOCAL_REAL_BRANCH = $(realpath $(LOCAL_BRANCH))
40
endif
41
27.2.6 by Mathieu Trudel
* Handle dfsg special case, add MAKE_DFSG_COMPLIANT snippet
42
MAKE_DFSG_COMPLIANT = \
43
	echo "remove dfsg non-free files ..."; \
44
	rm -f doc/*.txt;
45
27.2.5 by Mathieu Trudel
* Revise get-orig-source code, add get-current-source and GET_SOURCE snippets
46
GET_SOURCE = \
47
	set -e; \
48
	tmpdir=`mktemp -d -t`; \
49
	cd $$tmpdir; \
50
		echo "cloning upstream repository ..."; \
51
		git clone $(if $(LOCAL_BRANCH),$(call LOCAL_REAL_BRANCH)/$(GIT_BRANCH_NAME),$(GIT_URL)) $(GIT_BRANCH_NAME); \
52
		echo "getting specific upstream revision/tag: $(1)"; \
53
		cd `ls | head -n 1`; git checkout -b orig $(1); \
54
		commit_id=`git log -n1 --abbrev-commit | grep '^commit ' | sed -e 's/commit //' | sed -e 's/\.\.\.$$//'`; \
55
		raw=`date --utc --date="$$(git log --pretty=fuller -n1 --date=rfc | grep CommitDate: | sed -e 's/CommitDate:[^0-9]*//')" "+%Y%m%dt%H%M%S"`; \
56
		version_suffix=`echo $(DEB_UPSTREAM_VERSION) | sed -e 's/.*git\(\(\.\?[a-z0-9]*\)*\)\([+~.].*\)/\3/'`; \
57
		if echo $(1) | grep -q -c "orig" || echo $(DEB_VERSION) | grep -q -c "git"; \
58
		then \
59
			upstream_version=$(DEB_MAJOR_VERSION)git.$$raw.$$commit_id$$version_suffix; \
60
		else \
61
			upstream_version=$(DEB_UPSTREAM_VERSION); \
62
		fi; \
63
		if echo $$version_suffix | grep -q -c 'dfsg'; \
64
		then \
65
			$(call MAKE_DFSG_COMPLIANT) \
66
		fi; \
67
		cd ..; tar --exclude=.git -czf $(CURDIR)/$(DEB_SOURCE)_$$upstream_version.orig.tar.gz `ls | head -n 1`; \
68
		cd $(CURDIR); rm -rf $$tmpdir; 
69
27.2.7 by Mathieu Trudel
* Add pre-build, clean targets
70
clean::
71
	@echo "cleaning up autotools caches (autom4te.cache) ...";
72
	rm -rf autom4te.cache;
73
74
pre-build::
75
	@echo "gtkdocize ...";
76
	gtkdocize --copy --docdir doc;
77
	@echo "autotools bootstrapping ...";
78
	./bootstrap;
79
27.2.5 by Mathieu Trudel
* Revise get-orig-source code, add get-current-source and GET_SOURCE snippets
80
get-current-source:: $(if $(LOCAL_BRANCH),update-local-branch)
81
	set -e; if echo $(DEB_VERSION) | grep -q -c "git"; \
18 by Alexander Sack
* make debian/rules in bzr executable
82
	then \
27.2.5 by Mathieu Trudel
* Revise get-orig-source code, add get-current-source and GET_SOURCE snippets
83
		git_version=`echo $(DEB_VERSION) | sed -e 's/^.*git\.*\([0-9t]*\)\.\(.*\)-.*$$/\2/g'`; \
18 by Alexander Sack
* make debian/rules in bzr executable
84
	else \
27.2.5 by Mathieu Trudel
* Revise get-orig-source code, add get-current-source and GET_SOURCE snippets
85
		git_version=`echo $(DEB_UPSTREAM_VERSION) | sed -e 's/+dfsg$$//'`; \
18 by Alexander Sack
* make debian/rules in bzr executable
86
	fi; \
27.2.5 by Mathieu Trudel
* Revise get-orig-source code, add get-current-source and GET_SOURCE snippets
87
	$(call GET_SOURCE, $$git_version, "current")
88
89
get-orig-source:: $(if $(LOCAL_BRANCH),update-local-branch)
90
	$(call GET_SOURCE, $(GIT_BRANCH), "orig")
18 by Alexander Sack
* make debian/rules in bzr executable
91
	
27.2.4 by Mathieu Trudel
* Add update-local-branch code to work with local git copies
92
update-local-branch::
93
	@echo "updating local branch ($(LOCAL_BRANCH))"
94
	@set -e; if ! test -d $(LOCAL_BRANCH); then mkdir -p $(LOCAL_BRANCH); fi
95
	@set -e; if ! test -d $(LOCAL_BRANCH)/$(GIT_BRANCH_NAME); then git clone $(GIT_URL) $(LOCAL_BRANCH)/$(GIT_BRANCH_NAME); fi
96
	@set -e; cd $(LOCAL_BRANCH)/$(GIT_BRANCH_NAME); git pull -f
97
	@echo "updated local branch ($(LOCAL_BRANCH))"
18 by Alexander Sack
* make debian/rules in bzr executable
98