File: rules

package info (click to toggle)
libnet-perl 1.0502-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 284 kB
  • ctags: 418
  • sloc: perl: 3,705; makefile: 43; sh: 4
file content (57 lines) | stat: -rwxr-xr-x 1,392 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
#!/usr/bin/make -f

tempdir=$(shell pwd)/debian/tmp/libnet-perl

insdirs=$(tempdir)/DEBIAN \
	$(tempdir)/usr/doc/libnet-perl \
	$(tempdir)/usr/sbin

build: debian/rules
	touch Net/Config.pm
	perl Makefile.PL INSTALLDIRS=perl
	$(MAKE) all
	touch build

binary: binary-indep binary-arch

binary-indep: checkroot build $(insdirs)
	$(MAKE) PREFIX=$(tempdir)/usr INSTALLMAN3DIR=$(tempdir)/usr/man/man3 pure_install
	# Remove bogus architecture dependence
	rm -rf $(tempdir)/usr/lib/perl5/alpha-linux
	# Remove bogus configuration
	rm -f $(tempdir)/usr/lib/perl5/Net/Config.pm
	install -m 644 debian/copyright $(tempdir)/usr/doc/libnet-perl/copyright
	install -m 755 Configure $(tempdir)/usr/lib/perl5/Net
	install -m 755 debian/libnet-perl-config $(tempdir)/usr/sbin
	install -m 755 debian/postinst $(tempdir)/DEBIAN
	dpkg-gencontrol -P$(tempdir)
	chown -R root.root $(tempdir)
	chmod -R g-ws $(tempdir)
	dpkg --build $(tempdir) ..

binary-arch: checkroot build $(insdirs)

clean: zapdir
	if [ -e Makefile ]; then \
		$(MAKE) distclean; \
	fi
	for f in build debian/files Net/Config.pm; do \
		if [ -e $$f ]; then \
			rm -f $$f; \
		fi; \
	done
	find -name "*~" | xargs -r rm -f

checkroot: debian/rules
	test root = "`whoami`"

zapdir: debian/rules
	if [ -e $(tempdir) ]; then \
		rm -rf $(tempdir); \
	fi;

$(insdirs): zapdir
	install -d -m 755 $@
	chmod g-s $@

.PHONY: binary clean checkroot