MakeMaker file
authorrjray <devnull@localhost>
Mon, 22 May 2000 08:36:41 +0000 (08:36 +0000)
committerrjray <devnull@localhost>
Mon, 22 May 2000 08:36:41 +0000 (08:36 +0000)
CVS patchset: 3744
CVS date: 2000/05/22 08:36:41

Perl-RPM/Makefile.PL [new file with mode: 0644]

diff --git a/Perl-RPM/Makefile.PL b/Perl-RPM/Makefile.PL
new file mode 100644 (file)
index 0000000..b99caa0
--- /dev/null
@@ -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),
+         '');
+}