File: rules

package info (click to toggle)
welcome2l 3.05-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 424 kB
  • sloc: ansic: 1,433; makefile: 71; sh: 42
file content (43 lines) | stat: -rwxr-xr-x 1,677 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

DH_AUTO_OPTIONS         := -v -Smakefile --parallel
DEB_BUILD_MAINT_OPTIONS := hardening=+all
DEB_CFLAGS_MAINT_APPEND := $(shell getconf LFS_CFLAGS) -Wall -Wextra
TDIR                    := debian/_tmp_
DEFFILE                 := debian/default

include /usr/share/dpkg/buildflags.mk

%:
	dh "$@"

# Set #DISTROMSG# in debian/defaults to for example 'Debian GNU/Linux'
# 'Debian GNU/Hurd', or 'Ubuntu Linux' with a few leading spaces to
# make the string appear centered when displayed by welcome2l.
$(DEFFILE): $(DEFFILE).in debian/rules
	@set -e; rm -f "$@";                                                   \
	set -- $$(lsb_release --short --description || :);                     \
	[ -n "$$2" -a "$${2#GNU/}" != "$$2" ] || set "$${1:-Debian}" Linux;    \
	distromsg=$$(echo "$$1 $$2"                                            \
	             | sed -e ':loop; s|^.\{1,23\}$$| & |; tloop; s| *$$||g'); \
	echo "Substituting \`#DISTROMSG#' in \`$@' with \`$$distromsg'";       \
	sed -e "s|#DISTROMSG#|$$distromsg|g" < "$<" > "$@";                    \
	chmod 444 "$@"

override_dh_auto_build: $(DEFFILE)
	dh_auto_build $(DH_AUTO_OPTIONS) -- CC=gcc CFLAGS+="$(CPPFLAGS)"

override_dh_auto_install:
	dh_auto_install $(DH_AUTO_OPTIONS) \
		--destdir=$(CURDIR)/debian/$(shell dh_listpackages)/usr -- \
	        INSTALL_MANPATH='$$(DESTDIR)/share/man'
	
	@test -d $(TDIR) || mkdir $(TDIR)
	# make sure that INSTALL file wasn't changed
	echo '8a200ad70ad278e894fd6a073acff7ea  INSTALL' | md5sum -c
	@sed -e '14,140d' -e 's|/usr/local|/usr|g' < INSTALL > $(TDIR)/INSTALL

override_dh_auto_clean:
	dh_auto_clean $(DH_AUTO_OPTIONS)
	
	rm -rf $(TDIR) $(DEFFILE)