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
|
#!/usr/bin/make -f
## debian/rules to build the debian version of Term::ReadKey
## $Id:$
##
PWD := $(shell pwd)
ifndef PERL
PERL = /usr/bin/perl
endif
USRDIR = $(PWD)/debian/tmp/usr/lib/perl5
ARCHLIB := $(shell $(PERL) -MConfig -e 'print "$(PWD)/debian/tmp$$Config{installarchlib}"')
MAN3DIR = $(PWD)/debian/tmp/usr/man/man3
DOCDIR = $(PWD)/debian/tmp/usr/doc/libterm-readkey-perl
CFLAGS = '-O2 -g -Wall'
Makefile: Makefile.PL
$(PERL) Makefile.PL INSTALLDIRS=perl INSTALLPRIVLIB=$(USRDIR) INSTALLARCHLIB=$(ARCHLIB) INSTALLMAN3DIR=$(MAN3DIR)
build: Makefile
$(MAKE) all LDLOADLIBS=-lc LD_RUN_PATH="" CFLAG=$(CFLAGS)
touch build
binary-arch: build
-[ -d debian/tmp ] && rm -rf debian/tmp 2>/dev/null
install -d $(USRDIR)
$(MAKE) pure_install
-gzip -9rf $(MAN3DIR)
find debian/tmp -name '*.so' -print0 | xargs --null chmod a-x
find debian/tmp -name '*.so' -print0 | xargs --null strip --strip-unneeded
find debian/tmp -type f -name .packlist -print0 | xargs --null --no-run-if-empty rm -f
-find debian/tmp -type d -empty -print0 | xargs --null --no-run-if-empty rmdir -p --ignore-fail-on-non-empty
find debian/tmp \( -name '*.pm' -o '*.pl' \) -print0 | xargs --null --no-run-if-empty \
perl -i -pe '$$_ = "#!/usr/bin/perl$$1\n" if m|^#!.*/perl(.*)$$|;'
install -d $(DOCDIR)
perl -ne 'print if /\Q*****\E/ ... /\Q*****\E/' ReadKey.xs > $(DOCDIR)/changelog
cp debian/changelog $(DOCDIR)/changelog.Debian
cp README $(DOCDIR)
-gzip -9rf $(DOCDIR)
cp debian/copyright $(DOCDIR)/copyright
install -d debian/tmp/DEBIAN
dpkg-shlibdeps `find debian/tmp -name '*.so'`
perl -i -ne 'print unless /^perl/; printf "perl:Depends=perl-%.3f\n", $$] if eof;' debian/substvars
dpkg-gencontrol
-dh_md5sums
chown -R root:root debian/tmp
chmod -R go=rX,u+wX debian/tmp
dpkg --build debian/tmp ..
binary-indep: build
true
binary: binary-indep binary-arch
clean:
-$(MAKE) realclean
-rm -rf debian/tmp
-rm -f build debian/files debian/substvars *~ debian/*~ *.old *.bak
.PHONY: binary binary-arch binary-indep clean
|