summaryrefslogtreecommitdiff
path: root/misc/rpm
diff options
context:
space:
mode:
authorryoon <ryoon@pkgsrc.org>2013-09-13 12:41:32 +0000
committerryoon <ryoon@pkgsrc.org>2013-09-13 12:41:32 +0000
commit74375ed63377ee2897f49d4fa4b38699293de106 (patch)
treeaa9c054336bae0f44310b62217d70f12de5e1db8 /misc/rpm
parentb96fe646c99ec83a7dced422ee9899ad8f8e726b (diff)
downloadpkgsrc-74375ed63377ee2897f49d4fa4b38699293de106.tar.gz
Update to 4.11.1 from 2.5.4
Changelog: * Many bugfixes and improvements. * New commands.
Diffstat (limited to 'misc/rpm')
-rw-r--r--misc/rpm/Makefile35
-rw-r--r--misc/rpm/PLIST202
-rw-r--r--misc/rpm/distinfo29
-rw-r--r--misc/rpm/patches/patch-aa15
-rw-r--r--misc/rpm/patches/patch-ab31
-rw-r--r--misc/rpm/patches/patch-ac66
-rw-r--r--misc/rpm/patches/patch-ba48
-rw-r--r--misc/rpm/patches/patch-bb19
-rw-r--r--misc/rpm/patches/patch-bd11
-rw-r--r--misc/rpm/patches/patch-be14
-rw-r--r--misc/rpm/patches/patch-build_rpmfc.c17
-rw-r--r--misc/rpm/patches/patch-ca12
-rw-r--r--misc/rpm/patches/patch-cb18
-rw-r--r--misc/rpm/patches/patch-cc12
-rw-r--r--misc/rpm/patches/patch-cd12
-rw-r--r--misc/rpm/patches/patch-ce12
-rw-r--r--misc/rpm/patches/patch-cf12
-rw-r--r--misc/rpm/patches/patch-cg12
-rw-r--r--misc/rpm/patches/patch-configure.ac22
-rw-r--r--misc/rpm/patches/patch-misc_fts.c18
-rw-r--r--misc/rpm/patches/patch-misc_fts.h17
-rw-r--r--misc/rpm/patches/patch-system.h15
22 files changed, 349 insertions, 300 deletions
diff --git a/misc/rpm/Makefile b/misc/rpm/Makefile
index 995becf859c..154f9d66744 100644
--- a/misc/rpm/Makefile
+++ b/misc/rpm/Makefile
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.76 2013/05/21 07:57:50 sbd Exp $
+# $NetBSD: Makefile,v 1.77 2013/09/13 12:41:32 ryoon Exp $
-DISTNAME= rpm-2.5.4
-PKGREVISION= 8
+DISTNAME= rpm-4.11.1
CATEGORIES= misc
-MASTER_SITES= http://rpm.org/releases/historical/rpm-2.5.x/
+MASTER_SITES= http://rpm.org/releases/rpm-4.11.x/
+EXTRACT_SUFX= .tar.bz2
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.rpm.org/
@@ -17,20 +17,30 @@ NOT_FOR_PLATFORM+= Interix-*-* # getmntent() is nonpublic; needs porting
MAKE_JOBS_SAFE= no
USE_PKGLOCALEDIR= yes
-USE_TOOLS+= gmake msgfmt
+USE_TOOLS+= bash:run gmake msgfmt perl:run
GNU_CONFIGURE= yes
GMAKE_REQD+= 3.82nb1
GMAKE= ${TOOLS_GMAKE}
+REPLACE_BASH+= scripts/*
+REPLACE_PERL+= scripts/*
+
+# To avoid build directory references.
+CONFIGURE_ENV+= MYPATH=/sbin:/bin:/usr/sbin:/usr/bin
+
# this is needed in addition of USE_PKGLOCALEDIR
CONFIGURE_ARGS+= --datadir=${PREFIX}/${PKGLOCALEDIR}
+CONFIGURE_ARGS+= --without-lua
+CONFIGURE_ARGS+= --with-external-db
+
+BDB_ACCEPTED= db4 db5
# The rpm databases are kept under ${RPM_DB_PREFIX}/lib/rpm.
CONFIGURE_ENV+= varprefix=${RPM_DB_PREFIX:Q}
# Needs help finding bdb.
-LIBS+= ${BDB_LIBS:Q}
+BUILDLINK_TRANSFORM+= rename:-ldb:${BDB_LIBS}
LDFLAGS+= ${PTHREAD_LDFLAGS}
MAKE_FLAGS+= MANDIR=${PREFIX}/${PKGMANDIR}/man8
@@ -41,23 +51,14 @@ FILES_SUBST+= RPMDIR=${RPMDIR:Q}
.include "../../mk/bsd.prefs.mk"
-post-configure:
- cd ${WRKSRC}/po && ${MV} cz.po cs.po
-
-pre-install:
- ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/include/rpm
-
-.if defined(RANLIB)
-post-install:
- $(RANLIB) ${DESTDIR}${PREFIX}/lib/librpm.a
-.endif
-
# The configure script doesn't detect whether libintl.so has any
# library dependencies.
#
BROKEN_GETTEXT_DETECTION= yes
.include "../../devel/gettext-lib/buildlink3.mk"
+.include "../../devel/nss/buildlink3.mk"
+.include "../../devel/nspr/buildlink3.mk"
.include "../../devel/popt/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
diff --git a/misc/rpm/PLIST b/misc/rpm/PLIST
index 998bd176a10..5f94a4043b7 100644
--- a/misc/rpm/PLIST
+++ b/misc/rpm/PLIST
@@ -1,26 +1,218 @@
-@comment $NetBSD: PLIST,v 1.7 2009/06/14 20:52:13 joerg Exp $
+@comment $NetBSD: PLIST,v 1.8 2013/09/13 12:41:32 ryoon Exp $
bin/gendiff
bin/rpm
bin/rpm2cpio
-include/rpm/dbindex.h
+bin/rpmbuild
+bin/rpmdb
+bin/rpmgraph
+bin/rpmkeys
+bin/rpmquery
+bin/rpmsign
+bin/rpmspec
+bin/rpmverify
+include/rpm/argv.h
include/rpm/header.h
+include/rpm/rpmbase64.h
+include/rpm/rpmbuild.h
+include/rpm/rpmcallback.h
+include/rpm/rpmcli.h
+include/rpm/rpmdb.h
+include/rpm/rpmds.h
+include/rpm/rpmfc.h
+include/rpm/rpmfi.h
+include/rpm/rpmfileutil.h
+include/rpm/rpmio.h
+include/rpm/rpmkeyring.h
+include/rpm/rpmlegacy.h
include/rpm/rpmlib.h
-lib/librpm.a
+include/rpm/rpmlog.h
+include/rpm/rpmmacro.h
+include/rpm/rpmpgp.h
+include/rpm/rpmpol.h
+include/rpm/rpmprob.h
+include/rpm/rpmps.h
+include/rpm/rpmsign.h
+include/rpm/rpmspec.h
+include/rpm/rpmsq.h
+include/rpm/rpmstring.h
+include/rpm/rpmstrpool.h
+include/rpm/rpmsw.h
+include/rpm/rpmtag.h
+include/rpm/rpmtd.h
+include/rpm/rpmte.h
+include/rpm/rpmts.h
+include/rpm/rpmtypes.h
+include/rpm/rpmurl.h
+include/rpm/rpmutil.h
+include/rpm/rpmvf.h
+lib/librpm.la
+lib/librpmbuild.la
+lib/librpmio.la
+lib/librpmsign.la
+lib/pkgconfig/rpm.pc
+lib/rpm-plugins/exec.la
+lib/rpm/brp-compress
+lib/rpm/brp-java-gcjcompile
+lib/rpm/brp-python-bytecompile
+lib/rpm/brp-python-hardlink
+lib/rpm/brp-strip
+lib/rpm/brp-strip-comment-note
+lib/rpm/brp-strip-shared
+lib/rpm/brp-strip-static-archive
+lib/rpm/check-buildroot
+lib/rpm/check-files
+lib/rpm/check-prereqs
+lib/rpm/check-rpaths
+lib/rpm/check-rpaths-worker
+lib/rpm/config.guess
+lib/rpm/config.sub
+lib/rpm/desktop-file.prov
+lib/rpm/fileattrs/desktop.attr
+lib/rpm/fileattrs/elf.attr
+lib/rpm/fileattrs/font.attr
+lib/rpm/fileattrs/libtool.attr
+lib/rpm/fileattrs/mono.attr
+lib/rpm/fileattrs/ocaml.attr
+lib/rpm/fileattrs/perl.attr
+lib/rpm/fileattrs/perllib.attr
+lib/rpm/fileattrs/pkgconfig.attr
+lib/rpm/fileattrs/python.attr
+lib/rpm/fileattrs/script.attr
+lib/rpm/find-lang.sh
lib/rpm/find-provides
lib/rpm/find-requires
-lib/rpm/freshen.sh
+lib/rpm/fontconfig.prov
+lib/rpm/libtooldeps.sh
+lib/rpm/macros
+lib/rpm/macros.perl
+lib/rpm/macros.php
+lib/rpm/macros.python
lib/rpm/mkinstalldirs
-lib/rpm/rpmpopt
+lib/rpm/mono-find-provides
+lib/rpm/mono-find-requires
+lib/rpm/ocaml-find-provides.sh
+lib/rpm/ocaml-find-requires.sh
+lib/rpm/osgideps.pl
+lib/rpm/perl.prov
+lib/rpm/perl.req
+lib/rpm/perldeps.pl
+lib/rpm/pkgconfigdeps.sh
+lib/rpm/platform/aarch64--gnu/macros
+lib/rpm/platform/alpha--gnu/macros
+lib/rpm/platform/alphaev5--gnu/macros
+lib/rpm/platform/alphaev56--gnu/macros
+lib/rpm/platform/alphaev6--gnu/macros
+lib/rpm/platform/alphaev67--gnu/macros
+lib/rpm/platform/alphapca56--gnu/macros
+lib/rpm/platform/amd64--gnu/macros
+lib/rpm/platform/armv3l--gnu/macros
+lib/rpm/platform/armv4b--gnu/macros
+lib/rpm/platform/armv4l--gnu/macros
+lib/rpm/platform/armv5tejl--gnu/macros
+lib/rpm/platform/armv5tel--gnu/macros
+lib/rpm/platform/armv6l--gnu/macros
+lib/rpm/platform/armv7l--gnu/macros
+lib/rpm/platform/athlon--gnu/macros
+lib/rpm/platform/geode--gnu/macros
+lib/rpm/platform/i386--gnu/macros
+lib/rpm/platform/i486--gnu/macros
+lib/rpm/platform/i586--gnu/macros
+lib/rpm/platform/i686--gnu/macros
+lib/rpm/platform/ia32e--gnu/macros
+lib/rpm/platform/ia64--gnu/macros
+lib/rpm/platform/noarch--gnu/macros
+lib/rpm/platform/pentium3--gnu/macros
+lib/rpm/platform/pentium4--gnu/macros
+lib/rpm/platform/ppc--gnu/macros
+lib/rpm/platform/ppc32dy4--gnu/macros
+lib/rpm/platform/ppc64--gnu/macros
+lib/rpm/platform/ppc64iseries--gnu/macros
+lib/rpm/platform/ppc64p7--gnu/macros
+lib/rpm/platform/ppc64pseries--gnu/macros
+lib/rpm/platform/ppc8260--gnu/macros
+lib/rpm/platform/ppc8560--gnu/macros
+lib/rpm/platform/ppciseries--gnu/macros
+lib/rpm/platform/ppcpseries--gnu/macros
+lib/rpm/platform/s390--gnu/macros
+lib/rpm/platform/s390x--gnu/macros
+lib/rpm/platform/sh--gnu/macros
+lib/rpm/platform/sh3--gnu/macros
+lib/rpm/platform/sh4--gnu/macros
+lib/rpm/platform/sh4a--gnu/macros
+lib/rpm/platform/sparc--gnu/macros
+lib/rpm/platform/sparc64--gnu/macros
+lib/rpm/platform/sparc64v--gnu/macros
+lib/rpm/platform/sparcv8--gnu/macros
+lib/rpm/platform/sparcv9--gnu/macros
+lib/rpm/platform/sparcv9v--gnu/macros
+lib/rpm/platform/${MACHINE_ARCH}--gnu/macros
+lib/rpm/pythondeps.sh
+lib/rpm/rpm.daily
+lib/rpm/rpm.log
+lib/rpm/rpm.supp
+lib/rpm/rpm2cpio.sh
+lib/rpm/rpmdb_loadcvt
+lib/rpm/rpmdeps
+lib/rpm/rpmpopt-${PKGVERSION}
lib/rpm/rpmrc
+lib/rpm/script.req
+lib/rpm/tcl.req
+lib/rpm/tgpg
+man/fr/man8/rpm.8
+man/ja/man8/rpm.8
+man/ja/man8/rpm2cpio.8
+man/ja/man8/rpmbuild.8
+man/ja/man8/rpmgraph.8
+man/ko/man8/rpm.8
+man/ko/man8/rpm2cpio.8
+man/man1/gendiff.1
man/man8/rpm.8
man/man8/rpm2cpio.8
+man/man8/rpmbuild.8
+man/man8/rpmdb.8
+man/man8/rpmdeps.8
+man/man8/rpmgraph.8
+man/man8/rpmkeys.8
+man/man8/rpmsign.8
+man/man8/rpmspec.8
+man/pl/man1/gendiff.1
+man/pl/man8/rpm.8
+man/pl/man8/rpm2cpio.8
+man/pl/man8/rpmbuild.8
+man/pl/man8/rpmdeps.8
+man/pl/man8/rpmgraph.8
+man/ru/man8/rpm.8
+man/ru/man8/rpm2cpio.8
+man/sk/man8/rpm.8
+share/locale/br/LC_MESSAGES/rpm.mo
+share/locale/ca/LC_MESSAGES/rpm.mo
share/locale/cs/LC_MESSAGES/rpm.mo
+share/locale/da/LC_MESSAGES/rpm.mo
share/locale/de/LC_MESSAGES/rpm.mo
+share/locale/el/LC_MESSAGES/rpm.mo
+share/locale/eo/LC_MESSAGES/rpm.mo
+share/locale/es/LC_MESSAGES/rpm.mo
share/locale/fi/LC_MESSAGES/rpm.mo
share/locale/fr/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/ms/LC_MESSAGES/rpm.mo
+share/locale/nb/LC_MESSAGES/rpm.mo
+share/locale/nl/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/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/sr@latin/LC_MESSAGES/rpm.mo
share/locale/sv/LC_MESSAGES/rpm.mo
+share/locale/te/LC_MESSAGES/rpm.mo
share/locale/tr/LC_MESSAGES/rpm.mo
+share/locale/uk/LC_MESSAGES/rpm.mo
+share/locale/zh_CN/LC_MESSAGES/rpm.mo
+share/locale/zh_TW/LC_MESSAGES/rpm.mo
+@pkgdir var/tmp
diff --git a/misc/rpm/distinfo b/misc/rpm/distinfo
index 62a94617f32..87d4239931e 100644
--- a/misc/rpm/distinfo
+++ b/misc/rpm/distinfo
@@ -1,19 +1,12 @@
-$NetBSD: distinfo,v 1.9 2007/02/18 11:17:03 tonio Exp $
+$NetBSD: distinfo,v 1.10 2013/09/13 12:41:32 ryoon Exp $
-SHA1 (rpm-2.5.4.tar.gz) = a7fcd67883aec8d5f17483d5efebe7e5f5453462
-RMD160 (rpm-2.5.4.tar.gz) = 6c9a46d370fe97c7fcf7f814db049ea2bba300da
-Size (rpm-2.5.4.tar.gz) = 727849 bytes
-SHA1 (patch-aa) = 3ee3193cc8e9043017b1f507b606c72acab77ddb
-SHA1 (patch-ab) = 63635f4f7fd96b4e7a40bfbaffd5673b40db3a13
-SHA1 (patch-ac) = ed4545088fc0cc56fd577fbc122a073f12d751aa
-SHA1 (patch-ba) = c6a062e733e09eb56144177444188dcaf0cfcb06
-SHA1 (patch-bb) = dc0ea2dd366b793003218858ca3d67bc285a2089
-SHA1 (patch-bd) = 1c9cd4587314ee45bccdf08c6ecaabbe641aaa5d
-SHA1 (patch-be) = ed237b47e9f8033e8fdfc4258a1bdd5ebaff469e
-SHA1 (patch-ca) = 7f4b008eee3b9f1bd3abc49686f70a327376af55
-SHA1 (patch-cb) = 30f98037c6a5ba753bc19b20564e177ad1e8c1a9
-SHA1 (patch-cc) = d5955ec8b51950aadf930a62743601c2d4a0a127
-SHA1 (patch-cd) = 30e28a8f9453d4a4553ed08eeb43ba049fb35567
-SHA1 (patch-ce) = 9cbf130f8f10b5c8368028cfab295d9c61db2e7c
-SHA1 (patch-cf) = 636b77cd05f9eb5083d11aa362a5b75d424014ad
-SHA1 (patch-cg) = bc094d702cb13b5c89d696770bbcaffaca3b853c
+SHA1 (rpm-4.11.1.tar.bz2) = 31ddc4185137ce3f718c99e91dcb040614fe820c
+RMD160 (rpm-4.11.1.tar.bz2) = 3acb73dffef60c5e98ad23d2551ebca0837c218c
+Size (rpm-4.11.1.tar.bz2) = 3778922 bytes
+SHA1 (patch-ac) = a9d4fb93a47f705b9220d886853b805f3b741ca2
+SHA1 (patch-build_rpmfc.c) = dab644d99d7ed43850443433b242d6ec16630b9c
+SHA1 (patch-cb) = c52dfaec6cf89d069f26900265d34f7ad91092f0
+SHA1 (patch-configure.ac) = c9df0915b2c9c08fd059a3c9a2c89fe25d3e194d
+SHA1 (patch-misc_fts.c) = 26443c47db5e2211a926cf0f8b26b1f70475edda
+SHA1 (patch-misc_fts.h) = ec4ee0ea18f5d210eb32d9f22c90e43d2ede0c53
+SHA1 (patch-system.h) = 21336b9d2a7afbc0573ba0ce09c0849e5bef2548
diff --git a/misc/rpm/patches/patch-aa b/misc/rpm/patches/patch-aa
deleted file mode 100644
index efc931b686e..00000000000
--- a/misc/rpm/patches/patch-aa
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-aa,v 1.6 1998/11/10 22:39:29 tron Exp $
-
---- po/Makefile.in.orig Mon Sep 28 22:13:27 1998
-+++ po/Makefile.in Tue Nov 10 23:07:35 1998
-@@ -79,8 +79,8 @@
- install:
- for n in $(CATALOGS); do \
- l=`basename $$n .mo`; \
-- $(INSTALL) -m 755 -d $(installprefix)/$(RPMNLSDIR)/$$l; \
-- $(INSTALL) -m 755 -d $(installprefix)/$(RPMNLSDIR)/$$l/LC_MESSAGES; \
-+ $(BSD_INSTALL_DATA_DIR) -m 755 $(installprefix)/$(RPMNLSDIR)/$$l; \
-+ $(BSD_INSTALL_DATA_DIR) -m 755 $(installprefix)/$(RPMNLSDIR)/$$l/LC_MESSAGES; \
- $(INSTALL) -m 644 $$n $(installprefix)/$(RPMNLSDIR)/$$l/LC_MESSAGES/rpm.mo; \
- done
-
diff --git a/misc/rpm/patches/patch-ab b/misc/rpm/patches/patch-ab
deleted file mode 100644
index 4e36fd46b50..00000000000
--- a/misc/rpm/patches/patch-ab
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-ab,v 1.8 2000/09/10 12:02:48 wiz Exp $
-
---- rpm.8.orig Tue Aug 25 21:06:11 1998
-+++ rpm.8
-@@ -44,6 +44,10 @@
- .br
- .I "\fB rpm \-\-rebuilddb"
- .br
-+Initialize database:
-+.br
-+.I "\fB rpm \-\-initdb"
-+.br
- Fix permissions:
- .br
- .I "\fB rpm \-\-setperms [query\-package\-specifiers]\fP"
-@@ -410,6 +414,15 @@
- The general form of an rpm rebuild database command is
- .PP
- \fBrpm \-\-rebuilddb\fP
-+.PP
-+
-+The only options this mode supports are \fB-\-dbpath\fP and \fB-\-root\fP.
-+
-+.SH INITIALIZE DATABASE OPTIONS
-+
-+Before the first use, you have to initialize the rpm database with
-+.PP
-+ \fBrpm \-\-initdb\fP
- .PP
-
- The only options this mode supports are \fB-\-dbpath\fP and \fB-\-root\fP.
diff --git a/misc/rpm/patches/patch-ac b/misc/rpm/patches/patch-ac
index 66e66f0b97b..4dd5ae1f2aa 100644
--- a/misc/rpm/patches/patch-ac
+++ b/misc/rpm/patches/patch-ac
@@ -1,47 +1,31 @@
-$NetBSD: patch-ac,v 1.10 2004/07/24 04:43:10 grant Exp $
+$NetBSD: patch-ac,v 1.11 2013/09/13 12:41:32 ryoon Exp $
---- configure.orig 1998-09-29 06:50:23.000000000 +1000
+--- configure.orig 2013-06-27 09:29:11.000000000 +0000
+++ configure
-@@ -1565,7 +1565,6 @@ do
- echo $ac_n "checking for $dir/lib in LIBS""... $ac_c" 1>&6
- echo "configure:1567: checking for $dir/lib in LIBS" >&5
- if test -d $dir/lib ; then
-- addlib $dir/lib
- echo "$ac_t""yes" 1>&6
- else
- echo "$ac_t""no" 1>&6
-@@ -1574,7 +1573,6 @@ echo "configure:1567: checking for $dir/
- echo $ac_n "checking for $dir/include in INCPATH""... $ac_c" 1>&6
- echo "configure:1576: checking for $dir/include in INCPATH" >&5
- if test -d $dir/include ; then
-- INCPATH="$INCPATH -I$dir/include"
- echo "$ac_t""yes" 1>&6
- else
- echo "$ac_t""no" 1>&6
-@@ -1584,12 +1582,11 @@ done
- echo $ac_n "checking for /usr/ucblib in LIBS""... $ac_c" 1>&6
- echo "configure:1586: checking for /usr/ucblib in LIBS" >&5
- if test -d /usr/ucblib ; then
-- if test "$build" = "mips-sni-sysv4" ; then
-- addlib /usr/ccs/lib -lc
-- fi
--
-- addlib /usr/ucblib
--
-+# if test "$build" = "mips-sni-sysv4" ; then
-+# addlib /usr/ccs/lib -lc
-+# fi
-+#
-+# addlib /usr/ucblib
- echo "$ac_t""yes" 1>&6
+@@ -17093,7 +17093,7 @@ fi
+ if test "$cross_compiling" = "yes"; then
+ MYPATH=":"
else
- echo "$ac_t""no" 1>&6
-@@ -4065,7 +4062,7 @@ else
- NBMAKEFILE=
+- MYPATH=$PATH
++ MYPATH=$MYPATH
fi
--subdirs="popt"
-+#subdirs="popt"
+ # Extract the first word of "7zip", so it can be a program name with args.
+@@ -24310,7 +24310,7 @@ host_os_noversion=`echo "${host_os}" | s
- trap '' 1 2 15
- cat > confcache <<\EOF
+ for provscript in ${host_cpu}-${host_os_exact}.prov ${host_os_exact}.prov ${host_os_major}.prov ${host_os_noversion}.prov none ; do {
+ if test -f ${srcdir}/autodeps/${provscript} ; then
+- if [ ${provscript} == none ] ; then
++ if [ ${provscript} = none ] ; then
+ echo "*** no default provides information is available for ${host_os_noversion}"
+ else
+ echo "using ${srcdir}/autodeps/${provscript} for automatic provides generation"
+@@ -24323,7 +24323,7 @@ for provscript in ${host_cpu}-${host_os_
+
+ for reqscript in ${host_cpu}-${host_os_exact}.req ${host_os_exact}.req ${host_os_major}.req ${host_os_noversion}.req none ; do {
+ if test -f ${srcdir}/autodeps/${reqscript} ; then
+- if [ ${reqscript} == none ] ; then
++ if [ ${reqscript} = none ] ; then
+ echo "*** no default requires information is available for ${host_os_noversion}"
+ else
+ echo "using ${srcdir}/autodeps/${reqscript} for automatic requires generation"
diff --git a/misc/rpm/patches/patch-ba b/misc/rpm/patches/patch-ba
deleted file mode 100644
index 8f394ac557d..00000000000
--- a/misc/rpm/patches/patch-ba
+++ /dev/null
@@ -1,48 +0,0 @@
-$NetBSD: patch-ba,v 1.2 2004/07/24 04:43:10 grant Exp $
-
---- Makefile.in.orig 1998-09-12 23:16:32.000000000 +1000
-+++ Makefile.in
-@@ -30,8 +30,8 @@ ETCDIR=$(ROOT)/etc
-
- # -----------------------------------------------------------------------
-
--SUBDIRS = popt @MISCDIR@ lib build tools @PO@
--ALLSUBDIRS = popt misc lib build tools po
-+SUBDIRS = @MISCDIR@ lib build tools @PO@
-+ALLSUBDIRS = misc lib build tools po
- INSTSUBDIRS = lib scripts @PO@
- OTHERSUBDIRS = docs autodeps
- OBJS = rpm.o query.o install.o verify.o checksig.o ftp.o url.o build.o \
-@@ -124,21 +124,19 @@ install: all
- [ -d $(installprefix)/$(RPMCONFIGDIR) ] || \
- $(mkinstalldirs) $(installprefix)/$(RPMCONFIGDIR)
- if [ -x ./rpm ]; then \
-- $(INSTALL_PROGRAM) -s -m 755 rpm $(installprefix)/$(RPMBINDIR); \
-+ $(BSD_INSTALL_PROGRAM) rpm $(installprefix)/$(RPMBINDIR); \
- else \
-- $(INSTALL_PROGRAM) -s -m 755 rpm.shared $(installprefix)/$(RPMBINDIR)/rpm; \
-+ $(BSD_INSTALL_PROGRAM) rpm.shared $(installprefix)/$(RPMBINDIR)/rpm; \
- fi
-- $(INSTALL_PROGRAM) -m 755 $(srcdir)/gendiff $(installprefix)/$(BINDIR)
-- $(INSTALL_PROGRAM) -m 755 $(topdir)/mkinstalldirs $(installprefix)/$(RPMCONFIGDIR)/mkinstalldirs
-- $(INSTALL_PROGRAM) -m 755 $(topdir)/find-provides.sh $(installprefix)/$(RPMCONFIGDIR)/find-provides
-- $(INSTALL_PROGRAM) -m 755 $(topdir)/find-requires.sh $(installprefix)/$(RPMCONFIGDIR)/find-requires
-- $(INSTALL_PROGRAM) -s -m 755 rpm2cpio $(installprefix)/$(BINDIR)
-- $(INSTALL_DATA) -m 644 $(srcdir)/rpm.8 $(installprefix)/$(MANDIR)
-- $(INSTALL_DATA) -m 644 $(srcdir)/rpm2cpio.8 $(installprefix)/$(MANDIR)
-- $(INSTALL_DATA) -m 644 $(topdir)/lib-rpmrc $(installprefix)/$(RPMCONFIGDIR)/rpmrc
-- $(INSTALL_DATA) -m 644 $(srcdir)/rpmpopt $(installprefix)/$(RPMCONFIGDIR)/rpmpopt
-- ln -sf $(RPMCONFIGDIR)/rpmrc $(installprefix)/$(LIBDIR)/rpmrc
-- ln -sf $(RPMCONFIGDIR)/rpmpopt $(installprefix)/$(LIBDIR)/rpmpopt
-+ $(BSD_INSTALL_SCRIPT) $(srcdir)/gendiff $(installprefix)/$(BINDIR)
-+ $(BSD_INSTALL_SCRIPT) $(topdir)/mkinstalldirs $(installprefix)/$(RPMCONFIGDIR)/mkinstalldirs
-+ $(BSD_INSTALL_SCRIPT) $(topdir)/find-provides.sh $(installprefix)/$(RPMCONFIGDIR)/find-provides
-+ $(BSD_INSTALL_SCRIPT) $(topdir)/find-requires.sh $(installprefix)/$(RPMCONFIGDIR)/find-requires
-+ $(BSD_INSTALL_PROGRAM) rpm2cpio $(installprefix)/$(BINDIR)
-+ $(BSD_INSTALL_MAN) $(srcdir)/rpm.8 $(installprefix)/$(MANDIR)
-+ $(BSD_INSTALL_MAN) $(srcdir)/rpm2cpio.8 $(installprefix)/$(MANDIR)
-+ $(BSD_INSTALL_DATA) $(topdir)/lib-rpmrc $(installprefix)/$(RPMCONFIGDIR)/rpmrc
-+ $(BSD_INSTALL_DATA) $(srcdir)/rpmpopt $(installprefix)/$(RPMCONFIGDIR)/rpmpopt
- (cd lib; $(MAKE) LIBDIR=$(installprefix)/$(LIBDIR) INCDIR=$(installprefix)/$(INCDIR) install)
- for d in $(INSTSUBDIRS); do \
- (cd $$d; $(MAKE) installprefix=$(installprefix) LIBDIR=$(installprefix)/$(LIBDIR) INCDIR=$(installprefix)/$(INCDIR) install) ;\
diff --git a/misc/rpm/patches/patch-bb b/misc/rpm/patches/patch-bb
deleted file mode 100644
index 69a5954e6a5..00000000000
--- a/misc/rpm/patches/patch-bb
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-bb,v 1.1 1998/11/05 01:34:02 mycroft Exp $
-
---- lib/Makefile.in.orig Tue Aug 11 12:09:18 1998
-+++ lib/Makefile.in Wed Nov 4 20:11:23 1998
-@@ -55,10 +55,10 @@
- echo 'const int rpmTagTableSize = sizeof(rpmTagTable) / sizeof(struct headerTagTableEntry) - 1;' >> tagtable.c
-
- install:
-- $(INSTALL_DATA) -m 644 $(srcdir)/rpmlib.h $(INCDIR)
-- $(INSTALL_DATA) -m 644 $(srcdir)/dbindex.h $(INCDIR)
-- $(INSTALL_DATA) -m 644 $(srcdir)/header.h $(INCDIR)
-- $(INSTALL_DATA) -m 644 librpm.a $(LIBDIR)
-+ $(BSD_INSTALL_DATA) $(srcdir)/rpmlib.h $(INCDIR)
-+ $(BSD_INSTALL_DATA) $(srcdir)/dbindex.h $(INCDIR)
-+ $(BSD_INSTALL_DATA) $(srcdir)/header.h $(INCDIR)
-+ $(BSD_INSTALL_DATA) librpm.a $(LIBDIR)
-
- distclean: clean
- rm -f Makefile
diff --git a/misc/rpm/patches/patch-bd b/misc/rpm/patches/patch-bd
deleted file mode 100644
index 950f1e05b30..00000000000
--- a/misc/rpm/patches/patch-bd
+++ /dev/null
@@ -1,11 +0,0 @@
-$NetBSD: patch-bd,v 1.1 1998/11/05 01:34:02 mycroft Exp $
-
---- scripts/Makefile.in.orig Thu Jul 30 10:19:58 1998
-+++ scripts/Makefile.in Wed Nov 4 20:11:58 1998
-@@ -12,5 +12,5 @@
-
- install:
- for n in $(SCRIPTS); do \
-- $(INSTALL_DATA) -m 755 $$n $(installprefix)/$(RPMCONFIGDIR); \
-+ $(BSD_INSTALL_SCRIPT) $$n $(installprefix)/$(RPMCONFIGDIR); \
- done
diff --git a/misc/rpm/patches/patch-be b/misc/rpm/patches/patch-be
deleted file mode 100644
index e2f69cfd86e..00000000000
--- a/misc/rpm/patches/patch-be
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD: patch-be,v 1.1 2004/07/24 04:43:10 grant Exp $
-
---- Makefile.inc.in.orig 1998-09-01 21:22:34.000000000 +1000
-+++ Makefile.inc.in
-@@ -17,8 +17,7 @@ RPMNLSDIR=@datadir@/locale
- RPMNLSPACKAGE=rpm
- CFLAGS = -I$(topdir) -I$(topsrcdir) @CFLAGS@ @INCPATH@ $(OPTS) \
- -I$(topsrcdir)/lib -I$(topsrcdir)/misc
--LDFLAGS = @LDFLAGS@ -L$(topdir)/lib -L$(topdir)/build -L$(topdir)/misc \
-- -L$(topdir)/popt
-+LDFLAGS = @LDFLAGS@ -L$(topdir)/lib -L$(topdir)/build -L$(topdir)/misc
- VERSION = 2.5.4
- CC = @CC@
-
diff --git a/misc/rpm/patches/patch-build_rpmfc.c b/misc/rpm/patches/patch-build_rpmfc.c
new file mode 100644
index 00000000000..1cd928db346
--- /dev/null
+++ b/misc/rpm/patches/patch-build_rpmfc.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-build_rpmfc.c,v 1.1 2013/09/13 12:41:32 ryoon Exp $
+
+* basemname(3) requires libgen.h on NetBSD.
+
+--- build/rpmfc.c.orig 2013-06-10 15:55:10.000000000 +0000
++++ build/rpmfc.c
+@@ -16,6 +16,10 @@
+ #include <rpm/rpmfi.h>
+ #include <rpm/rpmstrpool.h>
+
++#if defined(__NetBSD__)
++#include <libgen.h>
++#endif
++
+ #include "build/rpmbuild_internal.h"
+
+ #include "debug.h"
diff --git a/misc/rpm/patches/patch-ca b/misc/rpm/patches/patch-ca
deleted file mode 100644
index 09d480537de..00000000000
--- a/misc/rpm/patches/patch-ca
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-ca,v 1.1 2003/10/19 16:05:21 grant Exp $
-
---- build/files.c.orig 1998-09-28 06:16:39.000000000 +1000
-+++ build/files.c
-@@ -7,7 +7,6 @@
- #endif
-
- #include <string.h>
--#include <malloc.h>
- #include <stdlib.h>
- #include <sys/types.h>
- #include <regex.h>
diff --git a/misc/rpm/patches/patch-cb b/misc/rpm/patches/patch-cb
index 5d3958cffb4..0952c7f66a8 100644
--- a/misc/rpm/patches/patch-cb
+++ b/misc/rpm/patches/patch-cb
@@ -1,12 +1,12 @@
-$NetBSD: patch-cb,v 1.1 2003/10/19 16:05:21 grant Exp $
+$NetBSD: patch-cb,v 1.2 2013/09/13 12:41:32 ryoon Exp $
---- build/pack.c.orig 1998-09-28 06:16:43.000000000 +1000
+--- build/pack.c.orig 2013-06-10 15:55:10.000000000 +0000
+++ build/pack.c
-@@ -4,7 +4,6 @@
- #include <sys/stat.h>
- #include <sys/wait.h>
- #include <fcntl.h>
--#include <malloc.h>
- #include <string.h>
+@@ -6,6 +6,7 @@
+ #include "system.h"
+
#include <errno.h>
- #include <signal.h>
++#include <sys/wait.h>
+ #include <netdb.h>
+ #include <time.h>
+
diff --git a/misc/rpm/patches/patch-cc b/misc/rpm/patches/patch-cc
deleted file mode 100644
index 77f922f8571..00000000000
--- a/misc/rpm/patches/patch-cc
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-cc,v 1.1 2003/10/19 16:05:21 grant Exp $
-
---- build/parseScript.c.orig 1998-09-28 06:16:53.000000000 +1000
-+++ build/parseScript.c
-@@ -1,6 +1,6 @@
- #include "config.h"
-
--#include <malloc.h>
-+#include <stdlib.h>
- #include <string.h>
-
- #include "intl.h"
diff --git a/misc/rpm/patches/patch-cd b/misc/rpm/patches/patch-cd
deleted file mode 100644
index c94910caa7d..00000000000
--- a/misc/rpm/patches/patch-cd
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-cd,v 1.1 2003/10/19 16:05:21 grant Exp $
-
---- build/spec.c.orig 1998-09-28 06:16:58.000000000 +1000
-+++ build/spec.c
-@@ -1,7 +1,6 @@
- #include "config.h"
-
- #include <stdlib.h>
--#include <malloc.h>
- #include <string.h>
-
- #include "files.h"
diff --git a/misc/rpm/patches/patch-ce b/misc/rpm/patches/patch-ce
deleted file mode 100644
index 3290f7aba59..00000000000
--- a/misc/rpm/patches/patch-ce
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-ce,v 1.1 2007/02/18 11:17:42 tonio Exp $
-
---- lib/lookup.c.orig Mon Jan 12 17:58:31 1998
-+++ lib/lookup.c
-@@ -5,6 +5,7 @@
- #endif
-
- #include <string.h>
-+#include <stdlib.h>
-
- #include "intl.h"
- #include "rpmlib.h"
diff --git a/misc/rpm/patches/patch-cf b/misc/rpm/patches/patch-cf
deleted file mode 100644
index e844f3e85da..00000000000
--- a/misc/rpm/patches/patch-cf
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-cf,v 1.1 2007/02/18 11:17:03 tonio Exp $
-
---- lib/rebuilddb.c.orig Sun Sep 27 22:17:08 1998
-+++ lib/rebuilddb.c
-@@ -3,6 +3,7 @@
- #include <errno.h>
- #include <fcntl.h>
- #include <stdio.h>
-+#include <stdlib.h>
- #include <string.h>
- #include <sys/stat.h> /* for mkdir(2) !?! */
- #include <unistd.h>
diff --git a/misc/rpm/patches/patch-cg b/misc/rpm/patches/patch-cg
deleted file mode 100644
index a504d0af63a..00000000000
--- a/misc/rpm/patches/patch-cg
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-cg,v 1.1 2007/02/18 11:17:03 tonio Exp $
-
---- build.c.orig Thu Sep 24 22:23:16 1998
-+++ build.c
-@@ -8,6 +8,7 @@
- #include <errno.h>
- #include <fcntl.h>
- #include <stdio.h>
-+#include <stdlib.h>
- #include <string.h>
- #include <sys/stat.h>
- #include <unistd.h>
diff --git a/misc/rpm/patches/patch-configure.ac b/misc/rpm/patches/patch-configure.ac
new file mode 100644
index 00000000000..8327b81e63a
--- /dev/null
+++ b/misc/rpm/patches/patch-configure.ac
@@ -0,0 +1,22 @@
+$NetBSD: patch-configure.ac,v 1.1 2013/09/13 12:41:32 ryoon Exp $
+
+--- configure.ac.orig 2013-06-27 09:29:00.000000000 +0000
++++ configure.ac
+@@ -777,7 +777,7 @@ changequote([, ])
+
+ for provscript in ${host_cpu}-${host_os_exact}.prov ${host_os_exact}.prov ${host_os_major}.prov ${host_os_noversion}.prov none ; do {
+ if test -f ${srcdir}/autodeps/${provscript} ; then
+- if [[ ${provscript} == none ]] ; then
++ if [[ ${provscript} = none ]] ; then
+ echo "*** no default provides information is available for ${host_os_noversion}"
+ else
+ echo "using ${srcdir}/autodeps/${provscript} for automatic provides generation"
+@@ -790,7 +790,7 @@ for provscript in ${host_cpu}-${host_os_
+
+ for reqscript in ${host_cpu}-${host_os_exact}.req ${host_os_exact}.req ${host_os_major}.req ${host_os_noversion}.req none ; do {
+ if test -f ${srcdir}/autodeps/${reqscript} ; then
+- if [[ ${reqscript} == none ]] ; then
++ if [[ ${reqscript} = none ]] ; then
+ echo "*** no default requires information is available for ${host_os_noversion}"
+ else
+ echo "using ${srcdir}/autodeps/${reqscript} for automatic requires generation"
diff --git a/misc/rpm/patches/patch-misc_fts.c b/misc/rpm/patches/patch-misc_fts.c
new file mode 100644
index 00000000000..98e7df4f29d
--- /dev/null
+++ b/misc/rpm/patches/patch-misc_fts.c
@@ -0,0 +1,18 @@
+$NetBSD: patch-misc_fts.c,v 1.1 2013/09/13 12:41:32 ryoon Exp $
+
+* Definitions for NetBSD.
+
+--- misc/fts.c.orig 2012-11-18 08:21:06.000000000 +0000
++++ misc/fts.c
+@@ -61,6 +61,11 @@ static char sccsid[] = "@(#)fts.c 8.6 (B
+ # define _STAT_VER 0
+ # define __fxstat64(_stat_ver, _fd, _sbp) fstat64((_fd), (_sbp))
+ #endif
++#if defined(__NetBSD__)
++# define __errno_location() (&errno)
++# define stat64 stat
++# define __fxstat64(_stat_ver, _fd, _sbp) fstat((_fd), (_sbp))
++#endif
+ #include "system.h"
+ #include <stdlib.h>
+ #include <string.h>
diff --git a/misc/rpm/patches/patch-misc_fts.h b/misc/rpm/patches/patch-misc_fts.h
new file mode 100644
index 00000000000..5a1a619fee9
--- /dev/null
+++ b/misc/rpm/patches/patch-misc_fts.h
@@ -0,0 +1,17 @@
+$NetBSD: patch-misc_fts.h,v 1.1 2013/09/13 12:41:32 ryoon Exp $
+
+* Definition for NetBSD.
+
+--- misc/fts.h.orig 2013-06-10 15:55:10.000000000 +0000
++++ misc/fts.h
+@@ -61,6 +61,10 @@
+ # define _D_EXACT_NAMLEN(d) (strlen((d)->d_name))
+ #endif
+
++#if defined(__NetBSD__)
++# define _D_EXACT_NAMLEN(d) ((d)->d_reclen)
++#endif
++
+ #endif
+
+ #include <sys/types.h>
diff --git a/misc/rpm/patches/patch-system.h b/misc/rpm/patches/patch-system.h
new file mode 100644
index 00000000000..96d2abb26c6
--- /dev/null
+++ b/misc/rpm/patches/patch-system.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-system.h,v 1.1 2013/09/13 12:41:32 ryoon Exp $
+
+* NetBSD has setprogname(3).
+
+--- system.h.orig 2013-01-30 15:33:12.000000000 +0000
++++ system.h
+@@ -112,7 +112,7 @@ typedef char * security_context_t;
+ #define _free(_ptr) rfree((_ptr))
+
+ /* Retrofit glibc __progname */
+-#if defined __GLIBC__ && __GLIBC__ >= 2
++#if (defined __GLIBC__ && __GLIBC__ >= 2) || defined(__NetBSD__)
+ #if __GLIBC_MINOR__ >= 1
+ #define __progname __assert_program_name
+ #endif