File: rules

package info (click to toggle)
man-db 2.4.2-21sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,964 kB
  • ctags: 2,396
  • sloc: ansic: 19,877; sh: 3,674; lex: 1,131; makefile: 828; yacc: 316; perl: 70; sed: 16
file content (123 lines) | stat: -rwxr-xr-x 3,618 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#! /usr/bin/make -f

# The name of the package
package = man-db
dtmp    = debian/$(package)

export DH_COMPAT=3

ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS = -O2 -g -Wall
LDFLAGS = -g
else
CFLAGS = -g -Wall
LDFLAGS = -g
endif

DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
CONFARGS = --host=$(DEB_HOST_GNU_TYPE)
endif

ifeq (,$(wildcard /usr/bin/po2debconf))
PO2DEBCONF := no
MINDEBCONFVER := 0.5
else
PO2DEBCONF := yes
MINDEBCONFVER := 1.2.0
endif

GNUmakefile:
# create the makefile needed both from build and clean rules
	touch configure stamp-h.in	# avoid autoconf build-dependency
	test -x configure || chmod +x configure 
	./configure --prefix=/usr --enable-setuid --with-db=gdbm \
	            --enable-undoc='man 7 undocumented' \
	            --with-device=latin1 --enable-mb-groff \
	            --with-config-file=/etc/manpath.config $(CONFARGS)

build: build-stamp
build-stamp: GNUmakefile
# Builds the binary package.
	dh_testdir
	$(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
	$(MAKE) -C manual SOELIM=../zsoelim/zsoelim
	touch build-stamp

clean:
	dh_testdir
	touch configure stamp-h.in	# avoid autoconf build-dependency
	-$(MAKE) -i distclean
	-$(MAKE) -C manual -i distclean
	-rm -f build-stamp install-stamp man/index.*
	-rm -f */*.i
ifeq ($(PO2DEBCONF),yes)
	# Compatibility with woody.
	echo 1 > debian/po/output
	po2debconf debian/templates.master > debian/templates
	rm -f debian/po/output
endif
	dh_clean
	-cd po && rm -f stamp-cat-id cat-id-tbl.c

install: install-stamp
install-stamp: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	$(MAKE) install DESTDIR=$(CURDIR)/$(dtmp)
	# Debian man-db used to put potentially setuid executables in a
	# private directory in order to do wrapper magic. The wrapper isn't
	# used any more, but migration is complicated enough that these stay
	# in /usr/lib/man-db (for now).
	mv $(dtmp)/usr/bin/man			$(dtmp)/usr/lib/man-db/man
	mv $(dtmp)/usr/bin/mandb		$(dtmp)/usr/lib/man-db/mandb
	install -m755 tools/chconfig		$(dtmp)/usr/share/$(package)
	# now do manual changes needed by debian
	# change locale names
	mv $(dtmp)/usr/share/man/de_DE.88591	$(dtmp)/usr/share/man/de
	mv $(dtmp)/usr/share/man/es_ES.88591	$(dtmp)/usr/share/man/es
	mv $(dtmp)/usr/share/man/it_IT.88591	$(dtmp)/usr/share/man/it
	mv $(dtmp)/usr/share/man/ja_JP.eucJP	$(dtmp)/usr/share/man/ja
	rm -rf $(dtmp)/usr/share/man/de_DE.ascii
	touch install-stamp

binary-indep: build install

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	install -m644 manual/man_db.cat \
		$(dtmp)/usr/share/doc/man-db/man-db-manual.txt
	install -m644 manual/man_db.dvi \
		$(dtmp)/usr/share/doc/man-db/man-db-manual.dvi
	install -m644 manual/man_db.ps \
		$(dtmp)/usr/share/doc/man-db/man-db-manual.ps
	dh_installexamples docs/manpage.example*
	install -m644 $(dtmp)/etc/manpath.config \
		$(dtmp)/usr/share/doc/$(package)/examples/manpath.config
	install -m644 debian/bug.presubj \
		$(dtmp)/usr/share/bug/man-db/presubj
	dh_installchangelogs docs/ChangeLog
	dh_installcron
ifeq ($(PO2DEBCONF),yes)
	po2debconf -e utf8 debian/templates.master > debian/templates
endif
	dh_installdebconf
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	chown man:root $(dtmp)/var/cache/man
	chmod 2755     $(dtmp)/var/cache/man
	dh_shlibdeps
	dh_gencontrol -- -V'debconf-depends=debconf (>= $(MINDEBCONFVER))'
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

.PHONY: build clean install binary binary-arch binary-indep