File: rules

package info (click to toggle)
lintian 2.128.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 70,396 kB
  • sloc: perl: 46,006; javascript: 9,151; makefile: 4,054; sh: 3,044; ansic: 705; xml: 451; python: 91; java: 15; cpp: 9; tcl: 4; lisp: 3
file content (75 lines) | stat: -rwxr-xr-x 2,666 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

PERL ?= /usr/bin/perl

VER := $(shell head -1 debian/changelog | sed -e 's/^.*(//' -e 's/).*$$//')
tmp := $(CURDIR)/debian/lintian
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

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

# export DH_VERBOSE=1

%:
	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_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	private/runtests
endif

execute_after_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/*

execute_after_dh_installdocs:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	bin/lintian-explain-tags --format=json > lintian-tags.json
	lintian-ssg --output-dir=lintian-ssg --tags-file=lintian-tags.json \
	    --lintian-version=$(VER) --base-url=https://lintian.debian.org \
	    --manual-file=doc/lintian.html --stats
	mv lintian-ssg debian/lintian-doc/usr/share/doc/lintian-doc/html
endif

override_dh_compress:
	dh_compress -Xfavicon.ico

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=C.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 '*/Output/*' '!' -path '*/Check/*' '!' -path '*/Screen/*' ) ; 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)