Skip to content
Permalink
Browse files

Initial cut at an RPM 4.1.1 port. Supports basic packing

install and query. Still need to add back in local specials
like fat building and python module. Need to upload distfile
Submitted by:   Shantonu Sen <ssen@opendarwin.org>

git-svn-id: https://svn.macports.org/repository/macports/trunk/dports@3916 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
Shantonu Sen
Shantonu Sen committed Nov 10, 2003
1 parent c515ff9 commit 59007743a4fcb0bcfc14c90cf69f7a64a92d73ac
Showing with 657 additions and 0 deletions.
  1. +78 −0 sysutils/rpm41/Portfile
  2. +10 −0 sysutils/rpm41/files/patch-Makefile-in.diff
  3. +48 −0 sysutils/rpm41/files/patch-autodeps-darwin-prov.diff
  4. +72 −0 sysutils/rpm41/files/patch-autodeps-darwin-req.diff
  5. +10 −0 sysutils/rpm41/files/patch-build-Makefile-in.diff
  6. +11 −0 sysutils/rpm41/files/patch-db3-configure.diff
  7. +11 −0 sysutils/rpm41/files/patch-dump.diff
  8. +11 −0 sysutils/rpm41/files/patch-dumpdb.diff
  9. +11 −0 sysutils/rpm41/files/patch-file-filec.diff
  10. +11 −0 sysutils/rpm41/files/patch-file-systemh.diff
  11. +42 −0 sysutils/rpm41/files/patch-fts.diff
  12. +10 −0 sysutils/rpm41/files/patch-lib-Makefile-in.diff
  13. +12 −0 sysutils/rpm41/files/patch-lib-signature.diff
  14. +11 −0 sysutils/rpm41/files/patch-ltmain-sh.diff
  15. +11 −0 sysutils/rpm41/files/patch-macros-in.diff
  16. +35 −0 sysutils/rpm41/files/patch-python-makefile-in.diff
  17. +10 −0 sysutils/rpm41/files/patch-python-rpmmodule.diff
  18. +11 −0 sysutils/rpm41/files/patch-rpm2cpio.diff
  19. +11 −0 sysutils/rpm41/files/patch-rpmarchive.diff
  20. +10 −0 sysutils/rpm41/files/patch-rpmdb-Makefile-in.diff
  21. +12 −0 sysutils/rpm41/files/patch-rpmdb-rpmdbc.diff
  22. +11 −0 sysutils/rpm41/files/patch-rpmheader.diff
  23. +10 −0 sysutils/rpm41/files/patch-rpmio-Makefile-in.diff
  24. +11 −0 sysutils/rpm41/files/patch-rpmioc.diff
  25. +11 −0 sysutils/rpm41/files/patch-rpmioh.diff
  26. +11 −0 sysutils/rpm41/files/patch-rpmlead.diff
  27. +11 −0 sysutils/rpm41/files/patch-rpmqv.diff
  28. +53 −0 sysutils/rpm41/files/patch-rpmrc-in.diff
  29. +16 −0 sysutils/rpm41/files/patch-rpmrc.diff
  30. +21 −0 sysutils/rpm41/files/patch-rpmrpc.diff
  31. +11 −0 sysutils/rpm41/files/patch-rpmsignature.diff
  32. +11 −0 sysutils/rpm41/files/patch-systemh.diff
  33. +11 −0 sysutils/rpm41/files/patch-tools-Makefile-in.diff
  34. +21 −0 sysutils/rpm41/files/patch-tools-rpmfile.diff
@@ -0,0 +1,78 @@
# $Id: Portfile,v 1.1 2003/11/10 17:12:53 ssen Exp $

PortSystem 1.0
name rpm41
version 4.1.1
platforms darwin
revision 0
categories sysutils archivers
maintainers ssen@opendarwin.org
description RedHat Package Manager

master_sites ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.1.x/
checksums md5 da4c87e95092aa9f0c85da3836e6b1c6
distname rpm-${version}

depends_lib lib:libbz2.1.0:bzip2 lib:libiconv.2:libiconv \
bin:python:python

configure.args --disable-nls --with-included-gettext \
--with-glob --with-libiconv-prefix=${prefix} \
--mandir=${prefix}/share/man

variant darwin {
patchfiles-append \
patch-db3-configure.diff patch-rpmheader.diff \
patch-dump.diff patch-rpmioc.diff \
patch-dumpdb.diff patch-rpmioh.diff \
patch-lib-signature.diff patch-rpmlead.diff \
patch-macros-in.diff patch-rpmqv.diff \
patch-rpm2cpio.diff patch-rpmsignature.diff \
patch-rpmarchive.diff patch-systemh.diff \
patch-rpmrc.diff patch-file-systemh.diff \
patch-file-filec.diff patch-rpmio-Makefile-in.diff \
patch-fts.diff patch-rpmrpc.diff \
patch-rpmdb-Makefile-in.diff patch-lib-Makefile-in.diff \
patch-rpmdb-rpmdbc.diff patch-build-Makefile-in.diff \
patch-tools-rpmfile.diff patch-tools-Makefile-in.diff \
patch-Makefile-in.diff patch-ltmain-sh.diff

#patch-rpmrc-in.diff

# patch-autodeps-darwin-prov.diff patch-autodeps-darwin-req.diff \
# patch-python-rpmmodule.diff patch-python-makefile-in.diff

post-patch {
system "rm -rf \"${worksrcpath}/elfutils\""
}

pre-configure {
system "mkdir -p ${workpath}/librt"
system "ln -sf /usr/lib/libSystem.B.dylib \
${workpath}/librt/librt.dylib"
}

configure.args-append --disable-optimized --disable-aio \
--with-python=no --without-javaglue \
--enable-broken-chown

configure.env LDFLAGS="-L${prefix}/lib -L${workpath}/librt" \
CFLAGS="-I${prefix}/include -no-cpp-precomp" \
CPPFLAGS=""

post-destroot {
# where the RPM database to lives
system "mkdir -p '${destroot}${prefix}/var/lib/rpm'"
system "touch '${destroot}${prefix}/var/lib/rpm/.turd'"
system "mkdir -p '${destroot}${prefix}/src/apple/BUILD'"
system "touch '${destroot}${prefix}/src/apple/BUILD/.turd'"
system "mkdir -p '${destroot}${prefix}/src/apple/RPMS'"
system "touch '${destroot}${prefix}/src/apple/RPMS/.turd'"
system "mkdir -p '${destroot}${prefix}/src/apple/SOURCES'"
system "touch '${destroot}${prefix}/src/apple/SOURCES/.turd'"
system "mkdir -p '${destroot}${prefix}/src/apple/SPECS'"
system "touch '${destroot}${prefix}/src/apple/SPECS/.turd'"
system "mkdir -p '${destroot}${prefix}/src/apple/SRPMS'"
system "touch '${destroot}${prefix}/src/apple/SRPMS/.turd'"
}
}
@@ -0,0 +1,10 @@
--- Makefile.in.orig Sun Nov 9 19:49:40 2003
+++ Makefile.in Sun Nov 9 19:56:31 2003
@@ -228,6 +228,7 @@
-I$(top_srcdir)/rpmio \
-I$(top_srcdir)/beecrypt \
-I$(top_srcdir)/popt \
+ -I$(top_srcdir)/misc \
@WITH_LIBELF_INCLUDE@ \
@WITH_ZLIB_INCLUDE@ \
@INCPATH@
@@ -0,0 +1,48 @@
--- /dev/null Sat May 31 18:22:36 2003
+++ autodeps/darwin.prov Sat May 31 18:21:55 2003
@@ -0,0 +1,45 @@
+#!/usr/bin/perl
+# ----------------------------------------------------------
+# find-provides for Darwin
+# ----------------------------------------------------------
+
+my %files;
+
+while (my $DEP = <STDIN>) {
+ chomp $DEP;
+
+ next if (-d $DEP);
+
+ next if ($DEP =~ m,\.class$,);
+
+ for my $ARCH ('ppc', 'i386') {
+ my $FILE = $DEP;
+ my $header;
+ my $FILE_esc = $FILE;
+ $FILE_esc =~ s/\'/\\\'/g;
+ if (open(OTOOL, "otool -arch '$ARCH' -hv '$FILE_esc' 2>/dev/null |")) {
+ while (<OTOOL>) {
+ if (/MH_MAGIC/) {
+ $header = $_;
+ }
+ }
+ close(OTOOL);
+ if (split(/\s+/, $header) and $_[4] eq 'DYLIB') {
+ if (open(OTOOL, "otool -arch '$ARCH' -DX '$FILE_esc' 2>/dev/null |")) {
+ chomp($FILE = <OTOOL>);
+ if ($FILE =~ m,\.framework/,) {
+ $FILE =~ s,^.*?/([^/]*?\.framework)/.*$,$1,;
+ }
+ $files{"$FILE-$ARCH"} = 1;
+ } else {
+ warn "couldn't determine install_name for '$FILE': $!\n";
+ }
+ }
+ } else {
+ warn "unable to run otool on $FILE: $!\n";
+ next;
+ }
+ }
+}
+
+print join("\n", sort keys %files), "\n";
@@ -0,0 +1,72 @@
--- /dev/null Mon Jun 2 11:50:07 2003
+++ autodeps/darwin.req Mon Jun 2 11:49:57 2003
@@ -0,0 +1,69 @@
+#!/usr/bin/perl
+# ----------------------------------------------------------------
+# find-requires for Darwin
+# ----------------------------------------------------------------
+
+my %files;
+my @check;
+my %receipts;
+my $usereceipts = 0;
+
+if (exists $ENV{'DP_USERECEIPTS'}) {
+ my $directory = $ENV{'DP_USERECEIPTS'};
+ if (opendir(DIR, $directory)) {
+ for my $receipt (grep(!/^\.\.?$/, readdir(DIR))) {
+ chomp($receipt);
+ my $receiptopen;
+ if ($receipt =~ /\.bz2$/) {
+ $receiptopen = "bzip2 -dc $directory/$receipt |";
+ } else {
+ $receiptopen = "$directory/$receipt";
+ }
+ if (open(RECEIPT, $receiptopen)) {
+ while (my $contents = <RECEIPT>) {
+ while ($contents =~ /\G.*?MD5 \((.+?)\)/gs) {
+ $receipts{$1} = 1;
+ }
+ }
+ close(RECEIPT);
+ } else {
+ warn "couldn't read $receipt: $!\n";
+ }
+ }
+ closedir(DIR);
+ $usereceipts = 1;
+ } else {
+ warn "couldn't open receipt directory: $!\n";
+ }
+}
+
+while (my $FILE = <STDIN>) {
+ chomp $FILE;
+
+ next if (-d $FILE);
+
+ next if ($FILE =~ m,\.class$,);
+
+ my $FILE_esc = $FILE;
+ $FILE_esc =~ s/\'/\\\'/g;
+
+ for my $ARCH ('ppc', 'i386') {
+ if (open(OTOOL, "otool -arch '$ARCH' -L '$FILE_esc' 2>/dev/null |")) {
+ while (<OTOOL>) {
+ if (/^\s*([^\s].*)\s+\(compatibility version/) {
+ my $dep = $1;
+ next if ($usereceipts and not exists $receipts{$dep});
+ if ($dep =~ m,\.framework/.*,) {
+ $dep =~ s,^.*?/([^/]*?\.framework)/.*$,$1,;
+ }
+ $files{"$dep-$ARCH"} = 1;
+ }
+ }
+ close(OTOOL);
+ } else {
+ warn "couldn't run otool on '$FILE': $!\n";
+ }
+ }
+}
+
+print join("\n", sort keys %files), "\n";
@@ -0,0 +1,10 @@
--- build/Makefile.in.orig Sun Nov 9 12:44:19 2003
+++ build/Makefile.in Sun Nov 9 12:44:42 2003
@@ -213,6 +213,7 @@
-I$(top_srcdir)/rpmdb \
-I$(top_srcdir)/rpmio \
-I$(top_srcdir)/popt \
+ -I$(top_srcdir)/misc \
@WITH_LIBELF_INCLUDE@ \
@INCPATH@

@@ -0,0 +1,11 @@
--- db3/configure.orig Sat Jan 18 06:04:22 2003
+++ db3/configure Sat Nov 8 18:47:13 2003
@@ -15,7 +15,7 @@
cat Makefile.orig | sed -e '/^install[:-]/c\
.PHONY: listobjs\
listobjs:\
- @echo $(OBJS) $(C_OBJS) \
+\ @echo $(OBJS) $(C_OBJS) \
\
distdir install check:\
\
@@ -0,0 +1,11 @@
--- tools/dump.c Sun Jun 17 13:38:10 2001
+++ ../rpm-4.0.4/tools/dump.c Thu Jul 11 12:59:25 2002
@@ -4,6 +4,8 @@
#include "header_internal.h"
#include "debug.h"

+const char *program_name;
+
int main(int argc, char ** argv)
{
Header h;
@@ -0,0 +1,11 @@
--- tools/dumpdb.c.orig Thu May 16 09:56:10 2002
+++ tools/dumpdb.c Sat Nov 8 18:47:14 2003
@@ -7,6 +7,8 @@

#include "debug.h"

+const char *program_name;
+
int main(int argc, char ** argv)
{
unsigned int dspBlockNum = 0; /* default to all */
@@ -0,0 +1,11 @@
--- file/file.c.orig Sat Nov 8 19:01:16 2003
+++ file/file.c Sat Nov 8 19:01:25 2003
@@ -149,6 +149,8 @@
}
#endif

+const char *program_name;
+
/*
* main - parse arguments and handle options
*/
@@ -0,0 +1,11 @@
--- file/system.h.orig Sat Nov 8 18:59:43 2003
+++ file/system.h Sat Nov 8 18:59:55 2003
@@ -306,7 +306,7 @@
}
#endif
/*@unchecked@*/
-const char *__progname;
+extern const char *__progname;

#if HAVE_LOCALE_H
# include <locale.h>
@@ -0,0 +1,42 @@
--- rpmio/fts.h.orig Sat Nov 8 20:39:29 2003
+++ rpmio/fts.h Sat Nov 8 20:40:16 2003
@@ -55,6 +55,10 @@
# define _D_EXACT_NAMLEN(d) ((d)->d_reclen)
#endif

+#if defined(__APPLE__)
+# define _D_EXACT_NAMLEN(d) ((d)->d_reclen)
+#endif
+
#endif

#include <sys/types.h>
--- rpmio/fts.c.orig Sat Nov 8 20:34:53 2003
+++ rpmio/fts.c Sat Nov 8 20:42:10 2003
@@ -59,6 +59,9 @@
# define _STAT_VER 0
# define __fxstat64(_stat_ver, _fd, _sbp) fstat((_fd), (_sbp))
#endif
+#if defined(__APPLE__)
+# define __errno_location() (__error())
+#endif
#include "system.h"
#include "fts.h"
#include "rpmio.h"
@@ -1171,14 +1174,14 @@
fts_safe_changedir(FTS * sp, FTSENT * p, int fd, const char * path)
{
int ret, oerrno, newfd;
- struct stat64 sb;
+ struct stat sb;

newfd = fd;
if (ISSET(FTS_NOCHDIR))
return (0);
if (fd < 0 && (newfd = __open(path, O_RDONLY, 0)) < 0)
return (-1);
- if (__fxstat64(_STAT_VER, newfd, &sb)) {
+ if (fstat(newfd, &sb)) {
ret = -1;
goto bail;
}
@@ -0,0 +1,10 @@
--- lib/Makefile.in.orig Sun Nov 9 12:08:19 2003
+++ lib/Makefile.in Sun Nov 9 12:08:44 2003
@@ -213,6 +213,7 @@
-I$(top_srcdir)/rpmdb \
-I$(top_srcdir)/rpmio \
-I$(top_srcdir)/popt \
+ -I$(top_srcdir)/misc \
@INCPATH@


@@ -0,0 +1,12 @@
--- lib/signature.c.orig Sun Nov 9 17:38:03 2003
+++ lib/signature.c Sun Nov 9 17:38:57 2003
@@ -27,7 +27,8 @@
/*@access pgpDigParams@*/

#if !defined(__GLIBC__)
-char ** environ = NULL;
+#include <crt_externs.h>
+#define environ (*_NSGetEnviron())
#endif

int rpmLookupSignatureType(int action)
@@ -0,0 +1,11 @@
--- ltmain.sh.orig Sun Nov 9 20:39:52 2003
+++ ltmain.sh Sun Nov 9 20:40:00 2003
@@ -1772,7 +1772,7 @@

if test "$installed" = no; then
notinst_deplibs="$notinst_deplibs $lib"
- need_relink=yes
+ need_relink=no
fi

if test -n "$old_archive_from_expsyms_cmds"; then
@@ -0,0 +1,11 @@
--- macros.in.orig Fri Feb 21 19:27:43 2003
+++ macros.in Fri Feb 21 19:27:55 2003
@@ -163,7 +163,7 @@
%_tmppath %{_var}/tmp

# Path to top of build area.
-%_topdir %{_usrsrc}/redhat
+%_topdir %{_usrsrc}/%{_vendor}

# The path to the unzip executable (legacy, use %{__unzip} instead).
%_unzipbin %{__unzip}

0 comments on commit 5900774

Please sign in to comment.
You can’t perform that action at this time.