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