summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--RPM4/NEWS1
-rw-r--r--RPM4/src/Makefile.PL5
-rw-r--r--RPM4/src/RPM4.xs2
3 files changed, 7 insertions, 1 deletions
diff --git a/RPM4/NEWS b/RPM4/NEWS
index af04f91..176bd43 100644
--- a/RPM4/NEWS
+++ b/RPM4/NEWS
@@ -1,5 +1,6 @@
- cpan testers:
o detect rpm-4.1[0-2] which had another rpmPkgSign API
+ o detect patched rpm-4.12 in Mageia 5, various Debian & FC
o list dependancies
o skip a test with rpm-4.1[12] due to a segfault
o use PkgConfig in order to find rpm
diff --git a/RPM4/src/Makefile.PL b/RPM4/src/Makefile.PL
index 58457da..78a2c59 100644
--- a/RPM4/src/Makefile.PL
+++ b/RPM4/src/Makefile.PL
@@ -50,6 +50,11 @@ foreach (qw(
print $FH "#define RPM$v\n";
$rpmv =~ /^\Q$_/ and last;
}
+# Special case for patched rpm-4.12 in Mageia 5 & Fedora, 4.11 & 4.12 in Debian:
+sub cat_ { my @l = map { my $F; open($F, '<', $_) ? <$F> : () } @_; wantarray() ? @l : join '', @l }
+if (grep { /int rpmPkgSign.*rpmSignArgs/ } cat_("$rpmheaderlocation/rpmsign.h")) {
+ print $FH "#define PATCHED_rpmPkgSign\n";
+}
print $FH "\n#endif\n";
close($FH);
exit 0 if $rebh;
diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs
index bef3981..5e16773 100644
--- a/RPM4/src/RPM4.xs
+++ b/RPM4/src/RPM4.xs
@@ -471,7 +471,7 @@ int _headername_vs_dep(Header h, rpmds dep, int nopromote) {
/* Hight level function */
int rpmsign(char *passphrase, const char *rpm) {
-#ifdef RPM4_12_90
+#if defined(RPM4_12_90) | defined(PATCHED_rpmPkgSign)
return rpmPkgSign(rpm, NULL);
#else
return rpmPkgSign(rpm, NULL, passphrase);