summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--RPM4/MANIFEST1
-rw-r--r--RPM4/Makefile.PL6
-rw-r--r--RPM4/src/Makefile.PL27
3 files changed, 18 insertions, 16 deletions
diff --git a/RPM4/MANIFEST b/RPM4/MANIFEST
index a598f3f..8e6b79d 100644
--- a/RPM4/MANIFEST
+++ b/RPM4/MANIFEST
@@ -6,7 +6,6 @@ src/Makefile.PL
src/RPM4.h
src/RPM4.xs
src/RPM4sign.c
-src/constant.c
src/rpmconstant.c
src/rpmconstant.h
src/rpmconstant_internal.c
diff --git a/RPM4/Makefile.PL b/RPM4/Makefile.PL
index c36f295..34988e4 100644
--- a/RPM4/Makefile.PL
+++ b/RPM4/Makefile.PL
@@ -14,7 +14,10 @@ BARF
sub MY::postamble {
<<MAKECHANGELOG;
-.PHONY: ChangeLog
+.PHONY: ChangeLog copyrpmconstant
+
+copyrpmconstant:
+ make -C src copyrpmconstant
ChangeLog:
LC_ALL=C svn update && LC_ALL=C svn log --verbose > \$@
@@ -29,4 +32,5 @@ WriteMakefile(
VERSION_FROM => 'lib/RPM4.pm',
DIR => [ 'src' ],
'EXE_FILES' => [ qw(bin/rpm_produced bin/rpmresign bin/hrpmreb) ],
+ depend => { dist => 'copyrpmconstant' },
);
diff --git a/RPM4/src/Makefile.PL b/RPM4/src/Makefile.PL
index fe8fbc0..e01eade 100644
--- a/RPM4/src/Makefile.PL
+++ b/RPM4/src/Makefile.PL
@@ -32,6 +32,13 @@ print $FH "\n#endif\n";
close($FH);
if ($rebh) { exit 0 };
+my @rpmconstantfiles = qw(
+ rpmconstant.c
+ rpmconstant.h
+ rpmconstant_internal.c
+ rpmh2tbl
+ );
+
my ($obj, $ldd, $fl) =
-f '/usr/include/rpmconstant/rpmconstant.h' ?
('', '-lrpmconstant', '-DHAVE_RPMCONSTANT') :
@@ -44,26 +51,17 @@ rpmversion.h:
rpmconstanttbl.c: Makefile rpmh2tbl
perl rpmh2tbl /usr/include/rpm/*.h > \$@
+
RPMCONSTTBL
# This code is to reduce duplication of files
# in fact it is only usefull for the maintainers of this module
# if you get the module from CPAN, those files are allready here
# if you're building from svn, you need rpmconstant directory
- my $second = "";
+ my $second = "copyrpmconstant: " . join(" ", @rpmconstantfiles) ."\n\n";
if(-d '../../rpmconstant') {
- $second = <<RPMCONST
-rpmconstant.c: ../../rpmconstant/rpmconstant.c
- cp -a \$< \$@
-
-rpmconstant.h: ../../rpmconstant/rpmconstant.h
- cp -a \$< \$@
-
-rpmconstant_internal.c: ../../rpmconstant/rpmconstant_internal.c
- cp -a \$< \$@
-
-rpmh2tbl: ../../rpmconstant/rpmh2tbl
- cp -a \$< \$@
-RPMCONST
+ foreach (@rpmconstantfiles) {
+ $second .= "$_: ../../rpmconstant/$_\n\tcp -a \$< \$@\n\n";
+ }
}
$first . $second
@@ -76,4 +74,5 @@ WriteMakefile(
INC => '-I/usr/include/rpm',
LIBS => "-lrpm -lrpmio -lrpmdb -lrpmbuild -lpopt -lz -lbz2 $ldd",
'CCFLAGS' => $fl,
+ depend => { "RPM4.xs" => join(" ", @rpmconstantfiles) },
);