File: rules

package info (click to toggle)
lintian 2.4.3%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 8,228 kB
  • ctags: 457
  • sloc: perl: 8,492; sh: 5,561; makefile: 1,971; ansic: 143; python: 19; tcl: 4; sed: 2
file content (91 lines) | stat: -rwxr-xr-x 2,864 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
#!/usr/bin/make -f

PERL ?= /usr/bin/perl

VER := $(shell head -1 debian/changelog | sed -e 's/^.*(//' -e 's/).*$$//')
tmp := $(CURDIR)/debian/lintian
neededfiles := debian/rules frontend/lintian
docsource := doc/lintian.sgml doc/README.in
allchecks := $(wildcard checks/*)
allcollect := $(wildcard collection/*)
tagfiles := $(wildcard testset/tags.* t/*/tags)
testfiles := $(wildcard t/tests/*.desc)
perlprovides := data/fields/perl-provides
onlyrun =
tag =

runtests: $(neededfiles) $(allchecks) $(allcollect) $(tagfiles) $(testfiles)
	@echo .... running tests ....
	rm -rf debian/tests
	mkdir debian/tests
	LINTIAN_ROOT="" $(PERL) t/runtests -k t debian/tests $(onlyrun)
	LINTIAN_ROOT="" $(PERL) testset/runtests -k testset debian/tests $(onlyrun)
	if [ "$(onlyrun)" = "" ]; then touch $@; fi

# Like runtests but only runs tests affecting a particular tag.  That tag
# should be specified by setting the tag makefile variable.
check-tag:
	@if [ "$(tag)" = "" ]; then \
		echo 'Specify tag to test with tag=<tag>'; exit 1; \
	fi
	rm -rf debian/tests
	mkdir debian/tests
	LINTIAN_ROOT="" $(PERL) t/runtests -k -t $(tag) t debian/tests

# this target is only run manually
refresh-perl-provides:
	perl private/refresh-perl-provides > $(perlprovides)

build: build-stamp
build-stamp: $(neededfiles) $(docsource)
	@echo .... running build ....
	dh_testdir
	cd doc && LANG=C debiandoc2html lintian.sgml
	cd doc && LANG=C debiandoc2text lintian.sgml
	LINTIAN_ROOT="" ./frontend/lintian --help \
		| tail -n +3 | $(PERL) -n -e 'print "  $$_"' >doc/help.tmp
	$(PERL) -p -e 'BEGIN { open HELP, "<", "doc/help.tmp" or die; local $$/ = undef; $$h = <HELP> }; s/%LINTIAN_HELP%/$$h/' doc/README.in >doc/README

	# 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(which needs the libapt-pkg-perl package)\n} . q{*}x60 . qq{\n}' $(perlprovides)

	touch $@

clean: $(neededfiles)
	@echo .... cleaning ....
	dh_testdir
	dh_testroot
	rm -f runtests build-stamp
	rm -f doc/help.tmp doc/README
	rm -rf doc/lintian.html/ doc/lintian.txt
	rm -rf debian/tests
	find -name "*.py?" -print0 | xargs -0r rm
	dh_clean -Xtestset/diffs/binary.c~

binary-indep: $(neededfiles) build
	@echo .... binary-indep ....
	dh_testdir
	dh_testroot
	dh_clean -k -Xtestset/diffs/binary.c~
	dh_installdirs

	dh_install
# some manual work
	sed -i 's/<VERSION>/$(VER)/' $(tmp)/usr/bin/lintian
	install -m 644 doc/lintianrc.example $(tmp)/etc/lintianrc
	dh_installdocs
	dh_installchangelogs
	dh_installman
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch:

binary:	binary-indep binary-arch

.PHONY: build binary binary-arch binary-indep clean refresh-perl-provides
.DELETE_ON_ERROR: runtests