~ubuntu-branches/ubuntu/utopic/debhelper/utopic-proposed

1.4.21 by Joey Hess, Joey Hess, Valery Perrin
[ Joey Hess ]
1
# List of files of dh_* commands. Sorted for debhelper man page.
1.4.57 by Joey Hess
* dh_shlibdeps: Warn if -V flag is passed, to avoid it accidentially being
2
COMMANDS=$(shell find . -maxdepth 1 -type f -perm /100 -name "dh_*" -printf "%f\n" | sort)
1.4.21 by Joey Hess, Joey Hess, Valery Perrin
[ Joey Hess ]
3
4
# Find deprecated commands by looking at their synopsis.
5
DEPRECATED=$(shell egrep -l '^dh_.* - .*deprecated' $(COMMANDS))
6
36 by Martin Pitt
* Merge with Debian unstable. Remaining Ubuntu changes:
7
# This generates a list of synopses of debhelper commands, and substitutes
8
# it in to the #LIST# line on the man page fed to it on stdin. Must be passed
9
# parameters of all the executables or pod files to get the synopses from.
10
# For correct conversion of pod tags (like S< >) #LIST# must be substituted in
11
# the pod file and not in the troff file.
12
MAKEMANLIST=perl -e ' \
13
		undef $$/; \
14
		foreach (@ARGV) { \
15
		        open (IN, $$_) or die "$$_: $$!"; \
16
		        $$file=<IN>; \
17
		        close IN; \
18
		        if ($$file=~m/=head1 .*?\n\n(.*?) - (.*?)\n\n/s) { \
1.4.3 by Joey Hess
* The makefile buildsystem (and derived buildsystems cmake, autoconf, etc)
19
				my $$item="=item $$1(1)\n\n$$2\n\n"; \
1.4.21 by Joey Hess, Joey Hess, Valery Perrin
[ Joey Hess ]
20
				if (" $(DEPRECATED) " !~ / $$1 /) { \
1.4.3 by Joey Hess
* The makefile buildsystem (and derived buildsystems cmake, autoconf, etc)
21
			                $$list.=$$item; \
22
				} \
23
				else { \
24
			                $$list_deprecated.=$$item; \
25
				} \
36 by Martin Pitt
* Merge with Debian unstable. Remaining Ubuntu changes:
26
		        } \
27
		} \
28
		END { \
29
			while (<STDIN>) { \
1.4.3 by Joey Hess
* The makefile buildsystem (and derived buildsystems cmake, autoconf, etc)
30
		        	s/\#LIST\#/$$list/; \
31
		        	s/\#LIST_DEPRECATED\#/$$list_deprecated/; \
36 by Martin Pitt
* Merge with Debian unstable. Remaining Ubuntu changes:
32
				print; \
33
			}; \
34
		}'
35
36
# Figure out the `current debhelper version.
37
VERSION=$(shell expr "`dpkg-parsechangelog |grep Version:`" : '.*Version: \(.*\)')
38
39
PERLLIBDIR=$(shell perl -MConfig -e 'print $$Config{vendorlib}')/Debian/Debhelper
40
1.4.57 by Joey Hess
* dh_shlibdeps: Warn if -V flag is passed, to avoid it accidentially being
41
PREFIX=/usr
42
1.1.7 by Joey Hess, Colin Watson, Joey Hess
[ Colin Watson ]
43
POD2MAN=pod2man --utf8 -c Debhelper -r "$(VERSION)"
36 by Martin Pitt
* Merge with Debian unstable. Remaining Ubuntu changes:
44
1.4.57 by Joey Hess
* dh_shlibdeps: Warn if -V flag is passed, to avoid it accidentially being
45
ifneq ($(USE_NLS),no)
36 by Martin Pitt
* Merge with Debian unstable. Remaining Ubuntu changes:
46
# l10n to be built is determined from .po files
1.4.57 by Joey Hess
* dh_shlibdeps: Warn if -V flag is passed, to avoid it accidentially being
47
LANGS?=$(notdir $(basename $(wildcard man/po4a/po/*.po)))
48
else
49
LANGS=
50
endif
36 by Martin Pitt
* Merge with Debian unstable. Remaining Ubuntu changes:
51
1.4.3 by Joey Hess
* The makefile buildsystem (and derived buildsystems cmake, autoconf, etc)
52
build: version debhelper.7
1.4.57 by Joey Hess
* dh_shlibdeps: Warn if -V flag is passed, to avoid it accidentially being
53
	find . -maxdepth 1 -type f -perm /100 -name "dh*" \
36 by Martin Pitt
* Merge with Debian unstable. Remaining Ubuntu changes:
54
		-exec $(POD2MAN) {} {}.1 \;
1.4.57 by Joey Hess
* dh_shlibdeps: Warn if -V flag is passed, to avoid it accidentially being
55
ifneq ($(USE_NLS),no)
1.4.2 by Joey Hess, Valery Perrin, Joey Hess
[ Valery Perrin ]
56
	po4a --previous -L UTF-8 man/po4a/po4a.cfg 
36 by Martin Pitt
* Merge with Debian unstable. Remaining Ubuntu changes:
57
	set -e; \
58
	for lang in $(LANGS); do \
59
		dir=man/$$lang; \
60
		for file in $$dir/dh*.pod; do \
61
			prog=`basename $$file | sed 's/.pod//'`; \
62
			$(POD2MAN) $$file $$prog.$$lang.1; \
63
		done; \
1.2.17 by Joey Hess
dh_install: Fix support for the case where --sourcedir=debian/tmp/foo
64
		if [ -e $$dir/debhelper.pod ]; then \
65
			cat $$dir/debhelper.pod | \
66
				$(MAKEMANLIST) `find $$dir -type f -maxdepth 1 -name "dh_*.pod" | sort` | \
67
				$(POD2MAN) --name="debhelper" --section=7 > debhelper.$$lang.7; \
68
		fi; \
36 by Martin Pitt
* Merge with Debian unstable. Remaining Ubuntu changes:
69
	done
1.4.57 by Joey Hess
* dh_shlibdeps: Warn if -V flag is passed, to avoid it accidentially being
70
endif
36 by Martin Pitt
* Merge with Debian unstable. Remaining Ubuntu changes:
71
72
version:
73
	printf "package Debian::Debhelper::Dh_Version;\n\$$version='$(VERSION)';\n1" > \
74
		Debian/Debhelper/Dh_Version.pm
75
1.4.3 by Joey Hess
* The makefile buildsystem (and derived buildsystems cmake, autoconf, etc)
76
debhelper.7: debhelper.pod
77
	cat debhelper.pod | \
1.4.21 by Joey Hess, Joey Hess, Valery Perrin
[ Joey Hess ]
78
		$(MAKEMANLIST) $(COMMANDS) | \
1.4.3 by Joey Hess
* The makefile buildsystem (and derived buildsystems cmake, autoconf, etc)
79
		$(POD2MAN) --name="debhelper" --section=7  > debhelper.7
80
36 by Martin Pitt
* Merge with Debian unstable. Remaining Ubuntu changes:
81
clean:
82
	rm -f *.1 *.7 Debian/Debhelper/Dh_Version.pm
1.4.62 by Joey Hess
* dh_installchangelogs: No longer automatically converts html changelogs.
83
ifneq ($(USE_NLS),no)
1.4.2 by Joey Hess, Valery Perrin, Joey Hess
[ Valery Perrin ]
84
	po4a --previous --rm-translations --rm-backups man/po4a/po4a.cfg
1.4.62 by Joey Hess
* dh_installchangelogs: No longer automatically converts html changelogs.
85
endif
36 by Martin Pitt
* Merge with Debian unstable. Remaining Ubuntu changes:
86
	for lang in $(LANGS); do \
87
		if [ -e man/$$lang ]; then rmdir man/$$lang; fi; \
88
	done;
89
90
install:
1.4.57 by Joey Hess
* dh_shlibdeps: Warn if -V flag is passed, to avoid it accidentially being
91
	install -d $(DESTDIR)$(PREFIX)/bin \
92
		$(DESTDIR)$(PREFIX)/share/debhelper/autoscripts \
1.3.1 by Joey Hess
* Add ant buildsystem support. Closes: #537021
93
		$(DESTDIR)$(PERLLIBDIR)/Sequence \
94
		$(DESTDIR)$(PERLLIBDIR)/Buildsystem
1.4.57 by Joey Hess
* dh_shlibdeps: Warn if -V flag is passed, to avoid it accidentially being
95
	install dh $(COMMANDS) $(DESTDIR)$(PREFIX)/bin
96
	install -m 0644 autoscripts/* $(DESTDIR)$(PREFIX)/share/debhelper/autoscripts
36 by Martin Pitt
* Merge with Debian unstable. Remaining Ubuntu changes:
97
	install -m 0644 Debian/Debhelper/*.pm $(DESTDIR)$(PERLLIBDIR)
1.4.57 by Joey Hess
* dh_shlibdeps: Warn if -V flag is passed, to avoid it accidentially being
98
	[ "$(PREFIX)" = /usr ] || \
99
		sed -i '/$$prefix=/s@/usr@$(PREFIX)@g' $(DESTDIR)$(PERLLIBDIR)/Dh_Lib.pm
37 by Martin Pitt
* Merge with Debian unstable. Remaining Ubuntu changes:
100
	install -m 0644 Debian/Debhelper/Sequence/*.pm $(DESTDIR)$(PERLLIBDIR)/Sequence
1.3.1 by Joey Hess
* Add ant buildsystem support. Closes: #537021
101
	install -m 0644 Debian/Debhelper/Buildsystem/*.pm $(DESTDIR)$(PERLLIBDIR)/Buildsystem
36 by Martin Pitt
* Merge with Debian unstable. Remaining Ubuntu changes:
102
103
test: version
1.3.1 by Joey Hess
* Add ant buildsystem support. Closes: #537021
104
	./run perl -MTest::Harness -e 'runtests grep { ! /CVS/ && ! /\.svn/ && -f && -x } @ARGV' t/* t/buildsystems/*
36 by Martin Pitt
* Merge with Debian unstable. Remaining Ubuntu changes:
105
	# clean up log etc
106
	./run dh_clean