File: rules

package info (click to toggle)
haserl 0.9.35-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 772 kB
  • ctags: 298
  • sloc: ansic: 3,097; sh: 1,257; makefile: 99
file content (66 lines) | stat: -rwxr-xr-x 1,630 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# begin get-orig-source stuff
MAKEFILE = $(firstword $(MAKEFILE_LIST))
DEBIAN_DIR = $(dir $(MAKEFILE))
SOURCE_DIR = $(DEBIAN_DIR)/..
PACKAGE = $(shell sed -n 's/^Source: //p' $(DEBIAN_DIR)/control)
CURRENT_VERSION = $(shell dpkg-parsechangelog -l$(DEBIAN_DIR)/changelog | \
	sed -n 's/-.*$$//; s/^Version: //p')
USCAN = uscan \
	--upstream-version $(CURRENT_VERSION) \
	--package $(PACKAGE) \
	--watchfile $(DEBIAN_DIR)/watch
VERSION ?= $(shell $(USCAN) --dehs --no-download | \
	sed -n 's/.*<upstream-version>\(.*\)<\/upstream-version>.*/\1/p')

get-orig-source:
	$(USCAN) \
		--force-download \
		--download \
		--destdir . \
		--rename
	if [ -d "$(PACKAGE)-$(VERSION)" ]; then \
		echo "$(PACKAGE)-$(VERSION) is in the way, bailing out!"; \
		exit 1; \
	fi
	tar -xzf $(PACKAGE)_$(VERSION).orig.tar.gz
	mv \
		$(PACKAGE)-$(VERSION) \
		$(PACKAGE)-$(VERSION)+dfsg
	GZIP="-9fn --rsyncable" tar \
		--exclude=src/haserl_lualib.inc \
		-czf $(PACKAGE)_$(VERSION)+dfsg.orig.tar.gz \
		$(PACKAGE)-$(VERSION)+dfsg
	rm -rf \
		$(PACKAGE)_$(VERSION).orig.tar.gz \
		$(PACKAGE)_$(VERSION)+dfsg


# end get-orig-source stuff


# Disable bash extensions because they don't compile, and haserl's default shell
# isn't bash anyway
override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-luashell \
		--enable-luacshell \
		--enable-bashshell \
		--disable-bash-extensions \
		--enable-subshell=/bin/sh \
		--with-lua=lua5.2

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog

clean:
	dh $@
	debconf-updatepo

%:
	dh $@