diff options
author | rjray <devnull@localhost> | 2000-05-22 08:36:41 +0000 |
---|---|---|
committer | rjray <devnull@localhost> | 2000-05-22 08:36:41 +0000 |
commit | c1b186dee0b9d32be73df3e9f2bd114189f43daa (patch) | |
tree | a3d6e327c58444813489123077c9122b687be043 | |
parent | df654c37b83e0346bab0aec4d4235bdd17d70234 (diff) | |
download | librpm-tizen-c1b186dee0b9d32be73df3e9f2bd114189f43daa.tar.gz librpm-tizen-c1b186dee0b9d32be73df3e9f2bd114189f43daa.tar.bz2 librpm-tizen-c1b186dee0b9d32be73df3e9f2bd114189f43daa.zip |
MakeMaker file
CVS patchset: 3744
CVS date: 2000/05/22 08:36:41
-rw-r--r-- | Perl-RPM/Makefile.PL | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/Perl-RPM/Makefile.PL b/Perl-RPM/Makefile.PL new file mode 100644 index 000000000..b99caa0e2 --- /dev/null +++ b/Perl-RPM/Makefile.PL @@ -0,0 +1,64 @@ +use ExtUtils::MakeMaker; + +%XS = qw( + RPM.xs RPM.c + Constants/Constants.xs Constants/Constants.c + Database/Database.xs Database/Database.c + Header/Header.xs Header/Header.c + ); + +@OBJECT = values %XS; +for (@OBJECT) +{ + s/\.c\b/\$(OBJ_EXT)/g; +} +$OBJECT = join(' ', @OBJECT); + +@DIRS = qw(Constants Header Database); + +%PM = map { ($from = $_) =~ s/xs$/pm/; + ($to = $from) =~ s|.*?/|RPM/|; + ($from, "\$(INST_LIBDIR)/$to"); } (sort keys %XS); + +# Make symlinks for typemap in the sub-dirs +for (@DIRS) +{ + symlink '../typemap', "$_/typemap"; +} + +# Cruft that MakeMaker wouldn't inherently know about +$CLEAN = join(' ', map { "$_/typemap" } @DIRS) . " $OBJECT"; +$CLEAN .= ' pod2html-* */pod2html-* *.html */*.html'; + +WriteMakefile( + NAME => 'RPM', + DISTNAME => 'Perl-RPM', + VERSION_FROM => 'RPM.pm', + LIBS => '-lrpm -lpopt', + DEFINE => '', + XS => \%XS, + PM => \%PM, + OBJECT => $OBJECT, + INC => '-I/usr/include/rpm', + dist => { COMPRESS => 'gzip -9f' }, + clean => { FILES => $CLEAN }, + #realclean => { FILES => $CLEAN }, + ); + +sub MY::c_o +{ + package MY; # so that "SUPER" works right + + my $text = shift->SUPER::c_o(@_); + $text =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a "`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/m; + + $text; +} + +sub MY::postamble +{ + join("\n", + '', + (map { "$_: RPM.h\n" } @OBJECT), + ''); +} |