Imported Upstream version 1.47.6
[platform/upstream/help2man.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # Debian build rules for help2man.
4
5 # Copyright (C) 2012, 2014 Free Software Foundation, Inc.
6
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.
11
12 # Written by Brendan O'Dea <bod@debian.org>
13
14 SHELL = /bin/bash
15 DPKG_EXPORT_BUILDFLAGS = 1
16
17 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
18
19 include /usr/share/dpkg/architecture.mk
20 include /usr/share/dpkg/buildflags.mk
21
22 ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
23  CONFARGS = --host=$(DEB_HOST_GNU_TYPE)
24 endif
25
26 build: build-arch build-indep
27 build-arch build-indep: build-stamp
28 build-stamp:
29         dh_testdir
30         dh_update_autotools_config  # Update config.guess, config.sub
31         ./configure --prefix=/usr --enable-nls --mandir='$${prefix}/share/man' \
32             --infodir='$${prefix}/share/info' $(CONFARGS)
33
34         $(MAKE)
35         $(MAKE) help2man.h2m # for examples
36         touch build-stamp
37
38 clean:
39         test README -nt help2man.PL # maintainer sanity check
40         dh_testdir
41         dh_testroot
42         [ ! -f Makefile ] || $(MAKE) distclean
43         rm -f build-stamp install-stamp
44         dh_clean
45
46 install: install-stamp
47 install-stamp: build-stamp
48         dh_testdir
49         dh_testroot
50         dh_prep
51         dh_installdirs
52         $(MAKE) install DESTDIR=$(CURDIR)/debian/help2man
53         touch install-stamp
54
55 # Build architecture-independent files here.
56 binary-arch: build install
57         dh_testdir
58         dh_testroot
59         dh_installdocs
60         dh_installinfo
61         dh_installexamples
62         dh_installchangelogs
63         dh_strip
64         dh_compress
65         dh_fixperms
66         dh_perl -V
67         dh_installdeb
68         dh_shlibdeps
69         dh_gencontrol
70         dh_md5sums
71         dh_builddeb
72
73 # Build architecture-dependent files here.
74 binary-indep: build install
75 # We have nothing to do by default.
76
77 source diff:
78         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
79
80 # maintainer pre-release setup
81 AM_DOC = COPYING INSTALL
82 AM_AUX = install-sh missing mkinstalldirs
83 AM_DIR = $(shell ls -d /usr/share/automake* 2>/dev/null | tail -1)
84 VERSION = $(shell ./help2man.PL --version)
85 maint-prep:
86         test -n $(AM_DIR)
87         test `dpkg-parsechangelog --show-field=Version` = $(VERSION)
88         cp $(addprefix $(AM_DIR)/,$(AM_DOC)) .
89         cp $(addprefix $(AM_DIR)/,$(AM_AUX)) build-aux
90         (echo "         README for GNU help2man version $(VERSION)"; \
91          echo; \
92          echo "help2man is a script to create simple man pages from the --help and"; \
93          echo "--version output of programs."; \
94          echo ""; \
95          echo "  http://www.gnu.org/software/help2man/"; \
96          echo "  ftp://ftp.gnu.org/gnu/help2man/help2man-$(VERSION).tar.xz"; \
97          echo ""; \
98          echo "  git://anonscm.debian.org/users/bod/help2man.git"; \
99          echo "  http://anonscm.debian.org/gitweb/?p=users/bod/help2man.git"; \
100          echo ""; \
101          echo "Since most GNU documentation is now in info format, this provides a"; \
102          echo "way to generate a placeholder man page pointing to that resource while"; \
103          echo "still providing some useful information."; \
104          echo ""; \
105          echo "-- "; \
106          echo "Brendan O'Dea <bod@debian.org>") >README
107         ln -sf debian/changelog ChangeLog
108         autoconf
109         ./configure
110         $(MAKE) update-po all distclean
111
112 maint-clean: maint-prep
113         ./configure
114         $(MAKE) maintainer-clean
115         rm -f README ChangeLog $(AM_DOC) $(addprefix build-aux/,$(AM_AUX))
116
117 binary: binary-indep binary-arch
118 .PHONY: build clean binary-indep binary-arch binary maint-prep maint-clean