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
40 test README -nt help2man.PL # maintainer sanity check
43 [ ! -f Makefile ] || $(MAKE) distclean
44 rm -f build-stamp install-stamp
47 install: install-stamp
48 install-stamp: build-stamp
53 $(MAKE) install DESTDIR=$(CURDIR)/debian/help2man
56 binary-arch: build install
73 binary-indep: build install
76 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
78 # Maintainer pre-release setup. Intended to be run from a copy of the
79 # contents of the git repository, excluding the .git subdir. E.g. something
83 # version=$(./help2man.PL --version)
84 # mkdir ../help2man-$version
85 # find -name .git -prune -o -print | cpio -vdump ../help2man-$version
86 # cd ../help2man-$version
87 # debian/rules maint-prep
89 # should result in a directory which is ready to be archived for release.
90 AM_DOC = COPYING INSTALL
91 AM_AUX = install-sh missing mkinstalldirs
92 AM_DIR = $(shell ls -d /usr/share/automake* 2>/dev/null | tail -1)
93 PKG_VERSION = $(shell ./help2man.PL --version)
96 test $(DEB_VERSION) = $(PKG_VERSION) # $version in help2man.PL updated
97 cp $(addprefix $(AM_DIR)/,$(AM_DOC)) .
98 cp $(addprefix $(AM_DIR)/,$(AM_AUX)) build-aux
99 (eval `sed -n 's/^Vcs-\([^:]*\): /VCS_\U\1=/p' debian/control`; \
100 echo " README for GNU help2man version $(PKG_VERSION)"; \
102 echo "help2man is a script to create simple man pages from the --help and"; \
103 echo "--version output of programs."; \
105 echo "Since most GNU documentation is now in info format, this provides a"; \
106 echo "way to generate a placeholder man page pointing to that resource while"; \
107 echo "still providing some useful information."; \
109 echo " Home page: http://www.gnu.org/software/help2man/"; \
110 echo " Distribution: ftp://ftp.gnu.org/gnu/help2man/help2man-$(PKG_VERSION).tar.xz"; \
111 echo " Repository: $$VCS_GIT"; \
114 echo "Brendan O'Dea <bod@debian.org>") >README
115 ln -sf debian/changelog ChangeLog
118 $(MAKE) update-po all distclean
120 maint-clean: maint-prep
122 $(MAKE) maintainer-clean
123 rm -f README ChangeLog $(AM_DOC) $(addprefix build-aux/,$(AM_AUX))
125 binary: binary-indep binary-arch
126 .PHONY: build clean binary-indep binary-arch binary maint-prep maint-clean