File: Makefile.PL

package info (click to toggle)
libapt-pkg-perl 0.1.36
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 304 kB
  • sloc: perl: 1,233; ansic: 201; makefile: 41
file content (36 lines) | stat: -rw-r--r-- 1,003 bytes parent folder | download | duplicates (5)
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
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
}