File: rules

package info (click to toggle)
sheepdog 0.8.3-4.1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,376 kB
  • ctags: 3,953
  • sloc: ansic: 30,552; sh: 3,573; perl: 2,924; asm: 453; makefile: 391; python: 192
file content (69 lines) | stat: -rwxr-xr-x 2,092 bytes parent folder | download | duplicates (3)
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
# -*- makefile -*-

DEBVERS         ?= $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
VERSION         ?= $(shell echo '$(DEBVERS)' | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//')
DEBFLAVOR       ?= $(shell dpkg-parsechangelog | grep -E ^Distribution: | cut -d" " -f2)
DEBPKGNAME      ?= $(shell dpkg-parsechangelog | grep -E ^Source: | cut -d" " -f2)
UPSTREAM_GIT    ?= git://github.com/sheepdog/sheepdog.git
GIT_TAG         ?= $(shell echo v'$(VERSION)' | sed -e 's/~/_/')

%:
	dh $@ --with autoreconf

override_dh_builddeb:
	dh_builddeb -- -Zxz -z9

override_dh_autoreconf:
	dh_autoreconf --mode=timesize

override_dh_auto_build:
	dh_auto_build --parallel

UNAME := $(shell uname)
ifeq ($(UNAME),Linux)
	ZOOKEEPER=--enable-zookeeper
endif

override_dh_auto_configure:
	dh_auto_configure -- ${ZOOKEEPER} --enable-http

override_dh_install:
	dh_install
	rm -rf debian/sheepdog/etc/init.d/
	dh_bash-completion

get-vcs-source:
	git remote add upstream $(UPSTREAM_GIT) || true
	git fetch upstream
	if [ ! -f ../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ] ; then \
		git archive --prefix=$(DEBPKGNAME)-$(GIT_TAG)/ $(GIT_TAG) | xz >../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ; \
	fi
	if [ ! -e ../build-area ] ; then mkdir ../build-area ; fi
	if [ ! -e ../build-area ] ; then cp ../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ../build-area ; fi
	if ! git checkout master ; then \
		echo "No upstream branch: checking out" ; \
		git checkout -b master upstream/master ; \
	fi
	git checkout debian/$(DEBFLAVOR)

display-po-stats:
	cd $(CURDIR)/debian/po; for i in *.po ;do \
		echo -n $$i": ";\
		msgfmt -o /dev/null --statistic $$i ; \
	done

call-for-po-trans:
	podebconf-report-po --call --withtranslators --languageteam

gen-upstream-changelog:
	git checkout master
	git reset --hard $(GIT_TAG)
	git log >$(CURDIR)/../CHANGELOG
	git checkout debian/$(DEBFLAVOR)
	mv $(CURDIR)/../CHANGELOG $(CURDIR)/debian/CHANGELOG
	git add $(CURDIR)/debian/CHANGELOG
	git commit -a -m "Updated upstream changelog"

override_dh_installchangelogs:
	dh_installchangelogs $(CURDIR)/debian/CHANGELOG