3 # Debian build rules for help2man.
5 # Copyright (C) 2012, 2014, 2017, 2018 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>
15 DPKG_EXPORT_BUILDFLAGS = 1
17 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
19 include /usr/share/dpkg/architecture.mk
20 include /usr/share/dpkg/buildflags.mk
21 include /usr/share/dpkg/pkg-info.mk
23 ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
24 CONFARGS = --host=$(DEB_HOST_GNU_TYPE)
27 build: build-arch build-indep
28 build-arch build-indep: build-stamp
31 dh_update_autotools_config # update config.guess, config.sub
32 ./configure --prefix=/usr --enable-nls --mandir='$${prefix}/share/man' \
33 --infodir='$${prefix}/share/info' $(CONFARGS)
36 $(MAKE) help2man.h2m # for examples
39 clean: check-maint-prep # maintainer sanity check
42 [ ! -f Makefile ] || $(MAKE) distclean
43 rm -f build-stamp install-stamp
46 install: install-stamp
47 install-stamp: build-stamp
52 $(MAKE) install DESTDIR=$(CURDIR)/debian/help2man
55 binary: binary-indep binary-arch
56 binary-arch: build install
73 binary-indep: build install
75 # Maintainer pre-release setup. Intended to be run from a copy of the
76 # contents of the git repository, excluding the .git subdir. E.g. something
80 # version=$(./help2man.PL --version)
81 # mkdir ../help2man-$version
82 # find -name .git -prune -o -print | cpio -vdump ../help2man-$version
83 # cd ../help2man-$version
84 # debian/rules maint-prep
86 # should result in a directory which is ready to be archived for release.
87 AM_DOC = COPYING INSTALL
88 AM_AUX = install-sh missing mkinstalldirs
89 AM_DIR = $(shell ls -d /usr/share/automake* 2>/dev/null | tail -1)
90 PKG_VERSION = $(shell ./help2man.PL --version)
93 test $(DEB_VERSION) = $(PKG_VERSION) # $version in help2man.PL updated
94 cp $(addprefix $(AM_DIR)/,$(AM_DOC)) .
95 cp $(addprefix $(AM_DIR)/,$(AM_AUX)) build-aux
96 (eval `sed -n 's/^Vcs-\([^:]*\): /VCS_\U\1=/p' debian/control`; \
97 echo " README for GNU help2man version $(PKG_VERSION)"; \
99 echo "help2man is a script to create simple man pages from the --help and"; \
100 echo "--version output of programs."; \
102 echo "Since most GNU documentation is now in info format, this provides a"; \
103 echo "way to generate a placeholder man page pointing to that resource while"; \
104 echo "still providing some useful information."; \
106 echo " Home page: http://www.gnu.org/software/help2man/"; \
107 echo " Distribution: ftp://ftp.gnu.org/gnu/help2man/help2man-$(PKG_VERSION).tar.xz"; \
108 echo " Repository: $$VCS_GIT"; \
111 echo "Brendan O'Dea <bod@debian.org>") >README
112 ln -sf debian/changelog ChangeLog
115 $(MAKE) update-po all distclean
117 # Simple sanity check that the above rule has been run prior to release (a
118 # dependency of the "clean" rule, which is the first thing run when building a
121 test -x configure # autoconf has been run
122 grep -qF 'help2man-$(DEB_VERSION).tar' README # exists and up to date
124 maint-clean: maint-prep
126 $(MAKE) maintainer-clean
127 rm -f README ChangeLog $(AM_DOC) $(addprefix build-aux/,$(AM_AUX))
129 .PHONY: build build-arch build-indep clean install binary binary-arch
130 .PHONY: binary-indep maint-prep check-maint-prep maint-clean