Author: lkundrak Update of /cvs/pkgs/rpms/perl-RPM2/devel In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv4195 Added Files: perl-RPM2-0.66-remove-rpmdb-redhat-dependency.patch perl-RPM2-0.66-skip-root-tests.patch perl-RPM2-0.67-inttypes.patch perl-RPM2-0.67-rpm46.patch perl-RPM2-elf.patch perl-RPM2.spec Removed Files: dead.package Log Message: Re-add perl-RPM2; port it to RPM4 perl-RPM2-0.66-remove-rpmdb-redhat-dependency.patch: Index: perl-RPM2-0.66-remove-rpmdb-redhat-dependency.patch =================================================================== RCS file: perl-RPM2-0.66-remove-rpmdb-redhat-dependency.patch diff -N perl-RPM2-0.66-remove-rpmdb-redhat-dependency.patch --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ perl-RPM2-0.66-remove-rpmdb-redhat-dependency.patch 12 Dec 2008 00:26:13 -0000 1.3 @@ -0,0 +1,31 @@ +--- RPM2-0.66/test.pl.remove_rpmdb_fedora_dependency 2004-04-14 08:43:58.000000000 -0400 ++++ RPM2-0.66/test.pl 2006-03-16 15:57:13.000000000 -0500 +@@ -13,6 +13,7 @@ + use strict; + BEGIN { plan tests => 63 }; + use RPM2; ++use POSIX; + ok(1); # If we made it this far, we're ok. + + ######################### +@@ -106,9 +107,10 @@ + ok(($pkg <=> $pkg2) == 0); + ok(!($pkg < $pkg2)); + ok(!($pkg > $pkg2)); +- ++my $other_rpm_dir = getcwd() . '/rpmdb'; + # another rpm, handily provided by the rpmdb-redhat package +-my $other_rpm_dir = "/usr/lib/rpmdb/i386-redhat-linux/redhat"; ++# ... is no longer shipped. Create a new one: ++system( "rm -rf rpmdb; mkdir rpmdb; /usr/bin/rpmdb --dbpath $other_rpm_dir --initdb" ); + if (-d $other_rpm_dir) { + my $db2 = RPM2->open_rpm_db(-path => $other_rpm_dir); + ok(defined $db2); +@@ -118,7 +120,6 @@ + print "Install the rpmdb-redhat package to test two simultaneous open databases\n"; + ok(1); + } +- + ok(RPM2->expand_macro("%%foo") eq "%foo"); + RPM2->add_macro("rpm2_test_macro", "testval $$"); + ok(RPM2->expand_macro("%rpm2_test_macro") eq "testval $$"); perl-RPM2-0.66-skip-root-tests.patch: Index: perl-RPM2-0.66-skip-root-tests.patch =================================================================== RCS file: perl-RPM2-0.66-skip-root-tests.patch diff -N perl-RPM2-0.66-skip-root-tests.patch --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ perl-RPM2-0.66-skip-root-tests.patch 12 Dec 2008 00:26:13 -0000 1.3 @@ -0,0 +1,45 @@ +--- RPM2-0.66/test.pl.skip-root-tests 2006-03-16 16:01:32.000000000 -0500 ++++ RPM2-0.66/test.pl 2006-03-16 16:15:41.000000000 -0500 +@@ -153,11 +153,8 @@ + my @rpms = $t->elements(); + ok($rpms[0] eq $pkg->as_nvre()); + ok(scalar(@rpms) == 1); +-# Install package +-ok($t->run()); ++skip( ( $< == 0 ) ? undef : ': must be root to create RPM transaction.', ( $< == 0 ) ? $t->run() : undef ); + $t = undef; +- +-# + # See if we can find the rpm in the database now... + $db = RPM2->open_rpm_db(); + ok(defined $db); +@@ -167,7 +164,7 @@ + while (my $pkg = $i->next) { + push @pkg, $pkg; + } +-ok(scalar(@pkg) == 1); ++skip( ( $< == 0 ) ? undef : ': package not added as not root.', ( $< == 0 ) ? scalar(@pkg) == 1 : undef ); + $i = undef; + $db = undef; + +@@ -176,9 +173,9 @@ + $t = RPM2->create_transaction(); + ok(ref($t) eq 'RPM2::Transaction'); + # We need to find the package we installed, and try to erase it +-ok($t->add_erase($pkg[0])); ++skip( ( $< == 0 ) ? undef : ': package not erased as not root.', ( $< == 0 ) ? $t->add_erase($pkg[0]) : undef ); + # Check element count +-ok($t->element_count() == 1); ++skip( ( $< == 0 ) ? undef : ': no transaction as not root.', ( $< == 0 ) ? ($t->element_count() == 1) : undef ); + # Test depedency checks + ok($t->check()); + # Order the transaction...see if we get our one transaction. +@@ -187,7 +184,7 @@ + ok($rpms[0] eq $pkg->as_nvre()); + ok(scalar(@rpms) == 1); + # Install package +-ok($t->run()); ++skip( ( $< == 0 ) ? undef : ': cannot run RPM transaction as not root.', ( $< == 0 ) ? $t->run() : undef ); + # Test closing the database + ok($t->close_db()); + perl-RPM2-0.67-inttypes.patch: Index: perl-RPM2-0.67-inttypes.patch =================================================================== RCS file: perl-RPM2-0.67-inttypes.patch diff -N perl-RPM2-0.67-inttypes.patch --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ perl-RPM2-0.67-inttypes.patch 12 Dec 2008 00:26:13 -0000 1.4 @@ -0,0 +1,61 @@ +Return correct values for RPM_INT{8,16} types (FILEMODES, etc.). + -- Lubomir Kundrak <lkundrak@xxxxxxxxxx> +http://rt.cpan.org/Public/Bug/Display.html?id=34739 + +diff -urp RPM2-0.67/RPM2.xs RPM2-0.67.inttypes/RPM2.xs +--- RPM2-0.67/RPM2.xs 2003-12-09 17:55:56.000000000 +0100 ++++ RPM2-0.67.inttypes/RPM2.xs 2007-10-26 19:01:55.000000000 +0200 +@@ -432,15 +432,51 @@ tag_by_id(h, tag) + PUSHs(sv_2mortal(newSVpv((char *)ret, 0))); + break; + case RPM_CHAR_TYPE: ++ { ++ int i; ++ char *r; ++ ++ EXTEND(SP, n); ++ r = (char *)ret; ++ ++ for (i = 0; i < n; i++) { ++ PUSHs(sv_2mortal(newSViv(r[i]))); ++ } ++ } ++ break; + case RPM_INT8_TYPE: ++ { ++ int i; ++ uint8_t *r; ++ ++ EXTEND(SP, n); ++ r = (uint8_t *)ret; ++ ++ for (i = 0; i < n; i++) { ++ PUSHs(sv_2mortal(newSViv(r[i]))); ++ } ++ } ++ break; + case RPM_INT16_TYPE: ++ { ++ int i; ++ uint16_t *r; ++ ++ EXTEND(SP, n); ++ r = (uint16_t *)ret; ++ ++ for (i = 0; i < n; i++) { ++ PUSHs(sv_2mortal(newSViv(r[i]))); ++ } ++ } ++ break; + case RPM_INT32_TYPE: + { + int i; +- int *r; ++ uint32_t *r; + + EXTEND(SP, n); +- r = (int *)ret; ++ r = (uint32_t *)ret; + + for (i = 0; i < n; i++) { + PUSHs(sv_2mortal(newSViv(r[i]))); perl-RPM2-0.67-rpm46.patch: --- NEW FILE perl-RPM2-0.67-rpm46.patch --- Port of RPM2 perl module to RPM 4.6. Two deprecated functions remain, all tests pass. Lubomir Rintel <lkundrak@xxxxx> diff -up RPM2-0.67/Makefile.PL.rpm46 RPM2-0.67/Makefile.PL --- RPM2-0.67/Makefile.PL.rpm46 2008-12-12 01:07:41.000000000 +0100 +++ RPM2-0.67/Makefile.PL 2008-12-12 01:07:41.000000000 +0100 @@ -27,7 +27,13 @@ $libs .= " -lelf"; my @defines; # detect which rpm is running. ugly but necessary... for now. -if (-e '/usr/include/rpm/rpmts.h') { +# ^^^ (Poor you, if only you knew I'll make it much worse -- lkundrak) +if (`pkg-config rpm --modversion` =~ /^(\d+)\.(\d+).*/) { + my ($major, $minor) = ($1, $2); + ($major, $minor) = (4,6) if $major >= 4 and $minor > 6; + push @defines, "-DRPM2_RPM$major$minor"; +} +elsif (-e '/usr/include/rpm/rpmts.h') { push @defines, '-DRPM2_RPM41'; } else { diff -up RPM2-0.67/README.rpm46 RPM2-0.67/README --- RPM2-0.67/README.rpm46 2006-09-24 19:20:03.000000000 +0200 +++ RPM2-0.67/README 2008-12-12 01:07:41.000000000 +0100 @@ -21,4 +21,4 @@ This module requires these other modules COPYRIGHT AND LICENCE Copyright (C) 2006 Chip Turner - +Copyright (C) 2008 Lubomir Rintel diff -up RPM2-0.67/RPM2.pm.rpm46 RPM2-0.67/RPM2.pm --- RPM2-0.67/RPM2.pm.rpm46 2006-09-24 19:23:15.000000000 +0200 +++ RPM2-0.67/RPM2.pm 2008-12-12 01:07:41.000000000 +0100 @@ -795,6 +795,7 @@ Initial release =head1 AUTHOR Chip Turner E<lt>cturner@xxxxxxxxxxx<gt> +Lubomir Rintel E<lt>lkundrak@xxxxx<gt> =head1 LICENSE diff -up RPM2-0.67/RPM2.xs.rpm46 RPM2-0.67/RPM2.xs --- RPM2-0.67/RPM2.xs.rpm46 2008-12-12 01:07:41.000000000 +0100 +++ RPM2-0.67/RPM2.xs 2008-12-12 01:07:41.000000000 +0100 @@ -2,21 +2,26 @@ #include "rpmlib.h" #include "rpmcli.h" -#ifdef RPM2_RPM41 +#ifndef RPM2_RPM40 #include "rpmts.h" #include "rpmte.h" #endif #include "header.h" #include "rpmdb.h" +#if defined(RPM2_RPM40) || defined(RPM2_RPM41) #include "misc.h" +#else +#define _RPM_4_4_COMPAT +#include "rpmlegacy.h" +#endif #include "EXTERN.h" #include "perl.h" #include "XSUB.h" -#if !defined(RPM2_RPM41) && !defined(RPM2_RPM40) -#error Must define one of RPM2_RPM41 or RPM2_RPM40; perhaps Makefile.PL could not guess your RPM API version? +#if !defined(RPM2_RPM41) && !defined(RPM2_RPM40) && !defined(RPM2_RPM46) +#error Seems like Makefile.PL could not guess your RPM API version. #endif /* Chip, this is somewhat stripped down from the default callback used by @@ -29,9 +34,14 @@ */ void * _null_callback( const void * arg, - const rpmCallbackType what, + const rpmCallbackType what, +#if defined(RPM2_RPM40) || defined(RPM2_RPM41) const unsigned long amount, - const unsigned long total, + const unsigned long total, +#else + const rpm_loff_t amount, + const rpm_loff_t total, +#endif fnpyKey key, rpmCallbackData data) { @@ -129,11 +139,23 @@ void * _null_callback( void _populate_header_tags(HV *href) { +#if defined(RPM2_RPM40) || defined(RPM2_RPM41) int i = 0; for (i = 0; i < rpmTagTableSize; i++) { hv_store(href, rpmTagTable[i].name, strlen(rpmTagTable[i].name), newSViv(rpmTagTable[i].val), 0); +#else + rpmtd names; + const char *name; + + names = rpmtdNew(); + rpmTagGetNames(names, 1); + while ((name = rpmtdNextString(names)) != NULL) { + const char *sname = name + strlen("RPMTAG_"); + hv_store(href, name, strlen(name), + newSViv(rpmTagGetValue(name + strlen("RPMTAG_"))), 0); } +#endif } void @@ -158,7 +180,7 @@ BOOT: constants = perl_get_hv("RPM2::constants", TRUE); /* not the 'standard' way of doing perl constants, but a lot easier to maintain */ -#ifdef RPM2_RPM41 +#ifndef RPM2_RPM40 REGISTER_CONSTANT(RPMVSF_DEFAULT); REGISTER_CONSTANT(RPMVSF_NOHDRCHK); REGISTER_CONSTANT(RPMVSF_NEEDPAYLOAD); @@ -183,10 +205,13 @@ double rpm_api_version(pkg) char * pkg CODE: -#if defined(RPM2_RPM41) && ! defined(RPM2_RPM40) +#ifdef RPM2_RPM46 + RETVAL = (double)4.6; +#endif +#ifdef RPM2_RPM41 RETVAL = (double)4.1; #endif -#if ! defined(RPM2_RPM41) && defined(RPM2_RPM40) +#ifdef RPM2_RPM40 RETVAL = (double)4.0; #endif OUTPUT: @@ -229,7 +254,7 @@ _read_package_info(fp, vsflags) FILE *fp int vsflags PREINIT: -#ifdef RPM2_RPM41 +#ifndef RPM2_RPM40 rpmts ts; #endif Header ret; @@ -237,7 +262,7 @@ _read_package_info(fp, vsflags) rpmRC rc; FD_t fd; PPCODE: -#ifdef RPM2_RPM41 +#ifndef RPM2_RPM40 ts = rpmtsCreate(); #endif @@ -249,7 +274,7 @@ _read_package_info(fp, vsflags) */ fd = fdDup(fileno(fp)); -#ifdef RPM2_RPM41 +#ifndef RPM2_RPM40 rpmtsSetVSFlags(ts, vsflags); rc = rpmReadPackageFile(ts, fd, "filename or other identifier", &ret); #else @@ -271,7 +296,7 @@ _read_package_info(fp, vsflags) else { croak("error reading package"); } -#ifdef RPM2_RPM41 +#ifndef RPM2_RPM40 ts = rpmtsFree(ts); #endif @@ -355,6 +380,11 @@ _init_iterator(db, rpmtag, key, len) char *key size_t len CODE: + /* See rpmdbInitIterator() code for explanation of this */ + if (rpmtag == RPMDBI_PACKAGES) { + len = sizeof (key); + } + RETVAL = rpmdbInitIterator(db, rpmtag, key && *key ? key : NULL, len); OUTPUT: RETVAL @@ -403,7 +433,11 @@ tag_by_id(h, tag) int tag PREINIT: void *ret = NULL; +#if defined(RPM2_RPM40) || defined(RPM2_RPM41) int type; +#else + rpmTagType type; +#endif int n; int ok; PPCODE: @@ -513,9 +547,18 @@ _header_sprintf(h, format) PREINIT: char * s; PPCODE: +#if defined(RPM2_RPM40) || defined(RPM2_RPM41) s = headerSprintf(h, format, rpmTagTable, rpmHeaderFormats, NULL); +#else + s = headerFormat(h, format, NULL); +#endif PUSHs(sv_2mortal(newSVpv((char *)s, 0))); +/* By the way, the #if below is completely useless, free() would work for both */ +#if defined(RPM2_RPM40) || defined(RPM2_RPM41) s = _free(s); +#else + free(s); +#endif MODULE = RPM2 PACKAGE = RPM2::C::Transaction diff -up RPM2-0.67/test.pl.rpm46 RPM2-0.67/test.pl --- RPM2-0.67/test.pl.rpm46 2008-12-12 01:07:41.000000000 +0100 +++ RPM2-0.67/test.pl 2008-12-12 01:07:41.000000000 +0100 @@ -126,7 +126,7 @@ ok(RPM2->expand_macro("%rpm2_test_macro" RPM2->delete_macro("rpm2_test_macro"); ok(RPM2->expand_macro("%rpm2_test_macro") eq "%rpm2_test_macro"); -ok(RPM2->rpm_api_version == 4.1 or RPM2->rpm_api_version == 4.0); +ok(RPM2->rpm_api_version =~ /4.[016]/); ok(RPM2->rpm_api_version == 4.0 or RPM2->vsf_nosha1 == 65536); # perl-RPM2-elf.patch: Index: perl-RPM2-elf.patch =================================================================== RCS file: perl-RPM2-elf.patch diff -N perl-RPM2-elf.patch --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ perl-RPM2-elf.patch 12 Dec 2008 00:26:13 -0000 1.3 @@ -0,0 +1,11 @@ +--- RPM2-0.44/Makefile.PL.elf 2002-08-26 13:16:29.000000000 -0400 ++++ RPM2-0.44/Makefile.PL 2002-08-26 13:16:45.000000000 -0400 +@@ -16,6 +16,8 @@ + } + } + ++$libs .= " -lelf"; ++ + my @defines; + # detect which rpm is running. ugly but necessary... for now. + if (-e '/usr/include/rpm/rpmts.h') { Index: perl-RPM2.spec =================================================================== RCS file: perl-RPM2.spec diff -N perl-RPM2.spec --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ perl-RPM2.spec 12 Dec 2008 00:26:13 -0000 1.8 @@ -0,0 +1,132 @@ +Name: perl-RPM2 +Version: 0.67 +Release: 7%{?dist} +Summary: Perl bindings for the RPM Package Manager API +License: GPL+ or Artistic +Group: Development/Libraries +URL: http://search.cpan.org/dist/RPM2/ +Source0: http://search.cpan.org/CPAN/authors/id/C/CH/CHIPT/RPM2-%{version}.tar.gz +Patch0: perl-RPM2-elf.patch +Patch1: perl-RPM2-0.66-remove-rpmdb-redhat-dependency.patch +Patch2: perl-RPM2-0.66-skip-root-tests.patch +Patch3: perl-RPM2-0.67-inttypes.patch +Patch4: perl-RPM2-0.67-rpm46.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: rpm-devel elfutils-libelf-devel bzip2-devel perl(ExtUtils::MakeMaker) +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) + +%description +The RPM2 module provides an object-oriented interface to querying both the +installed RPM database as well as files on the filesystem, providing Perl +bindings for the RPM Package Manager API. + +%prep +%setup -q -n RPM2-%{version} +%patch0 -p1 -b .elf +%patch1 -p1 -b .remove-rpmdb-redhat-dependency +%patch2 -p1 -b .skip-root-tests +%patch3 -p1 -b .inttypes +%patch4 -p1 -b .rpm46 + +%build +%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" +%{__make} %{?_smp_mflags} + +%check +%{__make} test + +%clean +%{__rm} -rf %{buildroot} + +%install +%{__rm} -rf %{buildroot} +%{__make} pure_install PERL_INSTALL_ROOT=%{buildroot} +/usr/bin/find %{buildroot} -type f -name .packlist -exec %{__rm} -f {} ';' +/usr/bin/find %{buildroot} -type f -name '*.bs' -a -size 0 -exec %{__rm} -f {} ';' +/usr/bin/find %{buildroot} -depth -type d -exec /bin/rmdir {} 2>/dev/null ';' +%{__chmod} -R u+w %{buildroot}/* + +%files +%defattr(-,root,root,-) +%doc Changes README +%{perl_vendorarch}/RPM2.pm +%{perl_vendorarch}/auto/RPM2/ +%{_mandir}/man3/RPM2.3pm* + +%changelog +* Fri Dec 12 2008 Lubomir Rintel <lkundrak@xxxxx> - 0.67-7 +- Port to RPM 4.6 + +* Thu Sep 11 2008 Jesse Keating <jkeating@xxxxxxxxxx> - 0.67-6 +- Rebuild for rpm deps + +* Thu Mar 06 2008 Tom "spot" Callaway <tcallawa@xxxxxxxxxx> - 0.67-5 +- Rebuild for new perl + +* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@xxxxxxxxxxxxxxxxx> - 0.67-4 +- Autorebuild for GCC 4.3 + +* Fri Oct 26 2007 Lubomir Kundrak <lkundrak@xxxxxxxxxx> - 0.67-3 +- Fix reading of non-32bit int tag values +- Correct the License tag + +* Mon May 7 2007 Robin Norwood <rnorwood@xxxxxxxxxx> - 0.67-2 +- Add BuildRequires perl(ExtUtils::MakeMaker) + +* Wed Jan 3 2007 Paul Howarth <paul@xxxxxxxxxxxx> 0.67-1 +- update to 0.67, which clarifies license +- dispense with redundant (for Fedora) reqs and buildreqs +- don't use autogenerated file lists, which can miss directory ownership + (fixes #73921) + +* Wed Mar 08 2006 Jason Vas Dias <jvdias@xxxxxxxxxx> - 0.66-12 +- fix bug 152535: correct Provides: file list +- make .spec file conform to fedora-rpmdevtools/spectemplate-perl.spec + +* Fri Feb 03 2006 Jason Vas Dias <jvdias@xxxxxxxxxx> - 0.66-11.1 +- rebuild for new perl-5.8.8, gcc, glibc, rpm + +* Thu Nov 10 2005 Tomas Mraz <tmraz@xxxxxxxxxx> 0.66-11 +- rebuilt against new openssl +- fixed filelist for compressed man page + +* Wed Mar 30 2005 Warren Togami <wtogami@xxxxxxxxxx> +- remove brp-compress + +* Tue Mar 22 2005 Joe Orton <jorton@xxxxxxxxxx> 0.66-9 +- rebuild + +* Sun Feb 13 2005 Florian La Roche <laroche@xxxxxxxxxx> +- rebuild + +* Tue Jun 15 2004 Elliot Lee <sopwith@xxxxxxxxxx> +- rebuilt + +* Tue Mar 02 2004 Elliot Lee <sopwith@xxxxxxxxxx> +- rebuilt + +* Fri Feb 13 2004 Elliot Lee <sopwith@xxxxxxxxxx> +- rebuilt + +* Tue Jan 13 2004 Dan Walsh <dwalsh@xxxxxxxxxx> 0.45-6 +- rebuilt to pick up new rpm + +* Wed Jun 04 2003 Elliot Lee <sopwith@xxxxxxxxxx> +- rebuilt + +* Wed Jan 22 2003 Tim Powers <timp@xxxxxxxxxx> +- rebuilt + +* Thu Nov 07 2002 Elliot Lee <sopwith@xxxxxxxxxx> 0.45-2 +- Rebuild + +* Wed Sep 4 2002 Chip Turner <cturner@xxxxxxxxxx> +- fix segfaults and destructor issues related to typing overlap in + perl XS mappings + +* Mon Aug 26 2002 Chip Turner <cturner@xxxxxxxxxx> +- add -lelf temporarily + +* Wed Aug 07 2002 cturner@xxxxxxxxxx +- Specfile autogenerated + --- dead.package DELETED --- -- Fedora Extras Perl SIG http://www.fedoraproject.org/wiki/Extras/SIGs/Perl Fedora-perl-devel-list mailing list Fedora-perl-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/fedora-perl-devel-list