File: rules

package info (click to toggle)
lintian 2.104.0
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 58,560 kB
  • sloc: perl: 36,857; javascript: 9,151; makefile: 3,888; sh: 3,204; ansic: 727; xml: 409; python: 65; java: 15; cpp: 9; tcl: 4; lisp: 3
file content (70 lines) | stat: -rwxr-xr-x 2,525 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
#!/usr/bin/make -f

PERL ?= /usr/bin/perl

VER := $(shell head -1 debian/changelog | sed -e 's/^.*(//' -e 's/).*$$//')
tmp := $(CURDIR)/debian/lintian
profiles := profiles/debian/main.profile \
	    profiles/debian/ftp-master-auto-reject.profile
pod2man := pod2man --center "Debian Package Checker" --release "Lintian v$(VER)"
pod2mansources := $(wildcard man/*.pod)
docsources := doc/lintian.rst README.md $(pod2mansources)
perlprovides := data/fields/perl-provides
autoreject_data := $(wildcard private/build-time-data/*)

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	jobs = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	PAR_ARGS=-j $(jobs)
endif

%:
	dh $@

override_dh_auto_build: generate-docs-stamp
# check that the static data about perl core modules is up to date
	$(PERL) -ne '/PERL_VERSION=(.+)/ and $$] > $$1 and warn q{*}x60 . qq{\n$(perlprovides) needs an update, please run\n  debian/rules refresh-perl-provides\n} . q{*}x60 . qq{\n}' $(perlprovides)

override_dh_clean:
	rm -rf $(CURDIR)/debian/test-out
	rm -rf doc/api.html doc/lintian.html
	rm -rf man/man1/ man/man3/ l10n/
	dh_clean

override_dh_install:
	dh_install
	echo "Setting LINTIAN_VERSION to $(VER)"
	$(PERL) -p -i -e 's/my \$$LINTIAN_VERSION;/my \$$LINTIAN_VERSION = q{$(VER)};/;' \
	    $(tmp)/usr/share/lintian/bin/*

profiles: $(profiles);

$(profiles): $(autoreject_data) private/generate-profiles
	private/generate-profiles

api-doc:
	private/generate-html-docs doc/api.html

.PHONY: generate-docs
generate-docs: generate-docs-stamp

generate-docs-stamp: $(docsources)
	dh_testdir
# A UTF-8 locale seemed appropriate; manual uses § character
	cd doc && LC_ALL=en_US.UTF-8 rst2html lintian.rst > lintian.html
	mkdir -p man/man1/ man/man3/
	$(pod2man) --name lintian --section=1 man/lintian.pod > man/man1/lintian.1
	set -e ; for POD in $(pod2mansources) ; do \
		BASENAME=$$(basename "$$POD" .pod) ; \
		$(pod2man) --section=1 "$$POD" > "man/man1/$$BASENAME".1 ; \
	done
	set -e ; for POD in $$(find doc/tutorial lib/Lintian lib/Test -type f '!' -path '*/Internal/*' '!' -path '*/Output/*' '!' -path '*/Tag/TextUtil.pm'  ) ; do \
		BASENAME=$$(echo "$$POD" | perl -pe 's@^(doc/tutorial|lib)/@@; s@/@::@g; s/\.(pod|pm)$$//') ; \
		$(pod2man) --name="$$BASENAME" --section=3 "$$POD" > "man/man3/$$BASENAME".3 ; \
	done
	private/generate-html-docs doc/api.html > /dev/null
	touch $@

# only used manually
.PHONY: refresh-perl-provides
refresh-perl-provides:
	perl private/refresh-perl-provides > $(perlprovides)