diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:44:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:44:09 +0000 |
commit | 5e707dc6ca775854c09fef2729e0be1d997399a5 (patch) | |
tree | e676fd1b87f19e374fb51d8ee2d47742c8c8c02f /debian/rules | |
parent | Adding upstream version 1.23.0. (diff) | |
download | groff-5e707dc6ca775854c09fef2729e0be1d997399a5.tar.xz groff-5e707dc6ca775854c09fef2729e0be1d997399a5.zip |
Adding debian version 1.23.0-3.debian/1.23.0-3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/rules')
-rwxr-xr-x | debian/rules | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..6963937 --- /dev/null +++ b/debian/rules @@ -0,0 +1,119 @@ +#! /usr/bin/make -f +%: + dh $@ --builddirectory=debian/build + +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 + +include /usr/share/dpkg/architecture.mk + +confflags = \ + --libdir=\$${prefix}/lib --with-appdefdir=/etc/X11/app-defaults \ + BASH_PROG=/bin/bash GREP=/bin/grep + +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) +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: + # Always rebuild documentation from source. + mkdir -p debian/doc-save + find doc \( -name \*.dvi -or -name \*.info -or -name \*.pdf \) \ + -exec mv -f -t debian/doc-save '{}' + +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) + +override_dh_auto_install: + dh_auto_install -- \ + docdir=\$${prefix}/share/doc/groff-base \ + INSTALL_INFO=: + +execute_after_dh_install: + # 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 + +execute_before_dh_auto_clean: + [ ! -d debian/doc-save ] || \ + find debian/doc-save -type f -exec mv -f -t doc '{}' + + rm -rf debian/doc-save |