aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Lewis <glewis@FreeBSD.org>2004-03-05 02:26:10 +0000
committerGreg Lewis <glewis@FreeBSD.org>2004-03-05 02:26:10 +0000
commit63157dad83243393adff5843084d51e9b03574ab (patch)
tree89a8a823f2ae4f14430507b26c99df9d0ca601ad
parent6a093bc2328d1012ddb409cc8be081631c8438eb (diff)
downloadports-63157dad83243393adff5843084d51e9b03574ab.tar.gz
ports-63157dad83243393adff5843084d51e9b03574ab.zip
Notes
-rw-r--r--archivers/Makefile1
-rw-r--r--archivers/rpm4/Makefile61
-rw-r--r--archivers/rpm4/distinfo1
-rw-r--r--archivers/rpm4/files/patch-Makefile.in99
-rw-r--r--archivers/rpm4/files/patch-beecrypt::Makefile.in22
-rw-r--r--archivers/rpm4/files/patch-beecrypt::configure20
-rw-r--r--archivers/rpm4/files/patch-build::Makefile.in29
-rw-r--r--archivers/rpm4/files/patch-configure283
-rw-r--r--archivers/rpm4/files/patch-db3::configure11
-rw-r--r--archivers/rpm4/files/patch-doc::Makefile.in11
-rw-r--r--archivers/rpm4/files/patch-lib::Makefile.in34
-rw-r--r--archivers/rpm4/files/patch-lib::signature.c13
-rw-r--r--archivers/rpm4/files/patch-python::Makefile.in20
-rw-r--r--archivers/rpm4/files/patch-python::rpmmodule.c10
-rw-r--r--archivers/rpm4/files/patch-rpmdb::Makefile.in34
-rw-r--r--archivers/rpm4/files/patch-rpmio::Makefile.in85
-rw-r--r--archivers/rpm4/files/patch-tools::Makefile.in98
-rw-r--r--archivers/rpm4/pkg-deinstall17
-rw-r--r--archivers/rpm4/pkg-descr11
-rw-r--r--archivers/rpm4/pkg-install19
-rw-r--r--archivers/rpm4/pkg-plist155
-rw-r--r--archivers/rpm5/Makefile61
-rw-r--r--archivers/rpm5/distinfo1
-rw-r--r--archivers/rpm5/files/patch-Makefile.in99
-rw-r--r--archivers/rpm5/files/patch-beecrypt::Makefile.in22
-rw-r--r--archivers/rpm5/files/patch-beecrypt::configure20
-rw-r--r--archivers/rpm5/files/patch-build::Makefile.in29
-rw-r--r--archivers/rpm5/files/patch-configure283
-rw-r--r--archivers/rpm5/files/patch-db3::configure11
-rw-r--r--archivers/rpm5/files/patch-doc::Makefile.in11
-rw-r--r--archivers/rpm5/files/patch-lib::Makefile.in34
-rw-r--r--archivers/rpm5/files/patch-lib::signature.c13
-rw-r--r--archivers/rpm5/files/patch-python::Makefile.in20
-rw-r--r--archivers/rpm5/files/patch-python::rpmmodule.c10
-rw-r--r--archivers/rpm5/files/patch-rpmdb::Makefile.in34
-rw-r--r--archivers/rpm5/files/patch-rpmio::Makefile.in85
-rw-r--r--archivers/rpm5/files/patch-tools::Makefile.in98
-rw-r--r--archivers/rpm5/pkg-deinstall17
-rw-r--r--archivers/rpm5/pkg-descr11
-rw-r--r--archivers/rpm5/pkg-install19
-rw-r--r--archivers/rpm5/pkg-plist155
41 files changed, 2067 insertions, 0 deletions
diff --git a/archivers/Makefile b/archivers/Makefile
index 3d650278f123..93b3a7ef1055 100644
--- a/archivers/Makefile
+++ b/archivers/Makefile
@@ -53,6 +53,7 @@
SUBDIR += rox-archive
SUBDIR += rpm
SUBDIR += rpm2cpio
+ SUBDIR += rpm4
SUBDIR += ruby-bz2
SUBDIR += ruby-zip
SUBDIR += sectar
diff --git a/archivers/rpm4/Makefile b/archivers/rpm4/Makefile
new file mode 100644
index 000000000000..2c6ca5877949
--- /dev/null
+++ b/archivers/rpm4/Makefile
@@ -0,0 +1,61 @@
+# New ports collection makefile for: rpm
+# Date created: 6 May 2003
+# Whom: Greg Lewis <glewis@FreeBSD.org>
+#
+# $FreeBSD$
+
+PORTNAME= rpm
+PORTVERSION= 4.0.4
+CATEGORIES= archivers
+MASTER_SITES= ftp://ftp.rpm.org/pub/rpm/dist/ \
+ ftp://ftp.mirror.ac.uk/sites/ftp.rpm.org/pub/rpm/dist/
+MASTER_SITE_SUBDIR= rpm-4.0.x
+
+MAINTAINER= glewis@FreeBSD.org
+COMMENT= The RPM Package Manager
+
+LIB_DEPENDS= db3.3:${PORTSDIR}/databases/db3 \
+ iconv.3:${PORTSDIR}/converters/libiconv \
+ popt.0:${PORTSDIR}/devel/popt
+BUILD_DEPENDS= ${LOCALBASE}/bin/gsed:${PORTSDIR}/textproc/gsed
+.if !exists(/usr/bin/bzip2)
+LIB_DEPENDS+= bz2.1:${PORTSDIR}/archivers/bzip2
+.endif
+
+USE_LIBTOOL_VER=14
+USE_GMAKE= yes
+USE_GETTEXT= yes
+USE_REINPLACE= yes
+LATEST_LINK= rpm4
+CONFLICTS= beecrypt-* rpm-3.* rpm2cpio-*
+
+.if defined(WITH_PYTHON)
+CONFIGURE_ARGS+=--with-python=auto
+USE_PYTHON= yes
+PLIST_SUB+= PYTHON=""
+CPPFLAGS+= -I${PYTHON_INCLUDEDIR}
+LDFLAGS+= -L${PYTHON_LIBDIR}
+.else
+CONFIGURE_ARGS+=--without-python
+PLIST_SUB+= PYTHON="@comment "
+.endif
+
+CPPFLAGS+= -I${LOCALBASE}/include
+LDFLAGS+= -L${LOCALBASE}/lib
+
+CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
+CONFIGURE_ARGS+=--without-db
+CONFIGURE_ARGS+=--with-popt-prefix="${LOCALBASE}"
+CONFIGURE_ARGS+=--sysconfdir=${PREFIX}/etc
+
+MAN1= gendiff.1
+MAN8= rpm.8 rpm2cpio.8 rpmbuild.8
+
+post-patch:
+ ${REINPLACE_CMD} -e 's:%%LOCALBASE%%:${LOCALBASE}:' \
+ ${WRKSRC}/configure ${WRKSRC}/beecrypt/configure
+
+post-install:
+ ${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGDIR}/pkg-install ${PKGNAME} POST-INSTALL
+
+.include <bsd.port.mk>
diff --git a/archivers/rpm4/distinfo b/archivers/rpm4/distinfo
new file mode 100644
index 000000000000..4e125bc2a37e
--- /dev/null
+++ b/archivers/rpm4/distinfo
@@ -0,0 +1 @@
+MD5 (rpm-4.0.4.tar.gz) = b0c3093d2f0d850760e59ac1db9bf152
diff --git a/archivers/rpm4/files/patch-Makefile.in b/archivers/rpm4/files/patch-Makefile.in
new file mode 100644
index 000000000000..5a1a4ce6d989
--- /dev/null
+++ b/archivers/rpm4/files/patch-Makefile.in
@@ -0,0 +1,99 @@
+--- Makefile.in.orig Thu Feb 14 16:58:07 2002
++++ Makefile.in Thu Mar 4 11:29:06 2004
+@@ -195,7 +195,7 @@
+ rpm.magic rpmpopt-$(VERSION) rpmqv.c rpm.c
+
+
+-SUBDIRS = intl po @WITH_ZLIB_SUBDIR@ @WITH_DB_SUBDIR@ popt beecrypt rpmio rpmdb lib build misc @WITH_PYTHON_SUBDIR@ tools scripts tests doc .
++SUBDIRS = intl po @WITH_ZLIB_SUBDIR@ @WITH_DB_SUBDIR@ beecrypt rpmio rpmdb lib build misc @WITH_PYTHON_SUBDIR@ tools scripts tests doc .
+
+ INCLUDES = \
+ -I$(top_srcdir)/build \
+@@ -203,12 +203,14 @@
+ -I$(top_srcdir)/rpmdb \
+ -I$(top_srcdir)/rpmio \
+ -I$(top_srcdir)/beecrypt \
+- -I$(top_srcdir)/popt \
+ @WITH_ZLIB_INCLUDE@ \
++ @WITH_POPT_INCLUDE@ \
+ @INCPATH@
+
+
+-LIBS = -lrt -lpthread
++LIBS = @WITH_POPT_LIB@ \
++ @WITH_ZLIB_LIB@ \
++ @INTLLIBS@
+
+ myLDFLAGS = @LDFLAGS_STATIC@
+
+@@ -220,9 +222,7 @@
+ $(top_builddir)/lib/librpm.la \
+ $(top_builddir)/rpmdb/librpmdb.la \
+ $(top_builddir)/rpmio/librpmio.la \
+- $(top_builddir)/popt/libpopt.la \
+- @WITH_ZLIB_LIB@ \
+- @INTLLIBS@ @LIBMISC@
++ @LIBMISC@
+
+
+ rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
+@@ -294,31 +294,31 @@
+ rpm2cpio_OBJECTS = rpm2cpio.$(OBJEXT)
+ rpm2cpio_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
++$(top_builddir)/rpmio/librpmio.la
+ rpmb_OBJECTS = build.$(OBJEXT)
+ rpmb_DEPENDENCIES = rpmb.o $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
++$(top_builddir)/rpmio/librpmio.la
+ rpmd_OBJECTS =
+ rpmd_DEPENDENCIES = rpmd.o $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
++$(top_builddir)/rpmio/librpmio.la
+ rpmi_OBJECTS =
+ rpmi_DEPENDENCIES = rpmi.o $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
++$(top_builddir)/rpmio/librpmio.la
+ rpmk_OBJECTS =
+ rpmk_DEPENDENCIES = rpmk.o $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
++$(top_builddir)/rpmio/librpmio.la
+ rpmq_OBJECTS =
+ rpmq_DEPENDENCIES = rpmq.o $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
++$(top_builddir)/rpmio/librpmio.la
+ rpm_OBJECTS =
+ rpm_DEPENDENCIES = rpm.o $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
++$(top_builddir)/rpmio/librpmio.la
+ SCRIPTS = $(bin_SCRIPTS) $(pkglib_SCRIPTS)
+
+ CFLAGS = @CFLAGS@
+@@ -887,11 +887,9 @@
+ `make -s sources -C lib` \
+ `make -s sources -C rpmdb` \
+ `make -s sources -C rpmio` \
+- `make -s sources -C beecrypt` \
+- `make -s sources -C popt`
++ `make -s sources -C beecrypt`
+
+ install-data-local:
+- @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm
+ @rm -f $(DESTDIR)$(libdir)/rpmrc
+ @@LN_S@ rpm/rpmrc $(DESTDIR)$(libdir)/rpmrc
+ @rm -f $(DESTDIR)$(libdir)/rpmpopt
+@@ -946,7 +944,6 @@
+ solaris*|linux*) \
+ chmod u+x ./installplatform; DESTDIR="$(DESTDIR)" pkglibdir="$(pkglibdir)" ./installplatform rpmrc macros platform ;; \
+ esac
+- @$(mkinstalldirs) $(DESTDIR)/var/tmp
+
+ .PHONY: setperms
+ setperms:
diff --git a/archivers/rpm4/files/patch-beecrypt::Makefile.in b/archivers/rpm4/files/patch-beecrypt::Makefile.in
new file mode 100644
index 000000000000..cfa8d3d2f612
--- /dev/null
+++ b/archivers/rpm4/files/patch-beecrypt::Makefile.in
@@ -0,0 +1,22 @@
+--- beecrypt/Makefile.in.orig Wed Feb 13 16:03:22 2002
++++ beecrypt/Makefile.in Wed Mar 3 11:14:53 2004
+@@ -243,8 +243,8 @@
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+- echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
+- $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
++ echo "$(LIBTOOL) --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
++ $(LIBTOOL) --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
+ else :; fi; \
+ done
+
+@@ -478,7 +478,7 @@
+ install-exec-am: install-libLTLIBRARIES
+ install-exec: install-exec-recursive
+
+-install-data-am: install-pkgincludeHEADERS
++install-data-am:
+ install-data: install-data-recursive
+
+ install-am: all-am
diff --git a/archivers/rpm4/files/patch-beecrypt::configure b/archivers/rpm4/files/patch-beecrypt::configure
new file mode 100644
index 000000000000..3b878381e589
--- /dev/null
+++ b/archivers/rpm4/files/patch-beecrypt::configure
@@ -0,0 +1,20 @@
+--- beecrypt/configure.orig Wed Feb 13 16:03:22 2002
++++ beecrypt/configure Thu Mar 4 14:49:35 2004
+@@ -5473,7 +5473,7 @@
+ LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='/usr/local/bin/libtool14'
+
+ # Prevent multiple expansion
+
+@@ -6914,7 +6914,7 @@
+ fi
+ else
+ if test "$ac_cv_prog_gcc" = yes; then
+- CFLAGS="$CFLAGS -O3 -g"
++ CFLAGS="$CFLAGS -O2 -g"
+ if test "$ac_enable_optimized" = yes; then
+ case $target_cpu in
+ # XXX these need checking with versions of gcc
diff --git a/archivers/rpm4/files/patch-build::Makefile.in b/archivers/rpm4/files/patch-build::Makefile.in
new file mode 100644
index 000000000000..ba338cf2085a
--- /dev/null
+++ b/archivers/rpm4/files/patch-build::Makefile.in
@@ -0,0 +1,29 @@
+--- build/Makefile.in.orig Thu Feb 14 16:58:40 2002
++++ build/Makefile.in Thu Mar 4 01:07:04 2004
+@@ -194,7 +194,7 @@
+ -I$(top_srcdir)/rpmdb \
+ -I$(top_srcdir)/rpmio \
+ -I$(top_srcdir)/beecrypt \
+- -I$(top_srcdir)/popt \
++ @WITH_POPT_INCLUDE@ \
+ @INCPATH@
+
+
+@@ -395,7 +395,7 @@
+ ../beecrypt/mp32opt.h ../beecrypt/rsa.h ../beecrypt/rsakp.h \
+ ../beecrypt/rsapk.h rpmbuild.h ../lib/rpmcli.h ../lib/rpmlib.h \
+ ../rpmio/rpmmessages.h ../rpmio/rpmlog.h ../rpmio/rpmerr.h \
+- ../lib/header.h ../lib/hdrinline.h ../popt/popt.h \
++ ../lib/header.h ../lib/hdrinline.h \
+ ../rpmio/rpmmacro.h ../lib/stringbuf.h ../lib/misc.h rpmspec.h \
+ buildio.h ../lib/psm.h ../lib/fsm.h ../lib/cpio.h \
+ ../lib/depends.h myftw.h ../beecrypt/md5.h ../debug.h
+@@ -411,7 +411,7 @@
+ install-exec-am: install-libLTLIBRARIES
+ install-exec: install-exec-am
+
+-install-data-am: install-pkgincHEADERS install-data-local
++install-data-am: install-pkgincHEADERS
+ install-data: install-data-am
+
+ install-am: all-am
diff --git a/archivers/rpm4/files/patch-configure b/archivers/rpm4/files/patch-configure
new file mode 100644
index 000000000000..d487f9391d4c
--- /dev/null
+++ b/archivers/rpm4/files/patch-configure
@@ -0,0 +1,283 @@
+--- configure.orig Wed Feb 13 16:03:27 2002
++++ configure Thu Mar 4 12:55:48 2004
+@@ -186,6 +186,8 @@
+ ac_help="$ac_help
+ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib"
+ ac_help="$ac_help
++ --with-popt-prefix=DIR search for popt in DIR/include and DIR/lib"
++ac_help="$ac_help
+ --disable-nls do not use Native Language Support"
+ ac_help="$ac_help
+ --with-included-gettext use the GNU gettext library included here"
+@@ -6138,7 +6140,7 @@
+ LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='%%LOCALBASE%%/bin/libtool14'
+
+ # Prevent multiple expansion
+
+@@ -7381,6 +7383,8 @@
+ # AC_DEFINE(HAVE_GZSEEK)
+ #fi
+
++WITH_POPT_INCLUDE=$ac_default_prefix/include
++WITH_POPT_LIB=-L$ac_default_prefix/lib -lpopt
+
+
+
+@@ -8335,6 +8339,47 @@
+ DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb"
+ else
+ echo "$ac_t""no" 1>&6
++echo $ac_n "checking for db_create in -ldb3""... $ac_c" 1>&6
++echo "configure:8188: checking for db_create in -ldb3" >&5
++ac_lib_var=`echo db3'_'db_create | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ ac_save_LIBS="$LIBS"
++LIBS="-ldb3 $libthread $LIBS"
++cat > conftest.$ac_ext <<EOF
++#line 8196 "configure"
++#include "confdefs.h"
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char db_create();
++
++int main() {
++db_create()
++; return 0; }
++EOF
++if { (eval echo configure:8207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=no"
++fi
++rm -f conftest*
++LIBS="$ac_save_LIBS"
++
++fi
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb3"
++else
++ echo "$ac_t""no" 1>&6
++fi
++
++
+ fi
+
+
+@@ -8659,6 +8704,100 @@
+
+ fi
+
++# Check whether --with-popt-prefix or --without-popt-prefix was given.
++if test "${with_popt_prefix+set}" = set; then
++ withval="$with_popt_prefix"
++
++ for dir in `echo "$withval" | tr : ' '`; do
++ if test -d $dir/include; then
++ CPPFLAGS="$CPPFLAGS -I$dir/include";
++ WITH_POPT_INCLUDE="-I$dir/include";
++ fi
++ if test -d $dir/lib; then
++ LDFLAGS="$LDFLAGS -L$dir/lib";
++ WITH_POPT_LIB="-L$dir/lib -lpopt";
++ fi
++ done
++fi
++
++echo $ac_n "checking for popt.h""... $ac_c" 1>&6
++echo "configure:8724: checking for popt.h" >&5
++ac_lib_var=`echo popt'_'h | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ ac_save_CPPFLAGS="$CPPFLAGS"
++CPPFLAGS="${WITH_POPT_INCLUDE} $CPPFLAGS"
++cat > conftest.$ac_ext <<EOF
++#line 8494 "configure"
++#include "confdefs.h"
++#include <popt.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++
++int main() {
++return 0; }
++EOF
++if { (eval echo configure:8505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=no"
++fi
++rm -f conftest*
++CPPFLAGS="$ac_save_CPPFLAGS"
++
++fi
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++else
++ echo "$ac_t""no" 1>&6
++ echo "configure: error: sorry rpm requires popt.h" 1>&2; exit 1;
++fi
++
++echo $ac_n "checking for poptGetOptArg in -lpopt""... $ac_c" 1>&6
++echo "configure:8724: checking for poptGetOptArg in -lpopt" >&5
++ac_lib_var=`echo popt'_'poptGetOptArg | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ ac_save_LIBS="$LIBS"
++LIBS="${WITH_POPT_LIB} $LIBS"
++cat > conftest.$ac_ext <<EOF
++#line 8494 "configure"
++#include "confdefs.h"
++#include <popt.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++
++int main() {
++const char *foo = poptGetNextOpt(NULL);
++return 0; }
++EOF
++if { (eval echo configure:8505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=no"
++fi
++rm -f conftest*
++LIBS="$ac_save_LIBS"
++
++fi
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++else
++ echo "$ac_t""no" 1>&6
++ echo "configure: error: sorry rpm requires libpopt" 1>&2; exit 1;
++fi
+
+
+ for ac_func in personality
+@@ -12512,6 +12651,37 @@
+ WITH_PYTHON_VERSION=
+ if test $withval = auto ; then
+
++ echo $ac_n "checking for python 2.3""... $ac_c" 1>&6
++echo "configure:12517: checking for python 2.3" >&5
++ if test "$cross_compiling" = yes; then
++ withval=yes
++else
++ cat > conftest.$ac_ext <<EOF
++#line 12522 "configure"
++#include "confdefs.h"
++
++#include <python2.3/Python.h>
++main() {
++ exit(strncmp("2.3", PY_VERSION, 3));
++}
++EOF
++if { (eval echo configure:12530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++then
++ withval=yes
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -fr conftest*
++ withval=no
++fi
++rm -fr conftest*
++fi
++
++ echo "$ac_t""$withval" 1>&6
++ if test $withval = yes ; then
++ WITH_PYTHON_VERSION="2.3"
++ else
++
+ echo $ac_n "checking for python 2.2""... $ac_c" 1>&6
+ echo "configure:12517: checking for python 2.2" >&5
+ if test "$cross_compiling" = yes; then
+@@ -12577,6 +12747,8 @@
+
+ fi
+
++fi
++
+ if test -n "$WITH_PYTHON_VERSION" ; then
+ WITH_PYTHON_SUBDIR=python
+ WITH_PYTHON_SUBPACKAGE=1
+@@ -13130,21 +13302,7 @@
+
+ echo "$ac_t""$ROOT_GROUP" 1>&6
+
+-
+-if test "x$varprefix" = "x"; then
+- # For /usr and /usr/local, we want the 'var' directory to go
+- # in /var and /var/local respectively. For everything else,
+- # just put the 'var' directory in prefix/var.
+- case $prefix in
+- /usr | /usr/local )
+- varprefix=`echo $prefix | sed 's/usr/var/'` ;;
+- NONE)
+- varprefix=`echo $ac_default_prefix | sed 's/usr/var/'` ;;
+- *)
+- varprefix=$prefix/var ;;
+- esac
+-fi
+-
++varprefix=/var
+
+ if test "x$tmpdir" = "x"; then
+ if test -d $varprefix/tmp; then
+@@ -13349,7 +13507,7 @@
+
+
+
+-subdirs="popt beecrypt zlib $WITH_DB_SUBDIR"
++subdirs="beecrypt $WITH_DB_SUBDIR"
+
+
+ trap '' 1 2 15
+@@ -13578,6 +13736,8 @@
+ s%@WITH_ZLIB_SUBDIR@%$WITH_ZLIB_SUBDIR%g
+ s%@WITH_ZLIB_INCLUDE@%$WITH_ZLIB_INCLUDE%g
+ s%@WITH_ZLIB_LIB@%$WITH_ZLIB_LIB%g
++s%@WITH_POPT_INCLUDE@%$WITH_POPT_INCLUDE%g
++s%@WITH_POPT_LIB@%$WITH_POPT_LIB%g
+ s%@WITH_DB_SUBDIR@%$WITH_DB_SUBDIR%g
+ s%@WITH_INTERNAL_DB@%$WITH_INTERNAL_DB%g
+ s%@DBLIBSRCS@%$DBLIBSRCS%g
+@@ -13889,7 +14049,6 @@
+ ;;
+ esac
+ done
+- echo timestamp > popt/stamp-h.in
+ echo timestamp > beecrypt/stamp-h.in
+ echo timestamp > stamp-h.in
+
+@@ -13925,7 +14084,7 @@
+ esac
+ done
+
+- for ac_config_dir in popt beecrypt zlib $WITH_DB_SUBDIR; do
++ for ac_config_dir in beecrypt $WITH_DB_SUBDIR; do
+
+ # Do not complain, so a configure script can configure whichever
+ # parts of a large source tree are present.
diff --git a/archivers/rpm4/files/patch-db3::configure b/archivers/rpm4/files/patch-db3::configure
new file mode 100644
index 000000000000..fd38117a999b
--- /dev/null
+++ b/archivers/rpm4/files/patch-db3::configure
@@ -0,0 +1,11 @@
+--- db3/configure Fri Jul 27 10:20:43 2001
++++ db3/configure Wed Mar 27 10:04:21 2002
+@@ -15,7 +15,7 @@
+ rm -f $db_dist/../db/dist $db_dist/dist
+
+ mv Makefile Makefile.orig
+-cat Makefile.orig | sed -e 's/ -g$/ -g -O2/' -e '/^install:/c\
++cat Makefile.orig | gsed -e 's/ -g$/ -g -O2/' -e '/^install:/c\
+ .PHONY: listobjs\
+ listobjs:\
+ @echo $(OBJS) $(C_OBJS) \
diff --git a/archivers/rpm4/files/patch-doc::Makefile.in b/archivers/rpm4/files/patch-doc::Makefile.in
new file mode 100644
index 000000000000..9601ee90143e
--- /dev/null
+++ b/archivers/rpm4/files/patch-doc::Makefile.in
@@ -0,0 +1,11 @@
+--- doc/Makefile.in.orig Thu Mar 4 10:28:04 2004
++++ doc/Makefile.in Thu Mar 4 10:28:18 2004
+@@ -185,7 +185,7 @@
+ tmpdir = @tmpdir@
+ varprefix = @varprefix@
+
+-SUBDIRS = manual ja pl ru sk
++SUBDIRS = manual
+
+ man_MANS = gendiff.1 rpm.8 rpmbuild.8 rpm2cpio.8
+
diff --git a/archivers/rpm4/files/patch-lib::Makefile.in b/archivers/rpm4/files/patch-lib::Makefile.in
new file mode 100644
index 000000000000..0d15a5707976
--- /dev/null
+++ b/archivers/rpm4/files/patch-lib::Makefile.in
@@ -0,0 +1,34 @@
+--- lib/Makefile.in.orig Thu Feb 14 16:58:39 2002
++++ lib/Makefile.in Thu Mar 4 01:03:02 2004
+@@ -194,7 +194,7 @@
+ -I$(top_srcdir)/rpmdb \
+ -I$(top_srcdir)/rpmio \
+ -I$(top_srcdir)/beecrypt \
+- -I$(top_srcdir)/popt \
++ @WITH_POPT_INCLUDE@ \
+ @INCPATH@
+
+
+@@ -214,11 +214,10 @@
+ mylibpaths = \
+ -L$(top_builddir)/lib/.libs \
+ -L$(top_builddir)/rpmdb/.libs \
+- -L$(top_builddir)/rpmio/.libs \
+- -L$(top_builddir)/popt/.libs
++ -L$(top_builddir)/rpmio/.libs
+
+
+-mylibs = -lrpm -lrpmdb -lrpmio -lpopt @LIBS@ @INTLLIBS@ @LIBMISC@
++mylibs = -lrpm -lrpmdb -lrpmio @WITH_POPT_LIB@ @LIBS@ @INTLLIBS@ @LIBMISC@
+ LIBS =
+
+ lib_LTLIBRARIES = librpm.la
+@@ -421,7 +420,7 @@
+ install-exec-am: install-libLTLIBRARIES
+ install-exec: install-exec-am
+
+-install-data-am: install-pkgincHEADERS install-data-local
++install-data-am: install-pkgincHEADERS
+ install-data: install-data-am
+
+ install-am: all-am
diff --git a/archivers/rpm4/files/patch-lib::signature.c b/archivers/rpm4/files/patch-lib::signature.c
new file mode 100644
index 000000000000..ffaef839096a
--- /dev/null
+++ b/archivers/rpm4/files/patch-lib::signature.c
@@ -0,0 +1,13 @@
+--- lib/signature.c Sat Feb 2 13:55:49 2002
++++ lib/signature.c Wed Mar 27 10:21:31 2002
+@@ -11,6 +11,10 @@
+ * size key you like). We also honor PGPPATH finally.
+ */
+
++#ifdef __FreeBSD__
++extern char **environ;
++#endif
++
+ #include "system.h"
+
+ #include "rpmio_internal.h"
diff --git a/archivers/rpm4/files/patch-python::Makefile.in b/archivers/rpm4/files/patch-python::Makefile.in
new file mode 100644
index 000000000000..0597d5555a9e
--- /dev/null
+++ b/archivers/rpm4/files/patch-python::Makefile.in
@@ -0,0 +1,20 @@
+--- python/Makefile.in.orig Tue Mar 2 14:10:52 2004
++++ python/Makefile.in Tue Mar 2 14:11:24 2004
+@@ -197,7 +197,7 @@
+ -I$(top_srcdir)/rpmdb \
+ -I$(top_srcdir)/rpmio \
+ -I$(top_srcdir)/beecrypt \
+- -I$(top_srcdir)/popt \
++ @WITH_POPT_INCLUDE@ \
+ -I/usr/include/python${PYVER} \
+ @INCPATH@
+
+@@ -207,7 +207,7 @@
+ $(top_builddir)/lib/librpm.la \
+ $(top_builddir)/rpmdb/librpmdb.la \
+ $(top_builddir)/rpmio/librpmio.la \
+- $(top_builddir)/popt/libpopt.la
++ @WITH_POPT_LIB@
+
+
+ LDADD =
diff --git a/archivers/rpm4/files/patch-python::rpmmodule.c b/archivers/rpm4/files/patch-python::rpmmodule.c
new file mode 100644
index 000000000000..181636323965
--- /dev/null
+++ b/archivers/rpm4/files/patch-python::rpmmodule.c
@@ -0,0 +1,10 @@
+--- python/rpmmodule.c Sun Feb 3 16:59:57 2002
++++ python/rpmmodule.c Wed Mar 27 10:25:35 2002
+@@ -2,7 +2,6 @@
+ * \file python/rpmmodule.c
+ */
+
+-#include <alloca.h>
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <time.h>
diff --git a/archivers/rpm4/files/patch-rpmdb::Makefile.in b/archivers/rpm4/files/patch-rpmdb::Makefile.in
new file mode 100644
index 000000000000..ea423fa2c615
--- /dev/null
+++ b/archivers/rpm4/files/patch-rpmdb::Makefile.in
@@ -0,0 +1,34 @@
+--- rpmdb/Makefile.in.orig Thu Feb 14 16:58:38 2002
++++ rpmdb/Makefile.in Thu Mar 4 00:59:48 2004
+@@ -194,7 +194,7 @@
+ -I$(top_srcdir)/lib \
+ -I$(top_srcdir)/rpmio \
+ -I$(top_srcdir)/beecrypt \
+- -I$(top_srcdir)/popt \
++ @WITH_POPT_INCLUDE@ \
+ @INCPATH@
+
+
+@@ -206,11 +206,10 @@
+
+ mylibpaths = \
+ -L$(top_builddir)/lib/.libs \
+- -L$(top_builddir)/rpmio/.libs \
+- -L$(top_builddir)/popt/.libs
++ -L$(top_builddir)/rpmio/.libs
+
+
+-mylibs = -lrpm -lrpmio -lpopt @LIBS@ @INTLLIBS@ @LIBMISC@
++mylibs = -lrpm -lrpmio @WITH_POPT_LIB@ @LIBS@ @INTLLIBS@ @LIBMISC@
+ LIBS =
+
+ DB3LOBJS = $(shell cat $(top_builddir)/$(WITH_DB_SUBDIR)/db3lobjs)
+@@ -404,7 +403,7 @@
+ install-exec-am: install-libLTLIBRARIES
+ install-exec: install-exec-am
+
+-install-data-am: install-pkgincHEADERS install-data-local
++install-data-am: install-pkgincHEADERS
+ install-data: install-data-am
+
+ install-am: all-am
diff --git a/archivers/rpm4/files/patch-rpmio::Makefile.in b/archivers/rpm4/files/patch-rpmio::Makefile.in
new file mode 100644
index 000000000000..87671759506e
--- /dev/null
+++ b/archivers/rpm4/files/patch-rpmio::Makefile.in
@@ -0,0 +1,85 @@
+--- rpmio/Makefile.in.orig Thu Feb 14 16:58:37 2002
++++ rpmio/Makefile.in Thu Mar 4 00:55:37 2004
+@@ -197,7 +197,7 @@
+ -I$(top_srcdir)/build \
+ -I$(top_srcdir)/lib \
+ -I$(top_srcdir)/beecrypt \
+- -I$(top_srcdir)/popt \
++ @WITH_POPT_INCLUDE@ \
+ @WITH_ZLIB_INCLUDE@ \
+ @INCPATH@
+
+@@ -209,7 +209,7 @@
+
+ noinst_HEADERS = rpmio_internal.h rpmpgp.h
+
+-LIBS = @LIBS@ @WITH_ZLIB_LIB@ -lrt -lpthread
++LIBS = @LIBS@ @WITH_ZLIB_LIB@
+
+ BEECRYPTLOBJS = $(shell cat $(top_builddir)/beecrypt/listobjs)
+
+@@ -222,18 +222,18 @@
+ librpmio_la_DEPENDENCIES = .created
+
+ tdigest_SOURCES = tdigest.c
+-tdigest_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
++tdigest_LDADD = librpmio.la @WITH_POPT_LIB@
+
+ trpmio_SOURCES = trpmio.c
+-trpmio_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
++trpmio_LDADD = librpmio.la @WITH_POPT_LIB@
+
+ tkey_SOURCES = tkey.c
+ tkey_LDFLAGS = -all-static
+-tkey_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
++tkey_LDADD = librpmio.la @WITH_POPT_LIB@
+
+ tring_SOURCES = tring.c
+ tring_LDFLAGS = -all-static
+-tring_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
++tring_LDADD = librpmio.la @WITH_POPT_LIB@
+
+ dumpasn1_SOURCES = dumpasn1.c
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+@@ -248,15 +248,17 @@
+ librpmio_la_OBJECTS = digest.lo macro.lo rpmio.lo rpmlog.lo \
+ rpmmalloc.lo rpmpgp.lo rpmrpc.lo strcasecmp.lo stubs.lo url.lo ugid.lo
+ tdigest_OBJECTS = tdigest.$(OBJEXT)
+-tdigest_DEPENDENCIES = librpmio.la $(top_builddir)/popt/libpopt.la
+-tdigest_LDFLAGS =
++tdigest_DEPENDENCIES = librpmio.la
++tdigest_LDFLAGS = @WITH_POPT_LIB@
+ tkey_OBJECTS = tkey.$(OBJEXT)
+-tkey_DEPENDENCIES = librpmio.la $(top_builddir)/popt/libpopt.la
++tkey_DEPENDENCIES = librpmio.la
++tkey_LDFLAGS = @WITH_POPT_LIB@
+ tring_OBJECTS = tring.$(OBJEXT)
+-tring_DEPENDENCIES = librpmio.la $(top_builddir)/popt/libpopt.la
++tring_DEPENDENCIES = librpmio.la
++tring_LDFLAGS = @WITH_POPT_LIB@
+ trpmio_OBJECTS = trpmio.$(OBJEXT)
+-trpmio_DEPENDENCIES = librpmio.la $(top_builddir)/popt/libpopt.la
+-trpmio_LDFLAGS =
++trpmio_DEPENDENCIES = librpmio.la
++trpmio_LDFLAGS = @WITH_POPT_LIB@
+ dumpasn1_OBJECTS = dumpasn1.$(OBJEXT)
+ dumpasn1_LDADD = $(LDADD)
+ dumpasn1_DEPENDENCIES =
+@@ -461,7 +463,7 @@
+ install-exec-am: install-libLTLIBRARIES
+ install-exec: install-exec-am
+
+-install-data-am: install-pkgincHEADERS install-data-local
++install-data-am: install-pkgincHEADERS
+ install-data: install-data-am
+
+ install-am: all-am
+@@ -535,7 +537,7 @@
+ mv .librpmio.la librpmio.la
+
+ $(top_builddir)/beecrypt/listobjs:
+- make -C $(top_builddir)/beecrypt listobjs
++ $(MAKE) -C $(top_builddir)/beecrypt listobjs
+
+ .created: $(top_builddir)/beecrypt/listobjs
+ for lo in $(BEECRYPTLOBJS); do \
diff --git a/archivers/rpm4/files/patch-tools::Makefile.in b/archivers/rpm4/files/patch-tools::Makefile.in
new file mode 100644
index 000000000000..511ce7dbe768
--- /dev/null
+++ b/archivers/rpm4/files/patch-tools::Makefile.in
@@ -0,0 +1,98 @@
+--- tools/Makefile.in.orig Thu Feb 14 16:58:42 2002
++++ tools/Makefile.in Sun Sep 7 00:49:29 2003
+@@ -194,7 +194,7 @@
+ -I$(top_srcdir)/lib \
+ -I$(top_srcdir)/rpmdb \
+ -I$(top_srcdir)/rpmio \
+- -I$(top_srcdir)/popt \
++ @WITH_POPT_INCLUDE@ \
+ @WITH_ZLIB_INCLUDE@ \
+ @INCPATH@ \
+ -I$(top_srcdir)/misc
+@@ -212,7 +212,6 @@
+ $(top_builddir)/lib/librpm.la \
+ $(top_builddir)/rpmdb/librpmdb.la \
+ $(top_builddir)/rpmio/librpmio.la \
+- $(top_builddir)/popt/libpopt.la \
+ @WITH_ZLIB_LIB@ \
+ @INTLLIBS@
+
+@@ -249,61 +248,61 @@
+ rpminject_LDADD = $(LDADD)
+ rpminject_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
+-rpminject_LDFLAGS =
++$(top_builddir)/rpmio/librpmio.la
++rpminject_LDFLAGS = @WITH_POPT_LIB@
+ rpmsort_OBJECTS = rpmsort.$(OBJEXT)
+ rpmsort_LDADD = $(LDADD)
+ rpmsort_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
++$(top_builddir)/rpmio/librpmio.la
+ dump_SOURCES = dump.c
+ dump_OBJECTS = dump.$(OBJEXT)
+ dump_LDADD = $(LDADD)
+ dump_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
+-dump_LDFLAGS =
++$(top_builddir)/rpmio/librpmio.la
++dump_LDFLAGS = @WITH_POPT_LIB@
+ dumpdb_SOURCES = dumpdb.c
+ dumpdb_OBJECTS = dumpdb.$(OBJEXT)
+ dumpdb_LDADD = $(LDADD)
+ dumpdb_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
+-dumpdb_LDFLAGS =
++$(top_builddir)/rpmio/librpmio.la
++dumpdb_LDFLAGS = @WITH_POPT_LIB@
+ rpmarchive_SOURCES = rpmarchive.c
+ rpmarchive_OBJECTS = rpmarchive.$(OBJEXT)
+ rpmarchive_LDADD = $(LDADD)
+ rpmarchive_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
+-rpmarchive_LDFLAGS =
++$(top_builddir)/rpmio/librpmio.la
++rpmarchive_LDFLAGS = @WITH_POPT_LIB@
+ rpmheader_SOURCES = rpmheader.c
+ rpmheader_OBJECTS = rpmheader.$(OBJEXT)
+ rpmheader_LDADD = $(LDADD)
+ rpmheader_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
+-rpmheader_LDFLAGS =
++$(top_builddir)/rpmio/librpmio.la
++rpmheader_LDFLAGS = @WITH_POPT_LIB@
+ rpmlead_SOURCES = rpmlead.c
+ rpmlead_OBJECTS = rpmlead.$(OBJEXT)
+ rpmlead_LDADD = $(LDADD)
+ rpmlead_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
+-rpmlead_LDFLAGS =
++$(top_builddir)/rpmio/librpmio.la
++rpmlead_LDFLAGS = @WITH_POPT_LIB@
+ rpmsignature_SOURCES = rpmsignature.c
+ rpmsignature_OBJECTS = rpmsignature.$(OBJEXT)
+ rpmsignature_LDADD = $(LDADD)
+ rpmsignature_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
+-rpmsignature_LDFLAGS =
++$(top_builddir)/rpmio/librpmio.la
++rpmsignature_LDFLAGS = @WITH_POPT_LIB@
+ javadeps_OBJECTS = javadeps.$(OBJEXT)
+ javadeps_LDADD = $(LDADD)
+ javadeps_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
+-javadeps_LDFLAGS =
++$(top_builddir)/rpmio/librpmio.la
++javadeps_LDFLAGS = @WITH_POPT_LIB@
+ CFLAGS = @CFLAGS@
+ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+ LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
diff --git a/archivers/rpm4/pkg-deinstall b/archivers/rpm4/pkg-deinstall
new file mode 100644
index 000000000000..fd2d7200dbd6
--- /dev/null
+++ b/archivers/rpm4/pkg-deinstall
@@ -0,0 +1,17 @@
+#!/bin/sh
+# $FreeBSD$
+
+# The RPM database directory
+RPM_DATABASE_DIR=/var/lib/rpm
+
+# Provide instructions for removing the RPM database.
+if [ "$2" = "POST-DEINSTALL" ]; then
+ if [ -d "${RPM_DATABASE_DIR}" ]; then
+ echo ""
+ echo "If you are removing RPM permanently you can remove the"
+ echo "RPM database with the command:"
+ echo ""
+ echo " rm -rf ${RPM_DATABASE_DIR}"
+ echo ""
+ fi
+fi
diff --git a/archivers/rpm4/pkg-descr b/archivers/rpm4/pkg-descr
new file mode 100644
index 000000000000..3c5746dcc32e
--- /dev/null
+++ b/archivers/rpm4/pkg-descr
@@ -0,0 +1,11 @@
+The Red Hat Package Manager (RPM) is a powerful command line driven
+package management system capable of installing, uninstalling,
+verifying, querying, and updating computer software packages. Each
+software package consists of an archive of files along with information
+about the package like its version, a description, and the like.
+There is also a related API ("Application Program Interface"),
+permitting advanced developers to bypass 'shelling out' to a command
+line, and to manage such transactions from within a native coding
+language.
+
+WWW: http://www.rpm.org/
diff --git a/archivers/rpm4/pkg-install b/archivers/rpm4/pkg-install
new file mode 100644
index 000000000000..db4592c15325
--- /dev/null
+++ b/archivers/rpm4/pkg-install
@@ -0,0 +1,19 @@
+#!/bin/sh
+# $FreeBSD$
+
+# The RPM database directory
+RPM_DATABASE_DIR=/var/lib/rpm
+
+# Provide instructions for initialising the RPM database.
+if [ "$2" = "POST-INSTALL" ]; then
+ if [ ! -d "${RPM_DATABASE_DIR}" ]; then
+ echo ""
+ echo "No RPM database found. If you wish to use RPM to install"
+ echo "RPM packages the you will need to initialise the database"
+ echo "with the commands:"
+ echo ""
+ echo " mkdir -p ${RPM_DATABASE_DIR}"
+ echo " ${PKG_PREFIX}/bin/rpm --initdb"
+ echo ""
+ fi
+fi
diff --git a/archivers/rpm4/pkg-plist b/archivers/rpm4/pkg-plist
new file mode 100644
index 000000000000..3596f6f5e6da
--- /dev/null
+++ b/archivers/rpm4/pkg-plist
@@ -0,0 +1,155 @@
+bin/gendiff
+bin/rpm
+bin/rpm2cpio
+bin/rpmbuild
+bin/rpmdb
+bin/rpme
+bin/rpmi
+bin/rpmquery
+bin/rpmsign
+bin/rpmu
+bin/rpmverify
+include/rpm/hdrinline.h
+include/rpm/header.h
+include/rpm/misc.h
+include/rpm/rpmbuild.h
+include/rpm/rpmcli.h
+include/rpm/rpmdb.h
+include/rpm/rpmerr.h
+include/rpm/rpmio.h
+include/rpm/rpmlib.h
+include/rpm/rpmlog.h
+include/rpm/rpmmacro.h
+include/rpm/rpmmessages.h
+include/rpm/rpmspec.h
+include/rpm/rpmurl.h
+include/rpm/stringbuf.h
+include/rpm/ugid.h
+lib/libbeecrypt.a
+lib/libbeecrypt.so
+lib/libbeecrypt.so.4
+lib/librpm-4.0.4.so
+lib/librpm.a
+lib/librpm.so
+lib/librpmbuild-4.0.4.so
+lib/librpmbuild.a
+lib/librpmbuild.so
+lib/librpmdb-4.0.4.so
+lib/librpmdb.a
+lib/librpmdb.so
+lib/librpmio-4.0.4.so
+lib/librpmio.a
+lib/librpmio.so
+%%PYTHON%%%%PYTHON_SITELIBDIR%%/poptmodule.so
+%%PYTHON%%%%PYTHON_SITELIBDIR%%/rpmmodule.so
+lib/rpm/Specfile.pm
+lib/rpm/brp-compress
+lib/rpm/brp-redhat
+lib/rpm/brp-sparc64-linux
+lib/rpm/brp-strip
+lib/rpm/brp-strip-comment-note
+lib/rpm/brp-strip-shared
+lib/rpm/check-prereqs
+lib/rpm/config.guess
+lib/rpm/config.site
+lib/rpm/config.sub
+lib/rpm/convertrpmrc.sh
+lib/rpm/cpanflute
+lib/rpm/cpanflute2
+lib/rpm/cross-build
+lib/rpm/find-lang.sh
+lib/rpm/find-prov.pl
+lib/rpm/find-provides
+lib/rpm/find-provides.perl
+lib/rpm/find-req.pl
+lib/rpm/find-requires
+lib/rpm/find-requires.perl
+lib/rpm/get_magic.pl
+lib/rpm/getpo.sh
+lib/rpm/http.req
+lib/rpm/javadeps
+lib/rpm/macros
+lib/rpm/magic.prov
+lib/rpm/magic.req
+lib/rpm/mkinstalldirs
+lib/rpm/perl.prov
+lib/rpm/perl.req
+lib/rpm/rpm.daily
+lib/rpm/rpm.log
+lib/rpm/rpm.xinetd
+lib/rpm/rpm2cpio.sh
+lib/rpm/rpmb
+lib/rpm/rpmd
+lib/rpm/rpmdiff
+lib/rpm/rpmdiff.cgi
+lib/rpm/rpme
+lib/rpm/rpmi
+lib/rpm/rpmk
+lib/rpm/rpmpopt-4.0.4
+lib/rpm/rpmq
+lib/rpm/rpmrc
+lib/rpm/rpmt
+lib/rpm/rpmu
+lib/rpm/rpmv
+lib/rpm/sql.prov
+lib/rpm/sql.req
+lib/rpm/tcl.req
+lib/rpm/trpm
+lib/rpm/u_pkg.sh
+lib/rpm/vpkg-provides.sh
+lib/rpm/vpkg-provides2.sh
+lib/rpmpopt
+lib/rpmrc
+share/locale/cs/LC_MESSAGES/rpm.mo
+share/locale/da/LC_MESSAGES/rpm.mo
+share/locale/de/LC_MESSAGES/rpm.mo
+share/locale/en_RN/LC_MESSAGES/rpm.mo
+share/locale/es/LC_MESSAGES/rpm.mo
+share/locale/eu_ES/LC_MESSAGES/rpm.mo
+share/locale/fi/LC_MESSAGES/rpm.mo
+share/locale/fr/LC_MESSAGES/rpm.mo
+share/locale/gl/LC_MESSAGES/rpm.mo
+share/locale/hu/LC_MESSAGES/rpm.mo
+share/locale/id/LC_MESSAGES/rpm.mo
+share/locale/is/LC_MESSAGES/rpm.mo
+share/locale/it/LC_MESSAGES/rpm.mo
+share/locale/ja/LC_MESSAGES/rpm.mo
+share/locale/ko/LC_MESSAGES/rpm.mo
+share/locale/no/LC_MESSAGES/rpm.mo
+share/locale/pl/LC_MESSAGES/rpm.mo
+share/locale/pt/LC_MESSAGES/rpm.mo
+share/locale/pt_BR/LC_MESSAGES/rpm.mo
+share/locale/ro/LC_MESSAGES/rpm.mo
+share/locale/ru/LC_MESSAGES/rpm.mo
+share/locale/sk/LC_MESSAGES/rpm.mo
+share/locale/sl/LC_MESSAGES/rpm.mo
+share/locale/sr/LC_MESSAGES/rpm.mo
+share/locale/sv/LC_MESSAGES/rpm.mo
+share/locale/tr/LC_MESSAGES/rpm.mo
+share/locale/uk/LC_MESSAGES/rpm.mo
+share/locale/wa/LC_MESSAGES/rpm.mo
+share/locale/zh/LC_MESSAGES/rpm.mo
+share/locale/zh_CN.GB2312/LC_MESSAGES/rpm.mo
+@dirrm lib/rpm
+@dirrm include/rpm
+@unexec rmdir %D/src/portbld/SRPMS 2>/dev/null || true
+@unexec rmdir %D/src/portbld/SPECS 2>/dev/null || true
+@unexec rmdir %D/src/portbld/SOURCES 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/x86_64 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/sparcv9 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/sparc64 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/sparc 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/ppc64 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/ppc 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/noarch 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/ia64 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/i686 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/i586 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/i486 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/i386 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/amd64 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/alphaev6 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/alpha 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS 2>/dev/null || true
+@unexec rmdir %D/src/portbld/BUILD 2>/dev/null || true
+@unexec rmdir %D/src/portbld 2>/dev/null || true
diff --git a/archivers/rpm5/Makefile b/archivers/rpm5/Makefile
new file mode 100644
index 000000000000..2c6ca5877949
--- /dev/null
+++ b/archivers/rpm5/Makefile
@@ -0,0 +1,61 @@
+# New ports collection makefile for: rpm
+# Date created: 6 May 2003
+# Whom: Greg Lewis <glewis@FreeBSD.org>
+#
+# $FreeBSD$
+
+PORTNAME= rpm
+PORTVERSION= 4.0.4
+CATEGORIES= archivers
+MASTER_SITES= ftp://ftp.rpm.org/pub/rpm/dist/ \
+ ftp://ftp.mirror.ac.uk/sites/ftp.rpm.org/pub/rpm/dist/
+MASTER_SITE_SUBDIR= rpm-4.0.x
+
+MAINTAINER= glewis@FreeBSD.org
+COMMENT= The RPM Package Manager
+
+LIB_DEPENDS= db3.3:${PORTSDIR}/databases/db3 \
+ iconv.3:${PORTSDIR}/converters/libiconv \
+ popt.0:${PORTSDIR}/devel/popt
+BUILD_DEPENDS= ${LOCALBASE}/bin/gsed:${PORTSDIR}/textproc/gsed
+.if !exists(/usr/bin/bzip2)
+LIB_DEPENDS+= bz2.1:${PORTSDIR}/archivers/bzip2
+.endif
+
+USE_LIBTOOL_VER=14
+USE_GMAKE= yes
+USE_GETTEXT= yes
+USE_REINPLACE= yes
+LATEST_LINK= rpm4
+CONFLICTS= beecrypt-* rpm-3.* rpm2cpio-*
+
+.if defined(WITH_PYTHON)
+CONFIGURE_ARGS+=--with-python=auto
+USE_PYTHON= yes
+PLIST_SUB+= PYTHON=""
+CPPFLAGS+= -I${PYTHON_INCLUDEDIR}
+LDFLAGS+= -L${PYTHON_LIBDIR}
+.else
+CONFIGURE_ARGS+=--without-python
+PLIST_SUB+= PYTHON="@comment "
+.endif
+
+CPPFLAGS+= -I${LOCALBASE}/include
+LDFLAGS+= -L${LOCALBASE}/lib
+
+CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
+CONFIGURE_ARGS+=--without-db
+CONFIGURE_ARGS+=--with-popt-prefix="${LOCALBASE}"
+CONFIGURE_ARGS+=--sysconfdir=${PREFIX}/etc
+
+MAN1= gendiff.1
+MAN8= rpm.8 rpm2cpio.8 rpmbuild.8
+
+post-patch:
+ ${REINPLACE_CMD} -e 's:%%LOCALBASE%%:${LOCALBASE}:' \
+ ${WRKSRC}/configure ${WRKSRC}/beecrypt/configure
+
+post-install:
+ ${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGDIR}/pkg-install ${PKGNAME} POST-INSTALL
+
+.include <bsd.port.mk>
diff --git a/archivers/rpm5/distinfo b/archivers/rpm5/distinfo
new file mode 100644
index 000000000000..4e125bc2a37e
--- /dev/null
+++ b/archivers/rpm5/distinfo
@@ -0,0 +1 @@
+MD5 (rpm-4.0.4.tar.gz) = b0c3093d2f0d850760e59ac1db9bf152
diff --git a/archivers/rpm5/files/patch-Makefile.in b/archivers/rpm5/files/patch-Makefile.in
new file mode 100644
index 000000000000..5a1a4ce6d989
--- /dev/null
+++ b/archivers/rpm5/files/patch-Makefile.in
@@ -0,0 +1,99 @@
+--- Makefile.in.orig Thu Feb 14 16:58:07 2002
++++ Makefile.in Thu Mar 4 11:29:06 2004
+@@ -195,7 +195,7 @@
+ rpm.magic rpmpopt-$(VERSION) rpmqv.c rpm.c
+
+
+-SUBDIRS = intl po @WITH_ZLIB_SUBDIR@ @WITH_DB_SUBDIR@ popt beecrypt rpmio rpmdb lib build misc @WITH_PYTHON_SUBDIR@ tools scripts tests doc .
++SUBDIRS = intl po @WITH_ZLIB_SUBDIR@ @WITH_DB_SUBDIR@ beecrypt rpmio rpmdb lib build misc @WITH_PYTHON_SUBDIR@ tools scripts tests doc .
+
+ INCLUDES = \
+ -I$(top_srcdir)/build \
+@@ -203,12 +203,14 @@
+ -I$(top_srcdir)/rpmdb \
+ -I$(top_srcdir)/rpmio \
+ -I$(top_srcdir)/beecrypt \
+- -I$(top_srcdir)/popt \
+ @WITH_ZLIB_INCLUDE@ \
++ @WITH_POPT_INCLUDE@ \
+ @INCPATH@
+
+
+-LIBS = -lrt -lpthread
++LIBS = @WITH_POPT_LIB@ \
++ @WITH_ZLIB_LIB@ \
++ @INTLLIBS@
+
+ myLDFLAGS = @LDFLAGS_STATIC@
+
+@@ -220,9 +222,7 @@
+ $(top_builddir)/lib/librpm.la \
+ $(top_builddir)/rpmdb/librpmdb.la \
+ $(top_builddir)/rpmio/librpmio.la \
+- $(top_builddir)/popt/libpopt.la \
+- @WITH_ZLIB_LIB@ \
+- @INTLLIBS@ @LIBMISC@
++ @LIBMISC@
+
+
+ rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
+@@ -294,31 +294,31 @@
+ rpm2cpio_OBJECTS = rpm2cpio.$(OBJEXT)
+ rpm2cpio_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
++$(top_builddir)/rpmio/librpmio.la
+ rpmb_OBJECTS = build.$(OBJEXT)
+ rpmb_DEPENDENCIES = rpmb.o $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
++$(top_builddir)/rpmio/librpmio.la
+ rpmd_OBJECTS =
+ rpmd_DEPENDENCIES = rpmd.o $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
++$(top_builddir)/rpmio/librpmio.la
+ rpmi_OBJECTS =
+ rpmi_DEPENDENCIES = rpmi.o $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
++$(top_builddir)/rpmio/librpmio.la
+ rpmk_OBJECTS =
+ rpmk_DEPENDENCIES = rpmk.o $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
++$(top_builddir)/rpmio/librpmio.la
+ rpmq_OBJECTS =
+ rpmq_DEPENDENCIES = rpmq.o $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
++$(top_builddir)/rpmio/librpmio.la
+ rpm_OBJECTS =
+ rpm_DEPENDENCIES = rpm.o $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
++$(top_builddir)/rpmio/librpmio.la
+ SCRIPTS = $(bin_SCRIPTS) $(pkglib_SCRIPTS)
+
+ CFLAGS = @CFLAGS@
+@@ -887,11 +887,9 @@
+ `make -s sources -C lib` \
+ `make -s sources -C rpmdb` \
+ `make -s sources -C rpmio` \
+- `make -s sources -C beecrypt` \
+- `make -s sources -C popt`
++ `make -s sources -C beecrypt`
+
+ install-data-local:
+- @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm
+ @rm -f $(DESTDIR)$(libdir)/rpmrc
+ @@LN_S@ rpm/rpmrc $(DESTDIR)$(libdir)/rpmrc
+ @rm -f $(DESTDIR)$(libdir)/rpmpopt
+@@ -946,7 +944,6 @@
+ solaris*|linux*) \
+ chmod u+x ./installplatform; DESTDIR="$(DESTDIR)" pkglibdir="$(pkglibdir)" ./installplatform rpmrc macros platform ;; \
+ esac
+- @$(mkinstalldirs) $(DESTDIR)/var/tmp
+
+ .PHONY: setperms
+ setperms:
diff --git a/archivers/rpm5/files/patch-beecrypt::Makefile.in b/archivers/rpm5/files/patch-beecrypt::Makefile.in
new file mode 100644
index 000000000000..cfa8d3d2f612
--- /dev/null
+++ b/archivers/rpm5/files/patch-beecrypt::Makefile.in
@@ -0,0 +1,22 @@
+--- beecrypt/Makefile.in.orig Wed Feb 13 16:03:22 2002
++++ beecrypt/Makefile.in Wed Mar 3 11:14:53 2004
+@@ -243,8 +243,8 @@
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+- echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
+- $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
++ echo "$(LIBTOOL) --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
++ $(LIBTOOL) --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
+ else :; fi; \
+ done
+
+@@ -478,7 +478,7 @@
+ install-exec-am: install-libLTLIBRARIES
+ install-exec: install-exec-recursive
+
+-install-data-am: install-pkgincludeHEADERS
++install-data-am:
+ install-data: install-data-recursive
+
+ install-am: all-am
diff --git a/archivers/rpm5/files/patch-beecrypt::configure b/archivers/rpm5/files/patch-beecrypt::configure
new file mode 100644
index 000000000000..3b878381e589
--- /dev/null
+++ b/archivers/rpm5/files/patch-beecrypt::configure
@@ -0,0 +1,20 @@
+--- beecrypt/configure.orig Wed Feb 13 16:03:22 2002
++++ beecrypt/configure Thu Mar 4 14:49:35 2004
+@@ -5473,7 +5473,7 @@
+ LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='/usr/local/bin/libtool14'
+
+ # Prevent multiple expansion
+
+@@ -6914,7 +6914,7 @@
+ fi
+ else
+ if test "$ac_cv_prog_gcc" = yes; then
+- CFLAGS="$CFLAGS -O3 -g"
++ CFLAGS="$CFLAGS -O2 -g"
+ if test "$ac_enable_optimized" = yes; then
+ case $target_cpu in
+ # XXX these need checking with versions of gcc
diff --git a/archivers/rpm5/files/patch-build::Makefile.in b/archivers/rpm5/files/patch-build::Makefile.in
new file mode 100644
index 000000000000..ba338cf2085a
--- /dev/null
+++ b/archivers/rpm5/files/patch-build::Makefile.in
@@ -0,0 +1,29 @@
+--- build/Makefile.in.orig Thu Feb 14 16:58:40 2002
++++ build/Makefile.in Thu Mar 4 01:07:04 2004
+@@ -194,7 +194,7 @@
+ -I$(top_srcdir)/rpmdb \
+ -I$(top_srcdir)/rpmio \
+ -I$(top_srcdir)/beecrypt \
+- -I$(top_srcdir)/popt \
++ @WITH_POPT_INCLUDE@ \
+ @INCPATH@
+
+
+@@ -395,7 +395,7 @@
+ ../beecrypt/mp32opt.h ../beecrypt/rsa.h ../beecrypt/rsakp.h \
+ ../beecrypt/rsapk.h rpmbuild.h ../lib/rpmcli.h ../lib/rpmlib.h \
+ ../rpmio/rpmmessages.h ../rpmio/rpmlog.h ../rpmio/rpmerr.h \
+- ../lib/header.h ../lib/hdrinline.h ../popt/popt.h \
++ ../lib/header.h ../lib/hdrinline.h \
+ ../rpmio/rpmmacro.h ../lib/stringbuf.h ../lib/misc.h rpmspec.h \
+ buildio.h ../lib/psm.h ../lib/fsm.h ../lib/cpio.h \
+ ../lib/depends.h myftw.h ../beecrypt/md5.h ../debug.h
+@@ -411,7 +411,7 @@
+ install-exec-am: install-libLTLIBRARIES
+ install-exec: install-exec-am
+
+-install-data-am: install-pkgincHEADERS install-data-local
++install-data-am: install-pkgincHEADERS
+ install-data: install-data-am
+
+ install-am: all-am
diff --git a/archivers/rpm5/files/patch-configure b/archivers/rpm5/files/patch-configure
new file mode 100644
index 000000000000..d487f9391d4c
--- /dev/null
+++ b/archivers/rpm5/files/patch-configure
@@ -0,0 +1,283 @@
+--- configure.orig Wed Feb 13 16:03:27 2002
++++ configure Thu Mar 4 12:55:48 2004
+@@ -186,6 +186,8 @@
+ ac_help="$ac_help
+ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib"
+ ac_help="$ac_help
++ --with-popt-prefix=DIR search for popt in DIR/include and DIR/lib"
++ac_help="$ac_help
+ --disable-nls do not use Native Language Support"
+ ac_help="$ac_help
+ --with-included-gettext use the GNU gettext library included here"
+@@ -6138,7 +6140,7 @@
+ LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='%%LOCALBASE%%/bin/libtool14'
+
+ # Prevent multiple expansion
+
+@@ -7381,6 +7383,8 @@
+ # AC_DEFINE(HAVE_GZSEEK)
+ #fi
+
++WITH_POPT_INCLUDE=$ac_default_prefix/include
++WITH_POPT_LIB=-L$ac_default_prefix/lib -lpopt
+
+
+
+@@ -8335,6 +8339,47 @@
+ DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb"
+ else
+ echo "$ac_t""no" 1>&6
++echo $ac_n "checking for db_create in -ldb3""... $ac_c" 1>&6
++echo "configure:8188: checking for db_create in -ldb3" >&5
++ac_lib_var=`echo db3'_'db_create | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ ac_save_LIBS="$LIBS"
++LIBS="-ldb3 $libthread $LIBS"
++cat > conftest.$ac_ext <<EOF
++#line 8196 "configure"
++#include "confdefs.h"
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char db_create();
++
++int main() {
++db_create()
++; return 0; }
++EOF
++if { (eval echo configure:8207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=no"
++fi
++rm -f conftest*
++LIBS="$ac_save_LIBS"
++
++fi
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb3"
++else
++ echo "$ac_t""no" 1>&6
++fi
++
++
+ fi
+
+
+@@ -8659,6 +8704,100 @@
+
+ fi
+
++# Check whether --with-popt-prefix or --without-popt-prefix was given.
++if test "${with_popt_prefix+set}" = set; then
++ withval="$with_popt_prefix"
++
++ for dir in `echo "$withval" | tr : ' '`; do
++ if test -d $dir/include; then
++ CPPFLAGS="$CPPFLAGS -I$dir/include";
++ WITH_POPT_INCLUDE="-I$dir/include";
++ fi
++ if test -d $dir/lib; then
++ LDFLAGS="$LDFLAGS -L$dir/lib";
++ WITH_POPT_LIB="-L$dir/lib -lpopt";
++ fi
++ done
++fi
++
++echo $ac_n "checking for popt.h""... $ac_c" 1>&6
++echo "configure:8724: checking for popt.h" >&5
++ac_lib_var=`echo popt'_'h | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ ac_save_CPPFLAGS="$CPPFLAGS"
++CPPFLAGS="${WITH_POPT_INCLUDE} $CPPFLAGS"
++cat > conftest.$ac_ext <<EOF
++#line 8494 "configure"
++#include "confdefs.h"
++#include <popt.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++
++int main() {
++return 0; }
++EOF
++if { (eval echo configure:8505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=no"
++fi
++rm -f conftest*
++CPPFLAGS="$ac_save_CPPFLAGS"
++
++fi
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++else
++ echo "$ac_t""no" 1>&6
++ echo "configure: error: sorry rpm requires popt.h" 1>&2; exit 1;
++fi
++
++echo $ac_n "checking for poptGetOptArg in -lpopt""... $ac_c" 1>&6
++echo "configure:8724: checking for poptGetOptArg in -lpopt" >&5
++ac_lib_var=`echo popt'_'poptGetOptArg | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ ac_save_LIBS="$LIBS"
++LIBS="${WITH_POPT_LIB} $LIBS"
++cat > conftest.$ac_ext <<EOF
++#line 8494 "configure"
++#include "confdefs.h"
++#include <popt.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++
++int main() {
++const char *foo = poptGetNextOpt(NULL);
++return 0; }
++EOF
++if { (eval echo configure:8505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=no"
++fi
++rm -f conftest*
++LIBS="$ac_save_LIBS"
++
++fi
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++else
++ echo "$ac_t""no" 1>&6
++ echo "configure: error: sorry rpm requires libpopt" 1>&2; exit 1;
++fi
+
+
+ for ac_func in personality
+@@ -12512,6 +12651,37 @@
+ WITH_PYTHON_VERSION=
+ if test $withval = auto ; then
+
++ echo $ac_n "checking for python 2.3""... $ac_c" 1>&6
++echo "configure:12517: checking for python 2.3" >&5
++ if test "$cross_compiling" = yes; then
++ withval=yes
++else
++ cat > conftest.$ac_ext <<EOF
++#line 12522 "configure"
++#include "confdefs.h"
++
++#include <python2.3/Python.h>
++main() {
++ exit(strncmp("2.3", PY_VERSION, 3));
++}
++EOF
++if { (eval echo configure:12530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++then
++ withval=yes
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -fr conftest*
++ withval=no
++fi
++rm -fr conftest*
++fi
++
++ echo "$ac_t""$withval" 1>&6
++ if test $withval = yes ; then
++ WITH_PYTHON_VERSION="2.3"
++ else
++
+ echo $ac_n "checking for python 2.2""... $ac_c" 1>&6
+ echo "configure:12517: checking for python 2.2" >&5
+ if test "$cross_compiling" = yes; then
+@@ -12577,6 +12747,8 @@
+
+ fi
+
++fi
++
+ if test -n "$WITH_PYTHON_VERSION" ; then
+ WITH_PYTHON_SUBDIR=python
+ WITH_PYTHON_SUBPACKAGE=1
+@@ -13130,21 +13302,7 @@
+
+ echo "$ac_t""$ROOT_GROUP" 1>&6
+
+-
+-if test "x$varprefix" = "x"; then
+- # For /usr and /usr/local, we want the 'var' directory to go
+- # in /var and /var/local respectively. For everything else,
+- # just put the 'var' directory in prefix/var.
+- case $prefix in
+- /usr | /usr/local )
+- varprefix=`echo $prefix | sed 's/usr/var/'` ;;
+- NONE)
+- varprefix=`echo $ac_default_prefix | sed 's/usr/var/'` ;;
+- *)
+- varprefix=$prefix/var ;;
+- esac
+-fi
+-
++varprefix=/var
+
+ if test "x$tmpdir" = "x"; then
+ if test -d $varprefix/tmp; then
+@@ -13349,7 +13507,7 @@
+
+
+
+-subdirs="popt beecrypt zlib $WITH_DB_SUBDIR"
++subdirs="beecrypt $WITH_DB_SUBDIR"
+
+
+ trap '' 1 2 15
+@@ -13578,6 +13736,8 @@
+ s%@WITH_ZLIB_SUBDIR@%$WITH_ZLIB_SUBDIR%g
+ s%@WITH_ZLIB_INCLUDE@%$WITH_ZLIB_INCLUDE%g
+ s%@WITH_ZLIB_LIB@%$WITH_ZLIB_LIB%g
++s%@WITH_POPT_INCLUDE@%$WITH_POPT_INCLUDE%g
++s%@WITH_POPT_LIB@%$WITH_POPT_LIB%g
+ s%@WITH_DB_SUBDIR@%$WITH_DB_SUBDIR%g
+ s%@WITH_INTERNAL_DB@%$WITH_INTERNAL_DB%g
+ s%@DBLIBSRCS@%$DBLIBSRCS%g
+@@ -13889,7 +14049,6 @@
+ ;;
+ esac
+ done
+- echo timestamp > popt/stamp-h.in
+ echo timestamp > beecrypt/stamp-h.in
+ echo timestamp > stamp-h.in
+
+@@ -13925,7 +14084,7 @@
+ esac
+ done
+
+- for ac_config_dir in popt beecrypt zlib $WITH_DB_SUBDIR; do
++ for ac_config_dir in beecrypt $WITH_DB_SUBDIR; do
+
+ # Do not complain, so a configure script can configure whichever
+ # parts of a large source tree are present.
diff --git a/archivers/rpm5/files/patch-db3::configure b/archivers/rpm5/files/patch-db3::configure
new file mode 100644
index 000000000000..fd38117a999b
--- /dev/null
+++ b/archivers/rpm5/files/patch-db3::configure
@@ -0,0 +1,11 @@
+--- db3/configure Fri Jul 27 10:20:43 2001
++++ db3/configure Wed Mar 27 10:04:21 2002
+@@ -15,7 +15,7 @@
+ rm -f $db_dist/../db/dist $db_dist/dist
+
+ mv Makefile Makefile.orig
+-cat Makefile.orig | sed -e 's/ -g$/ -g -O2/' -e '/^install:/c\
++cat Makefile.orig | gsed -e 's/ -g$/ -g -O2/' -e '/^install:/c\
+ .PHONY: listobjs\
+ listobjs:\
+ @echo $(OBJS) $(C_OBJS) \
diff --git a/archivers/rpm5/files/patch-doc::Makefile.in b/archivers/rpm5/files/patch-doc::Makefile.in
new file mode 100644
index 000000000000..9601ee90143e
--- /dev/null
+++ b/archivers/rpm5/files/patch-doc::Makefile.in
@@ -0,0 +1,11 @@
+--- doc/Makefile.in.orig Thu Mar 4 10:28:04 2004
++++ doc/Makefile.in Thu Mar 4 10:28:18 2004
+@@ -185,7 +185,7 @@
+ tmpdir = @tmpdir@
+ varprefix = @varprefix@
+
+-SUBDIRS = manual ja pl ru sk
++SUBDIRS = manual
+
+ man_MANS = gendiff.1 rpm.8 rpmbuild.8 rpm2cpio.8
+
diff --git a/archivers/rpm5/files/patch-lib::Makefile.in b/archivers/rpm5/files/patch-lib::Makefile.in
new file mode 100644
index 000000000000..0d15a5707976
--- /dev/null
+++ b/archivers/rpm5/files/patch-lib::Makefile.in
@@ -0,0 +1,34 @@
+--- lib/Makefile.in.orig Thu Feb 14 16:58:39 2002
++++ lib/Makefile.in Thu Mar 4 01:03:02 2004
+@@ -194,7 +194,7 @@
+ -I$(top_srcdir)/rpmdb \
+ -I$(top_srcdir)/rpmio \
+ -I$(top_srcdir)/beecrypt \
+- -I$(top_srcdir)/popt \
++ @WITH_POPT_INCLUDE@ \
+ @INCPATH@
+
+
+@@ -214,11 +214,10 @@
+ mylibpaths = \
+ -L$(top_builddir)/lib/.libs \
+ -L$(top_builddir)/rpmdb/.libs \
+- -L$(top_builddir)/rpmio/.libs \
+- -L$(top_builddir)/popt/.libs
++ -L$(top_builddir)/rpmio/.libs
+
+
+-mylibs = -lrpm -lrpmdb -lrpmio -lpopt @LIBS@ @INTLLIBS@ @LIBMISC@
++mylibs = -lrpm -lrpmdb -lrpmio @WITH_POPT_LIB@ @LIBS@ @INTLLIBS@ @LIBMISC@
+ LIBS =
+
+ lib_LTLIBRARIES = librpm.la
+@@ -421,7 +420,7 @@
+ install-exec-am: install-libLTLIBRARIES
+ install-exec: install-exec-am
+
+-install-data-am: install-pkgincHEADERS install-data-local
++install-data-am: install-pkgincHEADERS
+ install-data: install-data-am
+
+ install-am: all-am
diff --git a/archivers/rpm5/files/patch-lib::signature.c b/archivers/rpm5/files/patch-lib::signature.c
new file mode 100644
index 000000000000..ffaef839096a
--- /dev/null
+++ b/archivers/rpm5/files/patch-lib::signature.c
@@ -0,0 +1,13 @@
+--- lib/signature.c Sat Feb 2 13:55:49 2002
++++ lib/signature.c Wed Mar 27 10:21:31 2002
+@@ -11,6 +11,10 @@
+ * size key you like). We also honor PGPPATH finally.
+ */
+
++#ifdef __FreeBSD__
++extern char **environ;
++#endif
++
+ #include "system.h"
+
+ #include "rpmio_internal.h"
diff --git a/archivers/rpm5/files/patch-python::Makefile.in b/archivers/rpm5/files/patch-python::Makefile.in
new file mode 100644
index 000000000000..0597d5555a9e
--- /dev/null
+++ b/archivers/rpm5/files/patch-python::Makefile.in
@@ -0,0 +1,20 @@
+--- python/Makefile.in.orig Tue Mar 2 14:10:52 2004
++++ python/Makefile.in Tue Mar 2 14:11:24 2004
+@@ -197,7 +197,7 @@
+ -I$(top_srcdir)/rpmdb \
+ -I$(top_srcdir)/rpmio \
+ -I$(top_srcdir)/beecrypt \
+- -I$(top_srcdir)/popt \
++ @WITH_POPT_INCLUDE@ \
+ -I/usr/include/python${PYVER} \
+ @INCPATH@
+
+@@ -207,7 +207,7 @@
+ $(top_builddir)/lib/librpm.la \
+ $(top_builddir)/rpmdb/librpmdb.la \
+ $(top_builddir)/rpmio/librpmio.la \
+- $(top_builddir)/popt/libpopt.la
++ @WITH_POPT_LIB@
+
+
+ LDADD =
diff --git a/archivers/rpm5/files/patch-python::rpmmodule.c b/archivers/rpm5/files/patch-python::rpmmodule.c
new file mode 100644
index 000000000000..181636323965
--- /dev/null
+++ b/archivers/rpm5/files/patch-python::rpmmodule.c
@@ -0,0 +1,10 @@
+--- python/rpmmodule.c Sun Feb 3 16:59:57 2002
++++ python/rpmmodule.c Wed Mar 27 10:25:35 2002
+@@ -2,7 +2,6 @@
+ * \file python/rpmmodule.c
+ */
+
+-#include <alloca.h>
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <time.h>
diff --git a/archivers/rpm5/files/patch-rpmdb::Makefile.in b/archivers/rpm5/files/patch-rpmdb::Makefile.in
new file mode 100644
index 000000000000..ea423fa2c615
--- /dev/null
+++ b/archivers/rpm5/files/patch-rpmdb::Makefile.in
@@ -0,0 +1,34 @@
+--- rpmdb/Makefile.in.orig Thu Feb 14 16:58:38 2002
++++ rpmdb/Makefile.in Thu Mar 4 00:59:48 2004
+@@ -194,7 +194,7 @@
+ -I$(top_srcdir)/lib \
+ -I$(top_srcdir)/rpmio \
+ -I$(top_srcdir)/beecrypt \
+- -I$(top_srcdir)/popt \
++ @WITH_POPT_INCLUDE@ \
+ @INCPATH@
+
+
+@@ -206,11 +206,10 @@
+
+ mylibpaths = \
+ -L$(top_builddir)/lib/.libs \
+- -L$(top_builddir)/rpmio/.libs \
+- -L$(top_builddir)/popt/.libs
++ -L$(top_builddir)/rpmio/.libs
+
+
+-mylibs = -lrpm -lrpmio -lpopt @LIBS@ @INTLLIBS@ @LIBMISC@
++mylibs = -lrpm -lrpmio @WITH_POPT_LIB@ @LIBS@ @INTLLIBS@ @LIBMISC@
+ LIBS =
+
+ DB3LOBJS = $(shell cat $(top_builddir)/$(WITH_DB_SUBDIR)/db3lobjs)
+@@ -404,7 +403,7 @@
+ install-exec-am: install-libLTLIBRARIES
+ install-exec: install-exec-am
+
+-install-data-am: install-pkgincHEADERS install-data-local
++install-data-am: install-pkgincHEADERS
+ install-data: install-data-am
+
+ install-am: all-am
diff --git a/archivers/rpm5/files/patch-rpmio::Makefile.in b/archivers/rpm5/files/patch-rpmio::Makefile.in
new file mode 100644
index 000000000000..87671759506e
--- /dev/null
+++ b/archivers/rpm5/files/patch-rpmio::Makefile.in
@@ -0,0 +1,85 @@
+--- rpmio/Makefile.in.orig Thu Feb 14 16:58:37 2002
++++ rpmio/Makefile.in Thu Mar 4 00:55:37 2004
+@@ -197,7 +197,7 @@
+ -I$(top_srcdir)/build \
+ -I$(top_srcdir)/lib \
+ -I$(top_srcdir)/beecrypt \
+- -I$(top_srcdir)/popt \
++ @WITH_POPT_INCLUDE@ \
+ @WITH_ZLIB_INCLUDE@ \
+ @INCPATH@
+
+@@ -209,7 +209,7 @@
+
+ noinst_HEADERS = rpmio_internal.h rpmpgp.h
+
+-LIBS = @LIBS@ @WITH_ZLIB_LIB@ -lrt -lpthread
++LIBS = @LIBS@ @WITH_ZLIB_LIB@
+
+ BEECRYPTLOBJS = $(shell cat $(top_builddir)/beecrypt/listobjs)
+
+@@ -222,18 +222,18 @@
+ librpmio_la_DEPENDENCIES = .created
+
+ tdigest_SOURCES = tdigest.c
+-tdigest_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
++tdigest_LDADD = librpmio.la @WITH_POPT_LIB@
+
+ trpmio_SOURCES = trpmio.c
+-trpmio_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
++trpmio_LDADD = librpmio.la @WITH_POPT_LIB@
+
+ tkey_SOURCES = tkey.c
+ tkey_LDFLAGS = -all-static
+-tkey_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
++tkey_LDADD = librpmio.la @WITH_POPT_LIB@
+
+ tring_SOURCES = tring.c
+ tring_LDFLAGS = -all-static
+-tring_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
++tring_LDADD = librpmio.la @WITH_POPT_LIB@
+
+ dumpasn1_SOURCES = dumpasn1.c
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+@@ -248,15 +248,17 @@
+ librpmio_la_OBJECTS = digest.lo macro.lo rpmio.lo rpmlog.lo \
+ rpmmalloc.lo rpmpgp.lo rpmrpc.lo strcasecmp.lo stubs.lo url.lo ugid.lo
+ tdigest_OBJECTS = tdigest.$(OBJEXT)
+-tdigest_DEPENDENCIES = librpmio.la $(top_builddir)/popt/libpopt.la
+-tdigest_LDFLAGS =
++tdigest_DEPENDENCIES = librpmio.la
++tdigest_LDFLAGS = @WITH_POPT_LIB@
+ tkey_OBJECTS = tkey.$(OBJEXT)
+-tkey_DEPENDENCIES = librpmio.la $(top_builddir)/popt/libpopt.la
++tkey_DEPENDENCIES = librpmio.la
++tkey_LDFLAGS = @WITH_POPT_LIB@
+ tring_OBJECTS = tring.$(OBJEXT)
+-tring_DEPENDENCIES = librpmio.la $(top_builddir)/popt/libpopt.la
++tring_DEPENDENCIES = librpmio.la
++tring_LDFLAGS = @WITH_POPT_LIB@
+ trpmio_OBJECTS = trpmio.$(OBJEXT)
+-trpmio_DEPENDENCIES = librpmio.la $(top_builddir)/popt/libpopt.la
+-trpmio_LDFLAGS =
++trpmio_DEPENDENCIES = librpmio.la
++trpmio_LDFLAGS = @WITH_POPT_LIB@
+ dumpasn1_OBJECTS = dumpasn1.$(OBJEXT)
+ dumpasn1_LDADD = $(LDADD)
+ dumpasn1_DEPENDENCIES =
+@@ -461,7 +463,7 @@
+ install-exec-am: install-libLTLIBRARIES
+ install-exec: install-exec-am
+
+-install-data-am: install-pkgincHEADERS install-data-local
++install-data-am: install-pkgincHEADERS
+ install-data: install-data-am
+
+ install-am: all-am
+@@ -535,7 +537,7 @@
+ mv .librpmio.la librpmio.la
+
+ $(top_builddir)/beecrypt/listobjs:
+- make -C $(top_builddir)/beecrypt listobjs
++ $(MAKE) -C $(top_builddir)/beecrypt listobjs
+
+ .created: $(top_builddir)/beecrypt/listobjs
+ for lo in $(BEECRYPTLOBJS); do \
diff --git a/archivers/rpm5/files/patch-tools::Makefile.in b/archivers/rpm5/files/patch-tools::Makefile.in
new file mode 100644
index 000000000000..511ce7dbe768
--- /dev/null
+++ b/archivers/rpm5/files/patch-tools::Makefile.in
@@ -0,0 +1,98 @@
+--- tools/Makefile.in.orig Thu Feb 14 16:58:42 2002
++++ tools/Makefile.in Sun Sep 7 00:49:29 2003
+@@ -194,7 +194,7 @@
+ -I$(top_srcdir)/lib \
+ -I$(top_srcdir)/rpmdb \
+ -I$(top_srcdir)/rpmio \
+- -I$(top_srcdir)/popt \
++ @WITH_POPT_INCLUDE@ \
+ @WITH_ZLIB_INCLUDE@ \
+ @INCPATH@ \
+ -I$(top_srcdir)/misc
+@@ -212,7 +212,6 @@
+ $(top_builddir)/lib/librpm.la \
+ $(top_builddir)/rpmdb/librpmdb.la \
+ $(top_builddir)/rpmio/librpmio.la \
+- $(top_builddir)/popt/libpopt.la \
+ @WITH_ZLIB_LIB@ \
+ @INTLLIBS@
+
+@@ -249,61 +248,61 @@
+ rpminject_LDADD = $(LDADD)
+ rpminject_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
+-rpminject_LDFLAGS =
++$(top_builddir)/rpmio/librpmio.la
++rpminject_LDFLAGS = @WITH_POPT_LIB@
+ rpmsort_OBJECTS = rpmsort.$(OBJEXT)
+ rpmsort_LDADD = $(LDADD)
+ rpmsort_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
++$(top_builddir)/rpmio/librpmio.la
+ dump_SOURCES = dump.c
+ dump_OBJECTS = dump.$(OBJEXT)
+ dump_LDADD = $(LDADD)
+ dump_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
+-dump_LDFLAGS =
++$(top_builddir)/rpmio/librpmio.la
++dump_LDFLAGS = @WITH_POPT_LIB@
+ dumpdb_SOURCES = dumpdb.c
+ dumpdb_OBJECTS = dumpdb.$(OBJEXT)
+ dumpdb_LDADD = $(LDADD)
+ dumpdb_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
+-dumpdb_LDFLAGS =
++$(top_builddir)/rpmio/librpmio.la
++dumpdb_LDFLAGS = @WITH_POPT_LIB@
+ rpmarchive_SOURCES = rpmarchive.c
+ rpmarchive_OBJECTS = rpmarchive.$(OBJEXT)
+ rpmarchive_LDADD = $(LDADD)
+ rpmarchive_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
+-rpmarchive_LDFLAGS =
++$(top_builddir)/rpmio/librpmio.la
++rpmarchive_LDFLAGS = @WITH_POPT_LIB@
+ rpmheader_SOURCES = rpmheader.c
+ rpmheader_OBJECTS = rpmheader.$(OBJEXT)
+ rpmheader_LDADD = $(LDADD)
+ rpmheader_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
+-rpmheader_LDFLAGS =
++$(top_builddir)/rpmio/librpmio.la
++rpmheader_LDFLAGS = @WITH_POPT_LIB@
+ rpmlead_SOURCES = rpmlead.c
+ rpmlead_OBJECTS = rpmlead.$(OBJEXT)
+ rpmlead_LDADD = $(LDADD)
+ rpmlead_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
+-rpmlead_LDFLAGS =
++$(top_builddir)/rpmio/librpmio.la
++rpmlead_LDFLAGS = @WITH_POPT_LIB@
+ rpmsignature_SOURCES = rpmsignature.c
+ rpmsignature_OBJECTS = rpmsignature.$(OBJEXT)
+ rpmsignature_LDADD = $(LDADD)
+ rpmsignature_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
+-rpmsignature_LDFLAGS =
++$(top_builddir)/rpmio/librpmio.la
++rpmsignature_LDFLAGS = @WITH_POPT_LIB@
+ javadeps_OBJECTS = javadeps.$(OBJEXT)
+ javadeps_LDADD = $(LDADD)
+ javadeps_DEPENDENCIES = $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la $(top_builddir)/rpmdb/librpmdb.la \
+-$(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la
+-javadeps_LDFLAGS =
++$(top_builddir)/rpmio/librpmio.la
++javadeps_LDFLAGS = @WITH_POPT_LIB@
+ CFLAGS = @CFLAGS@
+ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+ LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
diff --git a/archivers/rpm5/pkg-deinstall b/archivers/rpm5/pkg-deinstall
new file mode 100644
index 000000000000..fd2d7200dbd6
--- /dev/null
+++ b/archivers/rpm5/pkg-deinstall
@@ -0,0 +1,17 @@
+#!/bin/sh
+# $FreeBSD$
+
+# The RPM database directory
+RPM_DATABASE_DIR=/var/lib/rpm
+
+# Provide instructions for removing the RPM database.
+if [ "$2" = "POST-DEINSTALL" ]; then
+ if [ -d "${RPM_DATABASE_DIR}" ]; then
+ echo ""
+ echo "If you are removing RPM permanently you can remove the"
+ echo "RPM database with the command:"
+ echo ""
+ echo " rm -rf ${RPM_DATABASE_DIR}"
+ echo ""
+ fi
+fi
diff --git a/archivers/rpm5/pkg-descr b/archivers/rpm5/pkg-descr
new file mode 100644
index 000000000000..3c5746dcc32e
--- /dev/null
+++ b/archivers/rpm5/pkg-descr
@@ -0,0 +1,11 @@
+The Red Hat Package Manager (RPM) is a powerful command line driven
+package management system capable of installing, uninstalling,
+verifying, querying, and updating computer software packages. Each
+software package consists of an archive of files along with information
+about the package like its version, a description, and the like.
+There is also a related API ("Application Program Interface"),
+permitting advanced developers to bypass 'shelling out' to a command
+line, and to manage such transactions from within a native coding
+language.
+
+WWW: http://www.rpm.org/
diff --git a/archivers/rpm5/pkg-install b/archivers/rpm5/pkg-install
new file mode 100644
index 000000000000..db4592c15325
--- /dev/null
+++ b/archivers/rpm5/pkg-install
@@ -0,0 +1,19 @@
+#!/bin/sh
+# $FreeBSD$
+
+# The RPM database directory
+RPM_DATABASE_DIR=/var/lib/rpm
+
+# Provide instructions for initialising the RPM database.
+if [ "$2" = "POST-INSTALL" ]; then
+ if [ ! -d "${RPM_DATABASE_DIR}" ]; then
+ echo ""
+ echo "No RPM database found. If you wish to use RPM to install"
+ echo "RPM packages the you will need to initialise the database"
+ echo "with the commands:"
+ echo ""
+ echo " mkdir -p ${RPM_DATABASE_DIR}"
+ echo " ${PKG_PREFIX}/bin/rpm --initdb"
+ echo ""
+ fi
+fi
diff --git a/archivers/rpm5/pkg-plist b/archivers/rpm5/pkg-plist
new file mode 100644
index 000000000000..3596f6f5e6da
--- /dev/null
+++ b/archivers/rpm5/pkg-plist
@@ -0,0 +1,155 @@
+bin/gendiff
+bin/rpm
+bin/rpm2cpio
+bin/rpmbuild
+bin/rpmdb
+bin/rpme
+bin/rpmi
+bin/rpmquery
+bin/rpmsign
+bin/rpmu
+bin/rpmverify
+include/rpm/hdrinline.h
+include/rpm/header.h
+include/rpm/misc.h
+include/rpm/rpmbuild.h
+include/rpm/rpmcli.h
+include/rpm/rpmdb.h
+include/rpm/rpmerr.h
+include/rpm/rpmio.h
+include/rpm/rpmlib.h
+include/rpm/rpmlog.h
+include/rpm/rpmmacro.h
+include/rpm/rpmmessages.h
+include/rpm/rpmspec.h
+include/rpm/rpmurl.h
+include/rpm/stringbuf.h
+include/rpm/ugid.h
+lib/libbeecrypt.a
+lib/libbeecrypt.so
+lib/libbeecrypt.so.4
+lib/librpm-4.0.4.so
+lib/librpm.a
+lib/librpm.so
+lib/librpmbuild-4.0.4.so
+lib/librpmbuild.a
+lib/librpmbuild.so
+lib/librpmdb-4.0.4.so
+lib/librpmdb.a
+lib/librpmdb.so
+lib/librpmio-4.0.4.so
+lib/librpmio.a
+lib/librpmio.so
+%%PYTHON%%%%PYTHON_SITELIBDIR%%/poptmodule.so
+%%PYTHON%%%%PYTHON_SITELIBDIR%%/rpmmodule.so
+lib/rpm/Specfile.pm
+lib/rpm/brp-compress
+lib/rpm/brp-redhat
+lib/rpm/brp-sparc64-linux
+lib/rpm/brp-strip
+lib/rpm/brp-strip-comment-note
+lib/rpm/brp-strip-shared
+lib/rpm/check-prereqs
+lib/rpm/config.guess
+lib/rpm/config.site
+lib/rpm/config.sub
+lib/rpm/convertrpmrc.sh
+lib/rpm/cpanflute
+lib/rpm/cpanflute2
+lib/rpm/cross-build
+lib/rpm/find-lang.sh
+lib/rpm/find-prov.pl
+lib/rpm/find-provides
+lib/rpm/find-provides.perl
+lib/rpm/find-req.pl
+lib/rpm/find-requires
+lib/rpm/find-requires.perl
+lib/rpm/get_magic.pl
+lib/rpm/getpo.sh
+lib/rpm/http.req
+lib/rpm/javadeps
+lib/rpm/macros
+lib/rpm/magic.prov
+lib/rpm/magic.req
+lib/rpm/mkinstalldirs
+lib/rpm/perl.prov
+lib/rpm/perl.req
+lib/rpm/rpm.daily
+lib/rpm/rpm.log
+lib/rpm/rpm.xinetd
+lib/rpm/rpm2cpio.sh
+lib/rpm/rpmb
+lib/rpm/rpmd
+lib/rpm/rpmdiff
+lib/rpm/rpmdiff.cgi
+lib/rpm/rpme
+lib/rpm/rpmi
+lib/rpm/rpmk
+lib/rpm/rpmpopt-4.0.4
+lib/rpm/rpmq
+lib/rpm/rpmrc
+lib/rpm/rpmt
+lib/rpm/rpmu
+lib/rpm/rpmv
+lib/rpm/sql.prov
+lib/rpm/sql.req
+lib/rpm/tcl.req
+lib/rpm/trpm
+lib/rpm/u_pkg.sh
+lib/rpm/vpkg-provides.sh
+lib/rpm/vpkg-provides2.sh
+lib/rpmpopt
+lib/rpmrc
+share/locale/cs/LC_MESSAGES/rpm.mo
+share/locale/da/LC_MESSAGES/rpm.mo
+share/locale/de/LC_MESSAGES/rpm.mo
+share/locale/en_RN/LC_MESSAGES/rpm.mo
+share/locale/es/LC_MESSAGES/rpm.mo
+share/locale/eu_ES/LC_MESSAGES/rpm.mo
+share/locale/fi/LC_MESSAGES/rpm.mo
+share/locale/fr/LC_MESSAGES/rpm.mo
+share/locale/gl/LC_MESSAGES/rpm.mo
+share/locale/hu/LC_MESSAGES/rpm.mo
+share/locale/id/LC_MESSAGES/rpm.mo
+share/locale/is/LC_MESSAGES/rpm.mo
+share/locale/it/LC_MESSAGES/rpm.mo
+share/locale/ja/LC_MESSAGES/rpm.mo
+share/locale/ko/LC_MESSAGES/rpm.mo
+share/locale/no/LC_MESSAGES/rpm.mo
+share/locale/pl/LC_MESSAGES/rpm.mo
+share/locale/pt/LC_MESSAGES/rpm.mo
+share/locale/pt_BR/LC_MESSAGES/rpm.mo
+share/locale/ro/LC_MESSAGES/rpm.mo
+share/locale/ru/LC_MESSAGES/rpm.mo
+share/locale/sk/LC_MESSAGES/rpm.mo
+share/locale/sl/LC_MESSAGES/rpm.mo
+share/locale/sr/LC_MESSAGES/rpm.mo
+share/locale/sv/LC_MESSAGES/rpm.mo
+share/locale/tr/LC_MESSAGES/rpm.mo
+share/locale/uk/LC_MESSAGES/rpm.mo
+share/locale/wa/LC_MESSAGES/rpm.mo
+share/locale/zh/LC_MESSAGES/rpm.mo
+share/locale/zh_CN.GB2312/LC_MESSAGES/rpm.mo
+@dirrm lib/rpm
+@dirrm include/rpm
+@unexec rmdir %D/src/portbld/SRPMS 2>/dev/null || true
+@unexec rmdir %D/src/portbld/SPECS 2>/dev/null || true
+@unexec rmdir %D/src/portbld/SOURCES 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/x86_64 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/sparcv9 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/sparc64 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/sparc 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/ppc64 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/ppc 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/noarch 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/ia64 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/i686 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/i586 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/i486 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/i386 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/amd64 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/alphaev6 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS/alpha 2>/dev/null || true
+@unexec rmdir %D/src/portbld/RPMS 2>/dev/null || true
+@unexec rmdir %D/src/portbld/BUILD 2>/dev/null || true
+@unexec rmdir %D/src/portbld 2>/dev/null || true