[32506] trunk/dports/sysutils

afb at macports.org afb at macports.org
Sat Jan 5 06:43:25 PST 2008


Revision: 32506
          http://trac.macosforge.org/projects/macports/changeset/32506
Author:   afb at macports.org
Date:     2008-01-05 06:43:18 -0800 (Sat, 05 Jan 2008)

Log Message:
-----------
add legacy 4.5 branch of RPM, but leave "rpm" port until decided
- change from python24 to python25, both library/framework path
- change from old src/macports to new standard src/rpm location

Modified Paths:
--------------
    trunk/dports/sysutils/rpm45/Portfile
    trunk/dports/sysutils/rpm45/files/patch-configure
    trunk/dports/sysutils/rpm45/files/patch-macros.in
    trunk/dports/sysutils/rpm45/files/patch-rpmevr.h

Added Paths:
-----------
    trunk/dports/sysutils/rpm45/
    trunk/dports/sysutils/rpm45/files/patch-configure.ac
    trunk/dports/sysutils/rpm45/files/patch-rpmio.h
    trunk/dports/sysutils/rpm45/files/rpm2cpio.pl

Copied: trunk/dports/sysutils/rpm45 (from rev 32485, trunk/dports/sysutils/rpm)

Modified: trunk/dports/sysutils/rpm45/Portfile
===================================================================
--- trunk/dports/sysutils/rpm/Portfile	2008-01-04 13:38:14 UTC (rev 32485)
+++ trunk/dports/sysutils/rpm45/Portfile	2008-01-05 14:43:18 UTC (rev 32506)
@@ -2,12 +2,11 @@
 
 PortSystem 1.0
 
-name			rpm
-version			4.4.9
-revision                5
+name			rpm45
+version			4.5
 platforms		darwin freebsd linux
 categories		sysutils archivers
-maintainers		n3npq at mac.com
+maintainers		n3npq at mac.com afb at macports.org
 description		The RPM package management system.
 long_description	The RPM Package Manager (RPM) is a powerful command line driven \
 			package management system capable of installing, uninstalling, \
@@ -16,11 +15,20 @@
 			the package like its version, a description, etc.
 
 homepage		http://rpm5.org
-master_sites		${homepage}/files/${name}/${name}-4.4
-checksums		md5 210b768006e7d88dd8a3bcd498ea27f6
+master_sites		${homepage}/files/rpm/rpm-4.5
+distname		rpm-${version}-0.4
+checksums		md5 9f9d2e64b93d64b8cc2c10e116e9ecd9
+worksrcdir		rpm-${version}
+#
+### CVS source
+#fetch.type      	cvs
+#cvs.root		:pserver:anonymous at rpm5.org:/cvs
+#cvs.module		rpm
+#cvs.tag			rpm-4_5
+#worksrcdir		rpm
 
 depends_build		port:expat port:neon \
-			port:python24 port:perl5.8 \
+			port:python25 port:perl5.8 \
 			port:readline port:beecrypt \
 			port:libiconv port:gettext
 
@@ -32,36 +40,52 @@
                         bin:bzip2:bzip2 \
                         bin:unzip:unzip
 
+extract.suffix		.src.rpm
+extract.cmd		${filespath}/rpm2cpio.pl
+extract.pre_args
+extract.post_args	| cpio -dvim rpm-${version}.tar.gz && \
+			  gzip -dc rpm-${version}.tar.gz | tar -xf -
+
 build.type		gnu
 
 configure.args		--disable-nls --without-javaglue --without-included-gettext \
 			--with-libintl-prefix=${prefix} --with-libiconv-prefix=${prefix} \
 			--mandir=${prefix}/share/man --infodir=${prefix}/share/info \
-			--with-python=2.4 --with-perl --without-apidocs \
-			--sysconfdir=${prefix}/etc
+			--with-python=2.5 --with-perl --without-apidocs \
+			--sysconfdir=${prefix}/etc/rpm
 
 			# needed because it checks for sqlite3_open in sqlite lib...
 configure.env		ac_cv_lib_sqlite_sqlite3_open=yes
 
+### CVS config
+#post-fetch	{ system "cd ${worksrcpath} && ./devtool checkout" }
+#post-patch { reinplace "s at po/Makefile.in@@" ${worksrcpath}/configure.ac
+#reinplace "s@\"-lsqlite\"@\"-lsqlite3\"@" ${worksrcpath}/configure.ac }
+#pre-configure	{ system "cd ${worksrcpath} && ./devtool autogen" }
+
 patchfiles		patch-macros.in \
 			patch-configure \
 			patch-Makefile.PL \
 			patch-darwin.prov \
 			patch-fts.c \
-			patch-rpmdav.c \
+			patch-rpmio.h \
 			patch-rpmsq.c \
-			patch-rpmevr.h \
-			patch-parseBuildInstallClean.c
+			patch-rpmevr.h
 
+### CVS patches
+#patchfiles		patch-macros.in \
+#			patch-configure.ac \
+#			patch-darwin.prov \
+#			patch-fts.c \
+#			patch-rpmsq.c \
+#			patch-rpmevr.h
+
 post-patch {
 	# use external popt library
-	delete ${worksrcpath}/popt
+	if {[file exists ${worksrcpath}/popt]} { delete ${worksrcpath}/popt }
 }
 
 post-destroot {
-	# MacPorts specific changes
-	reinplace "s;%{_usrsrc}/rpm;%{_usrsrc}/macports;" ${destroot}${prefix}/lib/rpm/macros
-
 	xinstall -d -m 755 ${prefix}/etc/rpm
 
 	delete [glob ${destroot}${prefix}/lib/perl5/*/*/*/auto/RPM/.packlist]
@@ -71,11 +95,11 @@
 	destroot.keepdirs ${destroot}${prefix}/etc/rpm\
 			  ${destroot}${prefix}/var/lib/rpm\
 			  ${destroot}${prefix}/var/spool/repackage\
-			  ${destroot}${prefix}/src/macports/BUILD\
-			  ${destroot}${prefix}/src/macports/RPMS\
-			  ${destroot}${prefix}/src/macports/SOURCES\
-			  ${destroot}${prefix}/src/macports/SPECS\
-			  ${destroot}${prefix}/src/macports/SRPMS
+			  ${destroot}${prefix}/src/rpm/BUILD\
+			  ${destroot}${prefix}/src/rpm/RPMS\
+			  ${destroot}${prefix}/src/rpm/SOURCES\
+			  ${destroot}${prefix}/src/rpm/SPECS\
+			  ${destroot}${prefix}/src/rpm/SRPMS
 }
 
 platform darwin {
@@ -83,11 +107,12 @@
 			      --with-glob --enable-broken-chown \
 			      --disable-rpath
 
-	configure.cppflags-append -I${prefix}/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4
+	configure.cppflags-append -I${prefix}/include/python2.5
+	configure.cppflags-append -I${prefix}/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
 
 	post-destroot {
 		# Mac OS X specific changes
-		reinplace "s;\blibtoolize\b;glibtoolize;" ${destroot}${prefix}/lib/rpm/macros
+		reinplace "s;\blibtoolize\b;glibtoolize;" ${destroot}${prefix}/lib/rpm/4.5/macros
 	}
 }
 
@@ -98,8 +123,8 @@
 
 	post-destroot {
 		# FreeBSD specific changes
-		reinplace "s;/usr/bin/tar;/usr/local/bin/gtar;" ${destroot}${prefix}/lib/rpm/macros
-		reinplace "s;/usr/bin/make;/usr/local/bin/gmake;" ${destroot}${prefix}/lib/rpm/macros
+		reinplace "s;/usr/bin/tar;/usr/local/bin/gtar;" ${destroot}${prefix}/lib/rpm/4.5/macros
+		reinplace "s;/usr/bin/make;/usr/local/bin/gmake;" ${destroot}${prefix}/lib/rpm/4.5/macros
 	}
 }
 

Modified: trunk/dports/sysutils/rpm45/files/patch-configure
===================================================================
--- trunk/dports/sysutils/rpm/files/patch-configure	2008-01-04 13:38:14 UTC (rev 32485)
+++ trunk/dports/sysutils/rpm45/files/patch-configure	2008-01-05 14:43:18 UTC (rev 32506)
@@ -22,12 +22,3 @@
      DBLIBSRCS="$DBLIBSRCS sqlite.c"
  
  fi
-@@ -36560,7 +36560,7 @@
- 
- 
- 
--SYSCONFIGDIR="`echo /etc/rpm`"
-+SYSCONFIGDIR="`echo $sysconfdir/rpm`"
- 
- cat >>confdefs.h <<_ACEOF
- #define SYSCONFIGDIR "$SYSCONFIGDIR"

Added: trunk/dports/sysutils/rpm45/files/patch-configure.ac
===================================================================
--- trunk/dports/sysutils/rpm45/files/patch-configure.ac	                        (rev 0)
+++ trunk/dports/sysutils/rpm45/files/patch-configure.ac	2008-01-05 14:43:18 UTC (rev 32506)
@@ -0,0 +1,24 @@
+--- configure.ac.orig	2007-12-12 10:35:41.000000000 +0100
++++ configure.ac	2007-06-22 01:23:43.000000000 +0200
+@@ -655,8 +655,8 @@
+   AC_CHECK_HEADER([popt.h], [
+     AC_CHECK_LIB(popt, poptGetContext, [
+       WITH_POPT_SUBDIR=
+-      WITH_POPT_INCLUDE=
+-      WITH_POPT_LIB="-lpopt"
++      WITH_POPT_INCLUDE='-I${prefix}/include'
++      WITH_POPT_LIB='${prefix}/lib/libpopt.la'
+     ])
+   ])
+ fi
+@@ -692,8 +692,8 @@
+   AC_CHECK_LIB(sqlite, sqlite3_open, [
+     AC_DEFINE(HAVE_SQLITE3_H, 1, [Define if you have the <sqlite3.h> header file])
+     WITH_SQLITE3_SUBDIR=
+-    WITH_SQLITE3_INCLUDE=
+-    WITH_SQLITE3_LIB="-lsqlite"
++    WITH_SQLITE3_INCLUDE='-I${prefix}/include'
++    WITH_SQLITE3_LIB='${prefix}/lib/libsqlite3.la'
+     DBLIBSRCS="$DBLIBSRCS sqlite.c"
+   ])
+ ],[

Modified: trunk/dports/sysutils/rpm45/files/patch-macros.in
===================================================================
--- trunk/dports/sysutils/rpm/files/patch-macros.in	2008-01-04 13:38:14 UTC (rev 32485)
+++ trunk/dports/sysutils/rpm45/files/patch-macros.in	2008-01-05 14:43:18 UTC (rev 32506)
@@ -1,6 +1,6 @@
---- macros.in.orig	2007-05-15 03:46:44.000000000 +0200
-+++ macros.in	2007-06-21 23:16:30.000000000 +0200
-@@ -178,7 +178,7 @@
+--- macros.in.orig	2007-06-17 03:11:47.000000000 +0200
++++ macros.in	2007-07-02 22:05:00.000000000 +0200
+@@ -181,7 +181,7 @@
  %_dbpath_rebuild	%{_dbpath}
  
  #
@@ -8,8 +8,8 @@
 +#	Path to script that creates debug symbols in a @prefix@/lib/debug
  #	shadow tree.
  %__debug_install_post   \
-    %{_usrlibrpm}/find-debuginfo.sh %{_builddir}/%{?buildsubdir}\
-@@ -297,7 +297,7 @@
+    %{_rpmhome}/find-debuginfo.sh %{_builddir}/%{?buildsubdir}\
+@@ -300,7 +300,7 @@
  
  #	The PATH put into the environment before running %pre/%post et al.
  #
@@ -18,16 +18,16 @@
  
  #	A colon separated list of desired locales to be installed;
  #	"all" means install all locale specific files.
-@@ -626,7 +626,7 @@
+@@ -629,7 +629,7 @@
    %{!?_rpmdb_rebuild:%{__dbi_btconfig_current}}\
  %{nil}
  
--%_dbi_tags      Packages:Name:Basenames:Group:Requirename:Providename:Conflictname:Triggername:Dirnames:Requireversion:Provideversion:Installtid:Sigmd5:Sha1header:Filemd5s:Depends:Pubkeys:Packagecolor
+-%_dbi_tags      Packages:Name:Basenames:Group:Requirename:Providename:Conflictname:Triggername:Dirnames:Requireversion:Provideversion:Installtid:Sigmd5:Sha1header:Filemd5s:Depends:Pubkeys
 +%_dbi_tags      Packages:Name:Basenames:Group:Requirename:Providename:Conflictname:Triggername:Dirnames:Requireversion:Provideversion:Installtid:Sigmd5:Sha1header:Filemd5s:Pubkeys
  
  %_dbi_config_Dirnames		%{_dbi_btconfig}
  %_dbi_config_Requireversion	%{_dbi_btconfig}
-@@ -659,11 +658,12 @@
+@@ -662,11 +662,12 @@
  # XXX legacy configuration.
  # Choose db interface:
  #	3	native db3 interface.
@@ -42,16 +42,7 @@
  
  #
  # Export package NEVRA (stamped with install tid) info for HRMIB on this path.
-@@ -670,7 +670,7 @@
- # Export package NEVRA (stamped with install tid) info for HRMIB on this path.
- #
- # XXX	Note: escaped %% for use in headerSprintf()
--%_hrmib_path	/var/cache/hrmib/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}
-+%_hrmib_path	@prefix@/var/cache/hrmib/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}
- 
- #==============================================================================
- # ---- GPG/PGP/PGP5 signature macros.
-@@ -757,11 +757,11 @@
+@@ -760,11 +761,11 @@
  #	The path to the dependency universe database. The default value
  #	is the rpmdb-vendor location. The macro is usually defined in
  #	%{_etcrpm}/macros.solve, installed with the rpmdb-vendor package.
@@ -61,38 +52,11 @@
  #	The path to the dependency universe packages. This should
  #	be a path to the packages contained in the solve database.
 -#%_solve_pkgsdir	/mnt/rpm/test/latest-i386/RedHat/RPMS/
-+#%_solve_pkgsdir	@prefix@/src/%{_vendor}/RPMS/ppc
++#%_solve_pkgsdir	@prefix@/src/%{_vendor}/RPMS
  
  #	The output binary package file name template used when suggesting
  #	binary packages that solve a dependency. The macro is usually defined
-@@ -779,7 +779,7 @@
- 
- #	The directory in which erased packages will be saved when using
- #	the --repackage option.
--%_repackage_dir		/var/spool/repackage
-+%_repackage_dir		@prefix@/var/spool/repackage
- 
- #	A path (i.e. URL) prefix that is pre-pended to %{_repackage_dir}.
- %_repackage_root	%{nil}
-@@ -910,7 +910,7 @@
- %_rpmds_perldeps_cmd	%{__find} %{_libdir}/perl5 | %{_usrlibrpm}/perl.prov
- 
- #
--%_varrun		/var/run
-+%_varrun		@prefix@/var/run
- 
- #==============================================================================
- # ---- Cache configuration macros.
-@@ -935,7 +935,7 @@
- %_bhA           %{nil}
- 
- #	The cache database directory.
--%_cache_dbpath		/var/cache/yum/rpmdb
-+%_cache_dbpath		@prefix@/var/cache/yum/rpmdb
- 
- #==============================================================================
- # ---- per-platform macros.
-@@ -1147,7 +1147,7 @@
+@@ -1150,7 +1151,7 @@
  %_lib			lib
  %_libdir		%{_exec_prefix}/%{_lib}
  %_includedir		%{_prefix}/include
@@ -101,37 +65,37 @@
  %_infodir		%{_prefix}/info
  %_mandir		%{_prefix}/man
  %_localedir		%{_datadir}/locale
-@@ -1409,7 +1409,7 @@
+@@ -1412,7 +1413,7 @@
  # Note: Used iff _use_internal_dependency_generator is non-zero. The
- # helpers are also used by %{_usrlibrpm}/rpmdeps {--provides|--requires}.
- %__java_provides	%{_usrlibrpm}/javadeps.sh --provides
--%__java_requires	%{_usrlibrpm}/javadeps.sh --requires
-+#%__java_requires	%{_usrlibrpm}/javadeps.sh --requires
+ # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
+ %__java_provides	%{_rpmhome}/javadeps.sh --provides
+-%__java_requires	%{_rpmhome}/javadeps.sh --requires
++#%__java_requires	%{_rpmhome}/javadeps.sh --requires
  
  #------------------------------------------------------------------------
  # libtool(...) configuration.
-@@ -1419,7 +1419,7 @@
+@@ -1422,7 +1423,7 @@
  # Note: Used iff _use_internal_dependency_generator is non-zero. The
- # helpers are also used by %{_usrlibrpm}/rpmdeps {--provides|--requires}.
- %__libtool_provides	%{_usrlibrpm}/libtooldeps.sh --provides %{buildroot} %{name}
--%__libtool_requires	%{_usrlibrpm}/libtooldeps.sh --requires %{buildroot} %{name}
-+#%__libtool_requires	%{_usrlibrpm}/libtooldeps.sh --requires %{buildroot} %{name}
+ # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
+ %__libtool_provides	%{_rpmhome}/libtooldeps.sh --provides %{buildroot} %{name}
+-%__libtool_requires	%{_rpmhome}/libtooldeps.sh --requires %{buildroot} %{name}
++#%__libtool_requires	%{_rpmhome}/libtooldeps.sh --requires %{buildroot} %{name}
  
  #------------------------------------------------------------------------
  # pkgconfig(...) configuration.
-@@ -1429,7 +1429,7 @@
+@@ -1432,7 +1433,7 @@
  # Note: Used iff _use_internal_dependency_generator is non-zero. The
- # helpers are also used by %{_usrlibrpm}/rpmdeps {--provides|--requires}.
- %__pkgconfig_provides	%{_usrlibrpm}/pkgconfigdeps.sh --provides
--%__pkgconfig_requires	%{_usrlibrpm}/pkgconfigdeps.sh --requires
-+#%__pkgconfig_requires	%{_usrlibrpm}/pkgconfigdeps.sh --requires
+ # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
+ %__pkgconfig_provides	%{_rpmhome}/pkgconfigdeps.sh --provides
+-%__pkgconfig_requires	%{_rpmhome}/pkgconfigdeps.sh --requires
++#%__pkgconfig_requires	%{_rpmhome}/pkgconfigdeps.sh --requires
  
  #------------------------------------------------------------------------
  # executable(...) configuration.
-@@ -1440,7 +1440,7 @@
- # helpers are also used by %{_usrlibrpm}/rpmdeps {--provides|--requires}.
- #%__executable_provides	%{_usrlibrpm}/executabledeps.sh --provides
- #%__executable_requires	%{_usrlibrpm}/executabledeps.sh --requires
+@@ -1443,7 +1444,7 @@
+ # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
+ #%__executable_provides	%{_rpmhome}/executabledeps.sh --provides
+ #%__executable_requires	%{_rpmhome}/executabledeps.sh --requires
 -%__scriptlet_requires	/bin/bash --rpm-requires
 +#%__scriptlet_requires	/bin/bash --rpm-requires
  

Modified: trunk/dports/sysutils/rpm45/files/patch-rpmevr.h
===================================================================
--- trunk/dports/sysutils/rpm/files/patch-rpmevr.h	2008-01-04 13:38:14 UTC (rev 32485)
+++ trunk/dports/sysutils/rpm45/files/patch-rpmevr.h	2008-01-05 14:43:18 UTC (rev 32506)
@@ -1,27 +1,3 @@
---- lib/rpmevr.h.orig	2007-05-16 12:55:05.000000000 +0200
-+++ lib/rpmevr.h	2007-08-09 18:36:13.000000000 +0200
-@@ -6,6 +6,10 @@
-  * Structure(s) and routine(s) used for EVR parsing and comparison.
-  */
- 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
- /**
-  */
- /*@-exportlocal@*/
-@@ -117,10 +121,6 @@
- #define	isErasePreReq(_x)	((_x) & _ERASE_ONLY_MASK)
- #endif	/* _RPMEVR_INTERNAL */
- 
--#ifdef __cplusplus
--extern "C" {
--#endif
--
- /** \ingroup rpmds
-  * Segmented string compare.
-  * @param a		1st string
 --- ./lib/rpmevr.h.orig	2007-05-16 12:55:05.000000000 +0200
 +++ ./lib/rpmevr.h	2007-06-20 10:13:14.000000000 +0200
 @@ -18,8 +18,6 @@

Added: trunk/dports/sysutils/rpm45/files/patch-rpmio.h
===================================================================
--- trunk/dports/sysutils/rpm45/files/patch-rpmio.h	                        (rev 0)
+++ trunk/dports/sysutils/rpm45/files/patch-rpmio.h	2008-01-05 14:43:18 UTC (rev 32506)
@@ -0,0 +1,15 @@
+--- rpmio/rpmio.h	2007-05-25 12:00:39.000000000 -0700
++++ rpmio/rpmio.h	2007-06-13 10:52:54.000000000 -0700
+@@ -664,7 +664,11 @@
+  * @param prompt	prompt string
+  * @return		password
+  */
++#ifdef NO_EXTERN
+ char * (*Getpass) (const char * prompt)
++#else
++extern char * (*Getpass) (const char * prompt)
++#endif
+ 	/*@*/;
+ char * _GetPass (const char * prompt)
+ 	/*@*/;
+


Property changes on: trunk/dports/sysutils/rpm45/files/patch-rpmio.h
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/dports/sysutils/rpm45/files/rpm2cpio.pl
===================================================================
--- trunk/dports/sysutils/rpm45/files/rpm2cpio.pl	                        (rev 0)
+++ trunk/dports/sysutils/rpm45/files/rpm2cpio.pl	2008-01-05 14:43:18 UTC (rev 32506)
@@ -0,0 +1,89 @@
+#!/usr/bin/perl
+
+# Copyright (C) 1997,1998,1999, Roger Espel Llima
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and any associated documentation files (the "Software"), to 
+# deal in the Software without restriction, including without limitation the 
+# rights to use, copy, modify, merge, publish, distribute, sublicense, 
+# and/or sell copies of the Software, and to permit persons to whom the 
+# Software is furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# SOFTWARE'S COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+
+# (whew, that's done!)
+
+# why does the world need another rpm2cpio?  because the existing one
+# won't build unless you have half a ton of things that aren't really
+# required for it, since it uses the same library used to extract RPM's.
+# in particular, it won't build on the HPsUX box i'm on.
+
+
+# add a path if desired
+$gzip = "gzip";
+
+sub printhelp {
+  print <<HERE;
+rpm2cpio, perl version by orabidoo <odar\@pobox.com>
+dumps the contents to stdout as a cpio archive
+
+use: rpm2cpio [file.rpm] > file.cpio
+
+Here's how to use cpio:
+     list of contents:   cpio -t -i < /file/name
+        extract files:   cpio -d -i < /file/name
+HERE
+
+  exit 0;
+}
+
+if ($#ARGV == -1) {
+  printhelp if -t STDIN;
+  $f = "STDIN";
+} elsif ($#ARGV == 0) {
+  open(F, "< $ARGV[0]") or die "Can't read file $ARGV[0]\n";
+  $f = 'F';
+} else {
+  printhelp;
+}
+
+printhelp if -t STDOUT;
+
+# gobble the file up
+undef $/;
+$|=1;
+$rpm = <$f>;
+close ($f);
+
+($magic, $major, $minor, $crap) = unpack("NCC C90", $rpm);
+
+die "Not an RPM\n" if $magic != 0xedabeedb;
+die "Not a version 3 or 4 RPM\n" if $major != 3 && $major != 4;
+
+$rpm = substr($rpm, 96);
+
+while ($rpm ne '') {
+  $rpm =~ s/^\c@*//s;
+  ($magic, $crap, $sections, $bytes) = unpack("N4", $rpm);
+  $smagic = unpack("n", $rpm);
+  last if $smagic eq 0x1f8b;
+  die "Error: header not recognized\n" if $magic != 0x8eade801;
+  $rpm = substr($rpm, 16*(1+$sections) + $bytes);
+}
+
+die "bogus RPM\n" if $rpm eq '';
+
+open(ZCAT, "|gzip -cd") || die "can't pipe to gzip\n";
+#print STDERR "CPIO archive found!\n";
+print ZCAT $rpm;
+close ZCAT;
+


Property changes on: trunk/dports/sysutils/rpm45/files/rpm2cpio.pl
___________________________________________________________________
Name: svn:executable
   + *

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080105/140bc975/attachment-0001.html


More information about the macports-changes mailing list