File: rules

package info (click to toggle)
sdf 2.001-9
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 856 kB
  • ctags: 15
  • sloc: makefile: 134; perl: 74; sh: 10
file content (75 lines) | stat: -rwxr-xr-x 2,113 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
#!/usr/bin/make -f

# the dbs rules
TAR_DIR := sdf-2.001
include debian/scripts/dbs-build.mk

dtmp := $(CURDIR)/debian/sdf
mantmp := $(CURDIR)/debian/manpages-tmp
SDFHOME := $(dtmp)/usr/share/perl5

AUTO_MAN := fm2ps prn2ps sdf sdfapi sdfbatch sdfcli sdfget sdngen

build: $(STAMP_DIR)/build-stamp
$(STAMP_DIR)/build-stamp: $(patched)
	dh_testdir
	cd $(BUILD_TREE) && perl Makefile.PL INSTALLDIRS=vendor && $(MAKE)
	touch $(STAMP_DIR)/build-stamp

clean:
	dh_testdir
	rm -rf $(STAMP_DIR) $(SOURCE_DIR) $(mantmp)
	perl debian/scripts/dh_split clean
	dh_clean

# Build architecture-independent files here.
binary-indep: build $(dh_mak_deps)
	dh_testdir -i
	dh_testroot -i
	dh_clean -i -k
	dh_installdirs -i

	$(MAKE) -C $(BUILD_TREE) install PREFIX=$(dtmp)/usr
	find $(dtmp) -name .packlist -o -name perllocal.pod | xargs rm -f
	[ ! -d $(dtmp)/usr/lib/perl5 ] || \
		rmdir -p --ignore-fail-on-non-empty $(dtmp)/usr/lib/perl5

	chmod -x `find $(dtmp)/usr/share/perl5/sdf -type f`

	mkdir -p $(dtmp)/etc
	mv $(dtmp)/usr/share/perl5/sdf/home/sdf.ini $(dtmp)/etc
	# Evil hack. When building man pages just below, sdf needs to be
	# able to find sdf.ini in the temporary tree using this symlink.
	ln -s ../../../../../etc/sdf.ini \
	      $(dtmp)/usr/share/perl5/sdf/home/sdf.ini

	mkdir -p $(mantmp)
	for x in $(AUTO_MAN); do \
		(cd $(SDFHOME)/sdf/home; \
		 PATH=$(dtmp)/usr/bin:$$PATH PERL5LIB=$(SDFHOME) \
			$(dtmp)/usr/bin/sdf \
				-2pod -DMAN_CONVENTIONS -O$(mantmp) -g -csdf \
				$(dtmp)/usr/bin/$$x); \
		pod2man $(mantmp)/$$x.pod > \
			$(dtmp)/usr/share/man/man1/$$x.1; \
	done

	# Undo the symlink hack above.
	rm -f $(dtmp)/usr/share/perl5/sdf/home/sdf.ini
	ln -s /etc/sdf.ini $(dtmp)/usr/share/perl5/sdf/home/sdf.ini

	dh_installexamples -psdf-doc $(BUILD_TREE)/examples/*/stylesheets
	dh_installdocs -i $(BUILD_TREE)/README
	dh_installdocs -psdf-doc $(BUILD_TREE)/doc/*
	dh_installchangelogs -i
	dh_compress -i -X.html
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch:

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary