Debian Codegraph @

debian/rules

raw symbols SCIP
1 #! /usr/bin/make -f
2 %:
3 dh $@ --builddirectory=debian/build
4
5 export DH_OPTIONS
6
7 export LC_ALL := C.UTF-8
8
9 export DEB_BUILD_MAINT_OPTIONS := hardening=+all
10 export DEB_CPPFLAGS_MAINT_APPEND := -D_FILE_OFFSET_BITS=64
11 export DEB_CFLAGS_MAINT_APPEND := -Wall
12 export DEB_CXXFLAGS_MAINT_APPEND := -Wall -std=gnu++98
13
14 # Based loosely on /usr/share/dpkg/buildflags.mk, but we need to do this
15 # ourselves in order to get flags for both build and host architectures.
16 # Compare https://bugs.debian.org/644412.
17
18 export_envvar := \
19 DEB_BUILD_MAINT_OPTIONS="$(DEB_BUILD_MAINT_OPTIONS)" \
20 DEB_CPPFLAGS_MAINT_APPEND="$(DEB_CPPFLAGS_MAINT_APPEND)" \
21 DEB_CFLAGS_MAINT_APPEND="$(DEB_CFLAGS_MAINT_APPEND)" \
22 DEB_CXXFLAGS_MAINT_APPEND="$(DEB_CXXFLAGS_MAINT_APPEND)"
23
24 buildflags := YACC='bison -y' PSPRINT=lpr PAGE=A4
25 buildflags_native := $(buildflags)
26 buildflags += $(shell $(export_envvar) dpkg-buildflags --export=cmdline)
27 buildflags_native += $(shell \
28 DEB_HOST_ARCH="$(DEB_BUILD_ARCH)" $(export_envvar) \
29 dpkg-buildflags --export=cmdline)
30 buildflags_native += DEB_HOST_GNU_TYPE=$(DEB_BUILD_GNU_TYPE)
31 buildflags_native += env -u CONFIG_SITE
32
33 export UPSTREAM_VERSION := $(shell \
34 sed 's/^\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/' \
35 .tarball-version)
36 datadir = usr/share/groff/$(UPSTREAM_VERSION)
37
38 gbtmp = debian/groff-base
39 gtmp = debian/groff
40
41 include /usr/share/dpkg/architecture.mk
42
43 confflags = \
44 --libdir=\$${prefix}/lib --with-appdefdir=/etc/X11/app-defaults \
45 BASH_PROG=/bin/bash GREP=/bin/grep
46
47 override_dh_autoreconf:
48 dh_autoreconf autoreconf -- -f -i -I m4
49
50 override_dh_auto_configure:
51 -rm -f config.log config.cache
52 $(buildflags) dh_auto_configure -- $(confflags)
53 ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
54 $(buildflags_native) dh_auto_configure \
55 --builddirectory=debian/build-native -- \
56 $(confflags)
57 endif
58 # Work around an unfortunate interaction between the
59 # non-recursive-gnulib-prefix-hack module and out-of-tree builds.
60 mkdir -p debian/build/lib
61 ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
62 mkdir -p debian/build-native/lib
63 endif
64
65 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
66 cross :=
67 else
68 native_tmp := $(CURDIR)/debian/build-native
69 cross := \
70 GROFFBIN=$(native_tmp)/groff \
71 GROFF_BIN_PATH=$(native_tmp)
72 endif
73
74 override_dh_auto_build:
75 # Always rebuild documentation from source.
76 mkdir -p debian/doc-save
77 find doc \( -name \*.dvi -or -name \*.info -or -name \*.pdf \) \
78 -exec mv -f -t debian/doc-save '{}' +
79 mv -f doc/groff.texi debian/doc-save/
80 ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
81 dh_auto_build --builddirectory=debian/build-native -- \
82 extratmacdirs=/usr/share/groff/tmac \
83 docdir=\$${prefix}/share/doc/groff-base
84 endif
85 GROFF_NO_SGR=1 dh_auto_build --builddirectory=debian/build -- \
86 extratmacdirs=/usr/share/groff/tmac \
87 docdir=\$${prefix}/share/doc/groff-base $(cross)
88
89 override_dh_auto_install:
90 dh_auto_install -- \
91 docdir=\$${prefix}/share/doc/groff-base \
92 INSTALL_INFO=:
93
94 execute_after_dh_install:
95 # Debian additions to *.local
96 cat debian/mandoc.local >> $(gbtmp)/etc/groff/man.local
97 cat debian/mandoc.local >> $(gbtmp)/etc/groff/mdoc.local
98 # Scripts should be executable
99 chmod +x $(gbtmp)/$(datadir)/font/devps/generate/afmname \
100 $(gbtmp)/$(datadir)/font/devps/generate/symbol.sed
101 chmod +x $(gtmp)/$(datadir)/font/devdvi/generate/CompileFonts \
102 $(gtmp)/$(datadir)/font/devlj4/generate/special.awk
103 # Debian Policy 10.4 specifies the #! line for Perl scripts
104 grep -rlZ '#! */usr/bin/env perl' $(gbtmp) $(gtmp) | \
105 xargs -0r sed -i 's,\(#! *\)/usr/bin/env perl,\1/usr/bin/perl,'
106
107 override_dh_installdocs:
108 dh_installdocs -pgroff-base
109 dh_installdocs -pgroff -Xcopyright --link-doc=groff-base
110
111 override_dh_installchangelogs:
112 dh_installchangelogs -pgroff-base
113
114 override_dh_compress:
115 dh_compress -X.bash -X.mom
116
117 execute_before_dh_auto_clean:
118 [ ! -d debian/doc-save ] || \
119 find debian/doc-save -type f -exec mv -f -t doc '{}' +
120 rm -rf debian/doc-save