File: rules

package info (click to toggle)
module-assistant 0.11.14
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 628 kB
  • sloc: perl: 1,350; sh: 372; makefile: 168
file content (100 lines) | stat: -rwxr-xr-x 2,910 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
#!/usr/bin/make -f

#export DH_VERBOSE=1

include /usr/share/dpkg/pkg-info.mk

# Make sure not to generate manpages with a non-C locale date format:
export LC_ALL=C

prepare-changelog: LAST?=$(shell git describe | sed 's/-.*//')
prepare-changelog: BRANCH=$(shell git branch | grep '^*' | awk '{print $$2}')
prepare-changelog:
	# Make sure git-buildpackage is installed (ensures git-core is, too):
	@if [ -z "$(shell which git-dch)" ] ; then \
		echo "E: git-buildpackage isn't installed, needed for this target." ; \
		exit 1 ; \
	fi

	# Determine last tag:
	git dch --debian-branch=$(BRANCH) --since=$(LAST)


git-build: PACKAGE=module-assistant
git-build: VERSION=$(DEB_VERSION)
git-build:
	# Make sure git-core is installed:
	@if [ -z "$(shell which git)" ] ; then \
		echo "E: git-core isn't installed, needed for this target." ; \
		exit 1 ; \
	fi

	# Generate the tarball with an appropriate prefix:
	git archive --prefix=$(PACKAGE)-$(VERSION)/ HEAD | gzip -9 \
		> ../$(PACKAGE)_$(VERSION).tar.gz ; echo $$?

	# Extract it, build the source package, clean afterwards
	# (also clean before, there might be something already):
	cd .. && \
		rm -rf $(PACKAGE)-$(VERSION) && \
		tar xfz $(PACKAGE)_$(VERSION).tar.gz && \
		cd $(PACKAGE)-$(VERSION) && \
		debuild $(DEBUILDFLAGS) && \
		cd .. && \
		rm -rf $(PACKAGE)-$(VERSION)

source-package: DEBUILDFLAGS=-us -uc -S
source-package: git-build

binary-package: git-build

git-release: git-build pristine-tar-commit

.NOTPARALLEL:
# keep the order above. Could use
# $(MAKE) -f $(lastword $(MAKEFILE_LIST)) pristine-tar-commit
# instead but this is easier and speed is hardly an issue

pristine-tar-commit: PACKAGE=module-assistant
pristine-tar-commit: VERSION=$(DEB_VERSION)
pristine-tar-commit: TARBALL=../$(PACKAGE)_$(VERSION).tar.gz
pristine-tar-commit: BRANCH=$(shell git branch | grep '^*' | awk '{print $$2}')
pristine-tar-commit:
	# Make sure pristine-tar is installed:
	@if [ -z "$(shell which pristine-tar)" ] ; then \
		echo "E: pristine-tar isn't installed, needed for this target." ; \
		exit 1 ; \
	fi

	# Make sure the tarball exists:
	@if [ ! -f $(TARBALL) ] ; then \
		echo "E: $(TARBALL) tarball is missing." ; \
		echo "I: Need to use the 'source-package' target first?" ; \
		exit 1 ; \
	fi

	# Commit the tarball:
	pristine-tar commit $(TARBALL) $(subst ~,_,$(VERSION))

############################################################################

VENDOR		?= $(call dpkg_late_eval,VENDOR,dpkg-vendor --derives-from Ubuntu && echo Ubuntu || echo Debian)
AUTOGENERATED	:= $(patsubst %.in,%,$(wildcard modass/*.in))

execute_before_dh_auto_configure: $(AUTOGENERATED) ;

override_dh_auto_install:
	dh_auto_install --destdir=debian/tmp

override_dh_install:
	dh_install -X.in

execute_after_dh_auto_clean:
	$(RM) $(AUTOGENERATED)

%: %.in
	sed 's%@VENDOR@%$(VENDOR)%g' < $< > $@
	chmod --reference=$< $@

%:
	dh $@ --without single-binary