summaryrefslogtreecommitdiff
path: root/misc/rpm/patches
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/patches
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/patches')
-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
19 files changed, 123 insertions, 260 deletions
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