File: rules

package info (click to toggle)
xnbd 0.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,036 kB
  • ctags: 847
  • sloc: sh: 10,992; ansic: 7,292; python: 331; makefile: 142
file content (43 lines) | stat: -rwxr-xr-x 1,601 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
#!/usr/bin/make -f
# -*- makefile -*-

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

VERSION := $(shell dpkg-parsechangelog | perl -ne 'print $$1 if m/Version:\s*([\w\.\-\+\~]+)-\d+/')
REPOSITORY_REV := $(shell echo "$(VERSION)" | perl -ne 'print $$1 if m/hg\d+-(\w+)/')
CFLAGS := $(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
export CFLAGS LDFLAGS



%:
	dh $@ --with python2,autoreconf

override_dh_auto_configure:
	dh_auto_configure -- --libdir=/usr/lib/xnbd --disable-silent-rules

override_dh_install:
	rm -f debian/tmp/usr/share/doc/xnbd/xnbd-*.html debian/tmp/usr/share/doc/xnbd/docbook-xsl.css
	# Debian does not want .la files
	rm -f debian/tmp/usr/lib/xnbd/libxnbd_internal.la
	# changelog/README and man pages are installed by respective helpers.
	dh_install --list-missing

override_dh_installinit:
	# don't start upon installation/upgrade. We can't ship a feasible
	# default configuration.
	dh_installinit --no-start

override_dh_installchangelogs:
	dh_installchangelogs debian/tmp/usr/share/doc/xnbd/ChangeLog

get-orig-source:
	# Version generated by: hg log -r . --template '{latesttag}-hg{latesttagdistance}-{node|short}\n'
	hg clone https://bitbucket.org/hirofuchi/xnbd xnbd-$(VERSION)-hg
	cd xnbd-$(VERSION)-hg && hg archive -X .hg_archival.txt -X .hgtags -r $(REPOSITORY_REV) -t files ../xnbd-$(VERSION)
	mv -- xnbd-$(VERSION)/trunk/* xnbd-$(VERSION)/
	rmdir xnbd-$(VERSION)/trunk/
	tar jcfv xnbd_$(VERSION).orig.tar.bz2 xnbd-$(VERSION)
	rm -rf xnbd-$(VERSION) xnbd-$(VERSION)-hg