summaryrefslogtreecommitdiff
path: root/Makefile
blob: ffa4e6ba29ac8a68777d71c7740e91c2fdd70916 (plain)
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
BINDIR := $(DESTDIR)/usr/bin
MANDIR := $(DESTDIR)/usr/share/man
DATADIR := $(DESTDIR)/usr/share/pkg-kde-tools
DATALIBDIR := $(DATADIR)/lib
PERLLIBDIR := $(DESTDIR)/$(shell perl -MConfig -e 'print $$Config{vendorlib}')

VERBOSE ?= 0

BINARIES = \
	dh_movelibkdeinit \
	dh_sameversiondep \
	dh_sodeps \
	pkgkde-debs2symbols \
	pkgkde-gensymbols \
	pkgkde-getbuildlogs \
	pkgkde-override-sc-dev-latest \
	pkgkde-symbolshelper \
	pkgkde-vcs

MANPAGES_1 = \
	man1/pkgkde-vcs.1

PERLPODS_1 = \
	pkgkde-override-sc-dev-latest \
	dh_sameversiondep \
	dh_movelibkdeinit \
	dh_sodeps

build:
	# Nothing do build

install:
	install -d $(DATADIR) $(DATALIBDIR) $(BINDIR) $(MANDIR) $(MANDIR)/man1 $(PERLLIBDIR)
	
	pod2man pkgkde-override-sc-dev-latest > $(MANDIR)/man1/pkgkde-override-sc-dev-latest.1
	install -m 0755 pkgkde-override-sc-dev-latest $(BINDIR)
	
	# Install *lib directories
	install -d $(DATALIBDIR)
	cd datalib && find . -type f -exec install -D -m 0644 {} $(DATALIBDIR)/{} \;
	install -d $(PERLLIBDIR)
	cd perllib && find . -type f -name "*.pm" -exec install -D -m 0644 {} $(PERLLIBDIR)/{} \;
	install -d $(DATADIR)/vcs
	cd vcslib && find . -type f -exec install -D -m 0644 {} $(DATADIR)/vcs/{} \;
	
	# Install binaries
	install -d $(BINDIR)
	install -m 0755 $(BINARIES) $(BINDIR)
	
	# Install manual pages
	install -d $(MANDIR)/man1
	install -m 0644 $(MANPAGES_1) $(MANDIR)/man1
	
	# Install POD based manual packages
	for f in $(PERLPODS_1); do pod2man "$$f" > "$(MANDIR)/man1/$${f%.*}.1"; done
	
	# Make it possible to transparently replace dpkg-gensymbols with
	# pkgkde-gensymbols
	install -d $(DATADIR)/bin
	ln -sf /usr/bin/pkgkde-gensymbols $(DATADIR)/bin/dpkg-gensymbols
	ln -sf /usr/share/man/man1/dpkg-gensymbols.1.gz $(MANDIR)/man1/pkgkde-gensymbols.1.gz

test:
	./run-local perl -MTest::Harness -e '$$Test::Harness::verbose=$(VERBOSE); runtests @ARGV;' t/*.t