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
|
# $Id: Makefile.PL,v 1.10 2004/10/14 00:50:02 bod Exp $
use ExtUtils::MakeMaker;
my %changes = map /^([^:]*):\s+(.*)/, split /\n(?!\s)/, `dpkg-parsechangelog`;
WriteMakefile(
NAME => 'AptPkg',
VERSION_FROM => 'AptPkg.pm',
CC => 'c++',
LD => 'c++',
OBJECT => '$(O_FILES)',
LIBS => ['-lapt-pkg'],
XSOPT => '-C++',
depend => { Makefile => 'AptPkg.pm debian/changelog' }, # for VERSION
clean => { FILES => 't/cache/var/*.bin'
. " $changes{Source}-$changes{Version}"
. " $changes{Source}_$changes{Version}.*"
. " $changes{Source}_$changes{Version}_*" },
);
sub MY::postamble
{
<<EOT . <<'EOT';
DEBNAME = $changes{Source}
DEBVER = $changes{Version}
DPKG_BUILDPACKAGE_OPTS = -rfakeroot
EOT
deb:
$(RM_RF) $(DEBNAME)-$(DEBVER)
$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
-MExtUtils::Manifest=manicopy,maniread \
-e "manicopy(maniread(),'$(DEBNAME)-$(DEBVER)', '$(DIST_CP)');"
cd $(DEBNAME)-$(DEBVER); dpkg-buildpackage $(DPKG_BUILDPACKAGE_OPTS)
$(RM_RF) $(DEBNAME)-$(DEBVER)
EOT
}
|