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