3 # Debian build rules for help2man.
5 # Copyright (C) 2012, 2014, 2017, 2018, 2021 Free Software Foundation, Inc.
7 # Copying and distribution of this file, with or without modification,
8 # are permitted in any medium without royalty provided the copyright
9 # notice and this notice are preserved. This file is offered as-is,
10 # without any warranty.
12 # Written by Brendan O'Dea <bod@debian.org>
16 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
21 execute_before_dh_clean: check-maint-prep # maintainer sanity check
23 override_dh_auto_configure:
24 dh_auto_configure -- --libdir=\$$\{prefix\}/lib # omit arch from libdir
26 execute_after_dh_auto_build:
27 $(MAKE) help2man.h2m # for examples
29 .PHONY: execute_before_dh_clean override_dh_auto_configure
30 .PHONY: execute_after_dh_auto_build
32 # Maintainer pre-release setup. Intended to be run from a copy of the
33 # contents of the git repository, excluding the .git subdir. E.g. something
37 # version=$(./help2man.PL --version)
38 # mkdir ../help2man-$version
39 # find -name .git -prune -o -print | cpio -vdump ../help2man-$version
40 # cd ../help2man-$version
41 # debian/rules maint-prep
43 # should result in a directory which is ready to be archived for release.
44 AM_DOC = COPYING INSTALL
45 AM_AUX = install-sh missing mkinstalldirs
46 AM_DIR = $(shell ls -d /usr/share/automake* 2>/dev/null | tail -1)
47 PKG_VERSION = $(shell ./help2man.PL --version)
48 include /usr/share/dpkg/pkg-info.mk # DEB_VERSION
51 test $(DEB_VERSION) = $(PKG_VERSION) # mismatch b/w $$version in help2man.PL and changelog
52 cp $(addprefix $(AM_DIR)/,$(AM_DOC)) .
53 cp $(addprefix $(AM_DIR)/,$(AM_AUX)) build-aux
54 (eval `sed -n 's/^Vcs-\([^:]*\): /VCS_\U\1=/p' debian/control`; \
55 echo " README for GNU help2man version $(PKG_VERSION)"; \
57 echo "help2man is a script to create simple man pages from the --help and"; \
58 echo "--version output of programs."; \
60 echo "Since most GNU documentation is now in info format, this provides a"; \
61 echo "way to generate a placeholder man page pointing to that resource while"; \
62 echo "still providing some useful information."; \
64 echo " Home page: http://www.gnu.org/software/help2man/"; \
65 echo " Distribution: ftp://ftp.gnu.org/gnu/help2man/help2man-$(PKG_VERSION).tar.xz"; \
66 echo " Repository: $$VCS_GIT"; \
69 echo "Brendan O'Dea <bod@debian.org>") >README
70 ln -sf debian/changelog ChangeLog
73 $(MAKE) update-po all distclean
75 # Simple sanity check that the above rule has been run prior to release (run
76 # as part of the "clean" rule, which is the first thing run when building a
79 test -x configure # autoconf has been run
80 [[ $(DEB_VERSION) = *+b[0-9]* ]] || # this is a bin-NMU, or... \
81 grep -qF 'help2man-$(DEB_VERSION).tar' README # exists and up to date
83 maint-clean: maint-prep
85 $(MAKE) maintainer-clean
86 rm -f README ChangeLog $(AM_DOC) $(addprefix build-aux/,$(AM_AUX))
88 .PHONY: maint-prep check-maint-prep maint-clean