File: rules

package info (click to toggle)
groff 1.22.4-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 20,912 kB
  • sloc: cpp: 73,640; ansic: 21,994; perl: 10,764; sh: 7,065; cs: 3,696; makefile: 889; awk: 91; sed: 76
file content (112 lines) | stat: -rwxr-xr-x 3,816 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
101
102
103
104
105
106
107
108
109
110
111
112
#! /usr/bin/make -f
%:
	dh $@ --builddirectory=debian/build --with=autoreconf --parallel

export DH_OPTIONS

export LC_ALL := C.UTF-8

export DEB_BUILD_MAINT_OPTIONS := hardening=+all
export DEB_CPPFLAGS_MAINT_APPEND := -D_FILE_OFFSET_BITS=64
export DEB_CFLAGS_MAINT_APPEND := -Wall
export DEB_CXXFLAGS_MAINT_APPEND := -Wall -std=gnu++98

# Based loosely on /usr/share/dpkg/buildflags.mk, but we need to do this
# ourselves in order to get flags for both build and host architectures.
# Compare https://bugs.debian.org/644412.

export_envvar := \
	DEB_BUILD_MAINT_OPTIONS="$(DEB_BUILD_MAINT_OPTIONS)" \
	DEB_CPPFLAGS_MAINT_APPEND="$(DEB_CPPFLAGS_MAINT_APPEND)" \
	DEB_CFLAGS_MAINT_APPEND="$(DEB_CFLAGS_MAINT_APPEND)" \
	DEB_CXXFLAGS_MAINT_APPEND="$(DEB_CXXFLAGS_MAINT_APPEND)"

buildflags := YACC='bison -y' PSPRINT=lpr PAGE=A4
buildflags_native := $(buildflags)
buildflags += $(shell $(export_envvar) dpkg-buildflags --export=cmdline)
buildflags_native += $(shell \
	DEB_HOST_ARCH="$(DEB_BUILD_ARCH)" $(export_envvar) \
	dpkg-buildflags --export=cmdline)
buildflags_native += DEB_HOST_GNU_TYPE=$(DEB_BUILD_GNU_TYPE)
buildflags_native += env -u CONFIG_SITE

export UPSTREAM_VERSION := $(shell \
	sed 's/^\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/' \
	.tarball-version)
datadir  = usr/share/groff/$(UPSTREAM_VERSION)

gbtmp = debian/groff-base
gtmp  = debian/groff

DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE  := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

confflags = --libdir=\$${prefix}/lib --with-appresdir=/etc/X11/app-defaults

override_dh_autoreconf:
	dh_autoreconf autoreconf -- -f -i -I m4

override_dh_auto_configure:
	-rm -f config.log config.cache
	$(buildflags) dh_auto_configure -- $(confflags)
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
	$(buildflags_native) dh_auto_configure \
		--builddirectory=debian/build-native -- \
		$(confflags) --with-doc=no
endif
	# Work around an unfortunate interaction between the
	# non-recursive-gnulib-prefix-hack module and out-of-tree builds.
	mkdir -p debian/build/lib
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
	mkdir -p debian/build-native/lib
endif

ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
  cross :=
else
  native_tmp := $(CURDIR)/debian/build-native
  cross := \
	GROFFBIN=$(native_tmp)/groff \
	GROFF_BIN_PATH=$(native_tmp)
endif

override_dh_auto_build:
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
	dh_auto_build --builddirectory=debian/build-native -- \
		extratmacdirs=/usr/share/groff/tmac \
		docdir=\$${prefix}/share/doc/groff-base
endif
	GROFF_NO_SGR=1 dh_auto_build --builddirectory=debian/build -- \
		extratmacdirs=/usr/share/groff/tmac \
		docdir=\$${prefix}/share/doc/groff-base $(cross)
	GROFF_NO_SGR=1 $(MAKE) -C debian/build $(cross) \
		doc/meintro.txt doc/meref.txt doc/pic.txt

override_dh_auto_install:
	dh_auto_install -- \
		docdir=\$${prefix}/share/doc/groff-base \
		INSTALL_INFO=:

override_dh_install:
	dh_install --fail-missing
	# Debian additions to *.local
	cat debian/mandoc.local >> $(gbtmp)/etc/groff/man.local
	cat debian/mandoc.local >> $(gbtmp)/etc/groff/mdoc.local
	# Scripts should be executable
	chmod +x $(gbtmp)/$(datadir)/font/devps/generate/afmname \
		 $(gbtmp)/$(datadir)/font/devps/generate/symbol.sed
	chmod +x $(gtmp)/$(datadir)/font/devdvi/generate/CompileFonts \
		 $(gtmp)/$(datadir)/font/devlj4/generate/special.awk
	# Debian Policy 10.4 specifies the #! line for Perl scripts
	grep -rlZ '#! */usr/bin/env perl' $(gbtmp) $(gtmp) | \
		xargs -0r sed -i 's,\(#! *\)/usr/bin/env perl,\1/usr/bin/perl,'

override_dh_installdocs:
	dh_installdocs -pgroff-base
	dh_installdocs -pgroff -Xcopyright --link-doc=groff-base

override_dh_installchangelogs:
	dh_installchangelogs -pgroff-base

override_dh_compress:
	dh_compress -X.mom