diff --git a/.gitignore b/.gitignore
index 6584355..632bb62 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@
 /rpm-4.11.2-rc1.tar.bz2
 /rpm-4.11.2-rc2.tar.bz2
 /rpm-4.11.2.tar.bz2
+/rpm-4.11.90-git12844.tar.bz2
diff --git a/rpm-4.11.0.1-setuppy-fixes.patch b/rpm-4.11.0.1-setuppy-fixes.patch
deleted file mode 100644
index 2349ab0..0000000
--- a/rpm-4.11.0.1-setuppy-fixes.patch
+++ /dev/null
@@ -1,61 +0,0 @@
---- rpm-4.11.0.1/python/setup.py.in.setuppy-fixes	2012-11-07 13:55:24.000000000 +0100
-+++ rpm-4.11.0.1/python/setup.py.in	2013-04-03 14:16:48.149931703 +0200
-@@ -1,13 +1,19 @@
- #!/usr/bin/env python
- 
- from distutils.core import setup, Extension
-+import os
- import subprocess
- from glob import glob
- 
- def pkgconfig(what):
-     out = []
-     cmd = 'pkg-config %s %s' % (what, '@PACKAGE_NAME@')
--    pcout = subprocess.check_output(cmd.split()).decode()
-+    env = dict(os.environ, **{'PKG_CONFIG_PATH': '..'})
-+    proc = subprocess.Popen(cmd.split(),
-+                            stdout=subprocess.PIPE,
-+                            stderr=subprocess.PIPE,
-+                            env=env)
-+    pcout = proc.communicate()[0].decode()
-     for token in pcout.split():
-         out.append(token[2:])
-     return out
-@@ -18,7 +24,8 @@
-         srcs.extend(glob('%s*.c' % n))
-     return srcs
- 
--cflags = ['-std=c99']
-+cflags = ['-std=c99', '-I../include']
-+additional_link_args = ['-Wl,-L../rpmio/.libs', '-Wl,-L../lib/.libs', '-Wl,-L../build/.libs', '-Wl,-L../sign/.libs']
- 
- rpmmod = Extension('rpm._rpm',
-                    sources = mksources([
-@@ -28,21 +35,24 @@
-                              ]),
-                    include_dirs = pkgconfig('--cflags'),
-                    libraries = pkgconfig('--libs'),
--                   extra_compile_args = cflags
-+                   extra_compile_args = cflags,
-+                   extra_link_args = additional_link_args
-                   )
- 
- rpmbuild_mod = Extension('rpm._rpmb',
-                    sources = mksources(['rpmbmodule', 'spec']),
-                    include_dirs = pkgconfig('--cflags'),
-                    libraries = pkgconfig('--libs') + ['rpmbuild'],
--                   extra_compile_args = cflags
-+                   extra_compile_args = cflags,
-+                   extra_link_args = additional_link_args
-                   )
- 
- rpmsign_mod = Extension('rpm._rpms',
-                    sources = mksources(['rpmbmodule']),
-                    include_dirs = pkgconfig('--cflags'),
-                    libraries = pkgconfig('--libs') + ['rpmsign'],
--                   extra_compile_args = cflags
-+                   extra_compile_args = cflags,
-+                   extra_link_args = additional_link_args
-                   )
- 
- setup(name='@PACKAGE_NAME@-python',
diff --git a/rpm-4.11.2-appdata-prov.patch b/rpm-4.11.2-appdata-prov.patch
deleted file mode 100644
index 65e07de..0000000
--- a/rpm-4.11.2-appdata-prov.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/scripts/Makefile.am b/scripts/Makefile.am
-index 7656c80..d1aeeba 100644
---- a/scripts/Makefile.am
-+++ b/scripts/Makefile.am
-@@ -23,6 +23,7 @@ EXTRA_DIST = \
- 	macros.perl macros.php macros.python
- 
- rpmconfig_SCRIPTS = \
-+	appdata.prov \
- 	brp-compress brp-python-bytecompile brp-java-gcjcompile \
- 	brp-strip brp-strip-comment-note brp-python-hardlink \
- 	brp-strip-shared brp-strip-static-archive \
diff --git a/rpm-4.11.2-double-separator-warning.patch b/rpm-4.11.2-double-separator-warning.patch
deleted file mode 100644
index 23cdfa3..0000000
--- a/rpm-4.11.2-double-separator-warning.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff -up rpm-4.11.2/build/parseReqs.c.double-sep-warning rpm-4.11.2/build/parseReqs.c
---- rpm-4.11.2/build/parseReqs.c.double-sep-warning	2014-02-18 08:59:32.692891895 +0200
-+++ rpm-4.11.2/build/parseReqs.c	2014-02-18 09:00:17.572769945 +0200
-@@ -166,8 +166,11 @@ rpmRC parseRCPOT(rpmSpec spec, Package p
- 	    if (rpmCharCheck(spec, EVR, ve-v, ".-_+:%{}~")) goto exit;
- 
-             /* While ':' and '-' are valid, only one of each is valid. */
--	    if (checkSep(EVR, '-', &emsg) || checkSep(EVR, ':', &emsg))
--		goto exit;
-+	    if (checkSep(EVR, '-', &emsg) || checkSep(EVR, ':', &emsg)) {
-+		rpmlog(RPMLOG_WARNING, _("line %d: %s: %s\n"),
-+		       spec->lineNum, emsg, spec->line);
-+		emsg = _free(emsg);
-+	    }
- 
- 	    re = ve;	/* ==> next token after EVR string starts here */
- 	} else
diff --git a/rpm-4.11.2-macro-newlines.patch b/rpm-4.11.2-macro-newlines.patch
deleted file mode 100644
index 11a10de..0000000
--- a/rpm-4.11.2-macro-newlines.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-commit 1bdcd0500865efd3566efd7f951228f69b58e755
-Author: Panu Matilainen <pmatilai@redhat.com>
-Date:   Wed Feb 19 14:16:38 2014 +0200
-
-    Dont eat newlines on parametrized macro invocations (RhBug:1045723)
-    
-    - Makes the testcase from commit f082b5baa4dcf9601eeb1e0e520ff06e77dc61c0
-      succeed. While the old behavior is non-sensical and most likely entirely
-      unintentional, we're changing a very long-standing behavior here (tested
-      back to rpm 4.4.x and almost certainly much much older than that) so
-      its entirely possible people are actually relying on the old
-      behavior. Lets see what breaks...
-
-diff --git a/rpmio/macro.c b/rpmio/macro.c
-index e1c2a91..72471a2 100644
---- a/rpmio/macro.c
-+++ b/rpmio/macro.c
-@@ -764,7 +764,7 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se,
- 
- exit:
-     argvFree(argv);
--    return *lastc ? lastc + 1 : lastc; 
-+    return (*lastc == '\0' || *lastc == '\n') ? lastc : lastc + 1;
- }
- 
- /**
diff --git a/rpm-4.11.2-python3-buildsign.patch b/rpm-4.11.2-python3-buildsign.patch
deleted file mode 100644
index 4a878bd..0000000
--- a/rpm-4.11.2-python3-buildsign.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-commit 0073376965ee8d8df63c21b0da634fc315c97d0b
-Author: Panu Matilainen <pmatilai@redhat.com>
-Date:   Thu Feb 13 12:54:41 2014 +0200
-
-    Fix build and sign module initialization in python3 (RhBug:1064758)
-    
-    - PyInit_foo() name needs to match the module name. Doh.
-
-diff --git a/python/rpmbmodule.c b/python/rpmbmodule.c
-index f6e1491..ad30570 100644
---- a/python/rpmbmodule.c
-+++ b/python/rpmbmodule.c
-@@ -66,8 +66,8 @@ static struct PyModuleDef moduledef = {
-     NULL         /* m_free */
- };
- 
--PyObject * PyInit__rpm(void);	/* XXX eliminate gcc warning */
--PyObject * PyInit__rpm(void)
-+PyObject * PyInit__rpmb(void);	/* XXX eliminate gcc warning */
-+PyObject * PyInit__rpmb(void)
- {
-     PyObject *m;
- 
-diff --git a/python/rpmsmodule.c b/python/rpmsmodule.c
-index 3eb2403..653f4bf 100644
---- a/python/rpmsmodule.c
-+++ b/python/rpmsmodule.c
-@@ -66,8 +66,8 @@ static struct PyModuleDef moduledef = {
-     NULL         /* m_free */
- };
- 
--PyObject * PyInit__rpm(void);	/* XXX eliminate gcc warning */
--PyObject * PyInit__rpm(void)
-+PyObject * PyInit__rpms(void);	/* XXX eliminate gcc warning */
-+PyObject * PyInit__rpms(void)
- {
-     PyObject *m;
- 
diff --git a/rpm-4.11.x-do-not-filter-ld64.patch b/rpm-4.11.x-do-not-filter-ld64.patch
deleted file mode 100644
index 422bc67..0000000
--- a/rpm-4.11.x-do-not-filter-ld64.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From f6771b6722f0df097f9c61fc1b487f6f0ee402e8 Mon Sep 17 00:00:00 2001
-From: Florian Festi <ffesti@redhat.com>
-Date: Tue, 30 Jul 2013 16:35:21 +0200
-Subject: [PATCH] Do not filter ld64.* and ld64-* provides and requires Fixes
- #988373
-
----
- tools/elfdeps.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/tools/elfdeps.c b/tools/elfdeps.c
-index 906de10..8679f89 100644
---- a/tools/elfdeps.c
-+++ b/tools/elfdeps.c
-@@ -52,7 +52,8 @@ static int skipSoname(const char *soname)
- 	if (!strstr(soname, ".so"))
- 	    return 1;
- 
--	if (rstreqn(soname, "ld.", 3) || rstreqn(soname, "ld-", 3))
-+	if (rstreqn(soname, "ld.", 3) || rstreqn(soname, "ld-", 3) ||
-+	    rstreqn(soname, "ld64.", 3) || rstreqn(soname, "ld64-", 3))
- 	    return 0;
- 
- 	if (rstreqn(soname, "lib", 3))
--- 
-1.7.11.7
-
diff --git a/rpm-4.11.x-filter-soname-deps.patch b/rpm-4.11.x-filter-soname-deps.patch
deleted file mode 100644
index c52e11e..0000000
--- a/rpm-4.11.x-filter-soname-deps.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-commit 73bd9636d0e76a4d255776b7733667198b9ef585
-Author: Panu Matilainen <pmatilai@redhat.com>
-Date:   Mon Jan 7 15:52:43 2013 +0200
-
-    Filter ELF dependencies by name
-    
-    - Instead of vain heuristics on DT_SONAME presence, filter out
-      irregular sonames from all dependencies: linkable library names generally
-      must contain ".so" and start with "lib" for the linker to find it at all,
-      anything else is an exception of one kind or another (the prime exception
-      of ld.so variants we handle here). This weeds out provides for most
-      dlopen()'ed modules etc, and filtering both provides and requires
-      by the same rules means we wont generate requires for things that wont be
-      provided.  Of course this also means we can omit things that are in
-      DT_NEEDED, but these should be rare exceptions which the new
-      --no-filter-soname switch is for.
-
-diff --git a/tools/elfdeps.c b/tools/elfdeps.c
-index fc9a905..a0db9f7 100644
---- a/tools/elfdeps.c
-+++ b/tools/elfdeps.c
-@@ -15,6 +15,7 @@
- int filter_private = 0;
- int soname_only = 0;
- int fake_soname = 1;
-+int filter_soname = 1;
- 
- typedef struct elfInfo_s {
-     Elf *elf;
-@@ -36,6 +37,31 @@ static int skipPrivate(const char *s)
-     return (filter_private && rstreq(s, "GLIBC_PRIVATE"));
- }
- 
-+/*
-+ * Rough soname sanity filtering: all sane soname's dependencies need to
-+ * contain ".so", and normal linkable libraries start with "lib",
-+ * everything else is an exception of some sort. The most notable
-+ * and common exception is the dynamic linker itself, which we allow
-+ * here, the rest can use --no-filter-soname.
-+ */
-+static int skipSoname(const char *soname)
-+{
-+    if (filter_soname) {
-+	if (!strstr(soname, ".so"))
-+	    return 1;
-+
-+	if (rstreqn(soname, "ld.", 3) || rstreqn(soname, "ld-", 3))
-+	    return 0;
-+
-+	if (rstreqn(soname, "lib", 3))
-+	    return 0;
-+	else
-+	    return 1;
-+    }
-+
-+    return 0;
-+}
-+
- static const char *mkmarker(GElf_Ehdr *ehdr)
- {
-     const char *marker = NULL;
-@@ -58,6 +84,10 @@ static void addDep(ARGV_t *deps,
- 		   const char *soname, const char *ver, const char *marker)
- {
-     char *dep = NULL;
-+
-+    if (skipSoname(soname))
-+	return;
-+
-     if (ver || marker) {
- 	rasprintf(&dep,
- 		  "%s(%s)%s", soname, ver ? ver : "", marker ? marker : "");
-@@ -293,6 +323,7 @@ int main(int argc, char *argv[])
- 	{ "filter-private", 0, POPT_ARG_VAL, &filter_private, -1, NULL, NULL },
- 	{ "soname-only", 0, POPT_ARG_VAL, &soname_only, -1, NULL, NULL },
- 	{ "no-fake-soname", 0, POPT_ARG_VAL, &fake_soname, 0, NULL, NULL },
-+	{ "no-filter-soname", 0, POPT_ARG_VAL, &filter_soname, 0, NULL, NULL },
- 	POPT_AUTOHELP 
- 	POPT_TABLEEND
-     };
diff --git a/rpm-4.11.x-reset-fileactions.patch b/rpm-4.11.x-reset-fileactions.patch
deleted file mode 100644
index cf67f6b..0000000
--- a/rpm-4.11.x-reset-fileactions.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/lib/rpmfs.c b/lib/rpmfs.c
-index 764618d..916f6eb 100644
---- a/lib/rpmfs.c
-+++ b/lib/rpmfs.c
-@@ -18,7 +18,7 @@ rpmfs rpmfsNew(rpm_count_t fc, int initState)
-     rpmfs fs = xcalloc(1, sizeof(*fs));
-     fs->fc = fc;
-     fs->actions = xmalloc(fs->fc * sizeof(*fs->actions));
--    memset(fs->actions, FA_UNKNOWN, fs->fc * sizeof(*fs->actions));
-+    rpmfsResetActions(fs);
-     if (initState) {
- 	fs->states = xmalloc(sizeof(*fs->states) * fs->fc);
- 	memset(fs->states, RPMFILE_STATE_NORMAL, fs->fc);
-@@ -115,3 +115,10 @@ void rpmfsSetAction(rpmfs fs, unsigned int ix, rpmFileAction action)
- 	fs->actions[ix] = action;
-     }
- }
-+
-+void rpmfsResetActions(rpmfs fs)
-+{
-+    if (fs && fs->actions) {
-+	memset(fs->actions, FA_UNKNOWN, fs->fc * sizeof(*fs->actions));
-+    }
-+}
-diff --git a/lib/rpmfs.h b/lib/rpmfs.h
-index 5f74753..83f99d1 100644
---- a/lib/rpmfs.h
-+++ b/lib/rpmfs.h
-@@ -57,6 +57,9 @@ rpmFileAction rpmfsGetAction(rpmfs fs, unsigned int ix);
- RPM_GNUC_INTERNAL
- void rpmfsSetAction(rpmfs fs, unsigned int ix, rpmFileAction action);
- 
-+RPM_GNUC_INTERNAL
-+void rpmfsResetActions(rpmfs fs);
-+
- #ifdef __cplusplus
- }
- #endif
-diff --git a/lib/transaction.c b/lib/transaction.c
-index 02badc6..09c199a 100644
---- a/lib/transaction.c
-+++ b/lib/transaction.c
-@@ -1323,11 +1323,14 @@ static int rpmtsPrepare(rpmts ts)
- 
-     rpmlog(RPMLOG_DEBUG, "computing %" PRIu64 " file fingerprints\n", fileCount);
- 
--    /* Skip netshared paths, not our i18n files, and excluded docs */
-+    /* Reset actions, set skip for netshared paths and excluded files */
-     pi = rpmtsiInit(ts);
-     while ((p = rpmtsiNext(pi, 0)) != NULL) {
- 	if (rpmfiFC(rpmteFI(p)) == 0)
- 	    continue;
-+	/* Ensure clean state, this could get called more than once. */
-+	rpmfs fs = rpmteGetFileStates(p);
-+	rpmfsResetActions(fs);
- 	if (rpmteType(p) == TR_ADDED) {
- 	    skipInstallFiles(ts, p);
- 	} else {
diff --git a/rpm-4.11.x-rpmdeps-wrap.patch b/rpm-4.11.x-rpmdeps-wrap.patch
deleted file mode 100644
index f68712e..0000000
--- a/rpm-4.11.x-rpmdeps-wrap.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-commit 43383e0adbd79b2f6847298640f619565e37ad72
-Author: Panu Matilainen <pmatilai@redhat.com>
-Date:   Tue Apr 8 12:02:24 2014 +0300
-
-       Always use the new dependency generator "engine"
-    
-        - Replace platform specific find-{requires,provides} scripts with
-          trivial wrapper scripts that just call rpmdeps with suitable
-          arguments. This way the generated dependencies using the legacy
-          external dependency are at least roughly on par with the internal
-          depgen as, well, they're generated by the same thing.
-        - Changing from find-{requires,provides} scripts to rpmdeps could
-          be done by just changing __find_{requires,provides} macros, but
-          a lot of packages directly refer to the scripts instead so this
-          way we cover far more ground and in an backwards compatible way.
-
-diff --git a/Makefile.am b/Makefile.am
-index a6fa619..199cffb 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -96,8 +96,7 @@ rpmbin_PROGRAMS = rpm
- bin_PROGRAMS =		rpm2cpio rpmbuild rpmdb rpmkeys rpmsign rpmspec
- 
- rpmlibexec_PROGRAMS =
--rpmconfig_SCRIPTS =	autodeps/find-provides autodeps/find-requires \
--			mkinstalldirs \
-+rpmconfig_SCRIPTS =	mkinstalldirs \
- 			config.guess config.sub
- DISTCLEANFILES = autodeps/find-provides
- DISTCLEANFILES += autodeps/find-requires
-diff --git a/scripts/Makefile.am b/scripts/Makefile.am
-index 7656c80..f93901e 100644
---- a/scripts/Makefile.am
-+++ b/scripts/Makefile.am
-@@ -14,6 +14,7 @@ EXTRA_DIST = \
- 	perldeps.pl perl.prov perl.req pythondeps.sh osgideps.pl \
- 	rpmdb_loadcvt rpm.daily rpm.log rpm.supp rpm2cpio.sh \
- 	tcl.req tgpg vpkg-provides.sh \
-+	find-requires find-provides \
- 	find-requires.php find-provides.php \
- 	find-php-provides find-php-requires \
- 	mono-find-requires mono-find-provides \
-@@ -28,7 +29,7 @@ rpmconfig_SCRIPTS = \
- 	brp-strip-shared brp-strip-static-archive \
- 	check-files check-prereqs \
- 	check-buildroot check-rpaths check-rpaths-worker \
--	find-lang.sh \
-+	find-lang.sh find-requires find-provides \
- 	perl.prov perl.req perldeps.pl pythondeps.sh osgideps.pl \
- 	mono-find-requires mono-find-provides \
- 	pkgconfigdeps.sh libtooldeps.sh \
-diff --git a/scripts/find-provides b/scripts/find-provides
-new file mode 100644
-index 0000000..c5cf93b
---- /dev/null
-+++ b/scripts/find-provides
-@@ -0,0 +1,3 @@
-+#!/bin/sh
-+
-+/usr/lib/rpm/rpmdeps --provides
-diff --git a/scripts/find-requires b/scripts/find-requires
-new file mode 100644
-index 0000000..9d192dd
---- /dev/null
-+++ b/scripts/find-requires
-@@ -0,0 +1,3 @@
-+#!/bin/sh
-+
-+/usr/lib/rpm/rpmdeps --requires
diff --git a/rpm-4.6.0-niagara.patch b/rpm-4.6.0-niagara.patch
deleted file mode 100644
index c465b65..0000000
--- a/rpm-4.6.0-niagara.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-diff -up rpm-4.9.1.3/lib/rpmrc.c.niagara rpm-4.9.1.3/lib/rpmrc.c
---- rpm-4.9.1.3/lib/rpmrc.c.niagara	2012-04-19 17:06:23.130595223 +0200
-+++ rpm-4.9.1.3/lib/rpmrc.c	2012-04-19 17:06:23.134739249 +0200
-@@ -718,6 +718,31 @@ exit:
-     return rc;
- }
- 
-+#if defined(__linux__) && defined(__sparc__)
-+static int is_sun4v()
-+{
-+	char buffer[4096], *p;
-+	int fd = open("/proc/cpuinfo", O_RDONLY);
-+	if (read(fd, &buffer, sizeof(buffer) - 1) == -1) {
-+		rpmlog(RPMLOG_WARNING, _("read(/proc/cpuinfo) failed\n"));
-+		close(fd);
-+		return 0;
-+	}
-+	close(fd);
-+
-+	p = strstr(buffer, "type");
-+	p = strtok(p, "\n");
-+	p = strstr(p, "sun");
-+	if (p == NULL) {
-+		rpmlog(RPMLOG_WARNING, _("/proc/cpuinfo has no 'type' line\n"));
-+		return 0;
-+	} else if (strcmp(p, "sun4v") == 0) {
-+		return 1;
-+	}
-+	return 0;
-+}
-+#endif
-+
- 
- #	if defined(__linux__) && defined(__i386__)
- #include <setjmp.h>
-@@ -1178,6 +1203,13 @@ static void defaultMachine(const char **
- 		personality(oldpers);
- 	    }
- 	}
-+	if (is_sun4v()){
-+	    if (strcmp(un.machine, "sparcv9") == 0 || strcmp(un.machine, "sparc") == 0 ) {
-+	        strcpy(un.machine, "sparcv9v");
-+	    } else if (strcmp(un.machine, "sparc64") == 0 ) {
-+	        strcpy(un.machine, "sparc64v");
-+	    }
-+	}
- #	endif	/* sparc*-linux */
- 
- #	if defined(__linux__) && defined(__powerpc__)
-diff -up rpm-4.9.1.3/rpmrc.in.niagara rpm-4.9.1.3/rpmrc.in
---- rpm-4.9.1.3/rpmrc.in.niagara	2012-04-19 17:06:23.131476769 +0200
-+++ rpm-4.9.1.3/rpmrc.in	2012-04-19 17:06:23.135738996 +0200
-@@ -316,7 +316,7 @@ arch_compat: sun4c: sparc
- arch_compat: sun4d: sparc
- arch_compat: sun4m: sparc
- arch_compat: sun4u: sparc64
--arch_compat: sparc64v: sparc64
-+arch_compat: sparc64v: sparc64 sparcv9v
- arch_compat: sparc64: sparcv9
- arch_compat: sparcv9v: sparcv9
- arch_compat: sparcv9: sparcv8
diff --git a/rpm-4.9.0-armhfp-logic.patch b/rpm-4.9.0-armhfp-logic.patch
deleted file mode 100644
index a2e2d4e..0000000
--- a/rpm-4.9.0-armhfp-logic.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-diff --git a/lib/rpmrc.c b/lib/rpmrc.c
-index 4ebefa7..920ceed 100644
---- a/lib/rpmrc.c
-+++ b/lib/rpmrc.c
-@@ -737,6 +737,80 @@ static int is_sun4v()
- }
- #endif
- 
-+#if defined(__linux__) && defined(__arm__)
-+static int has_neon()
-+{
-+        char buffer[4096], *p;
-+        int fd = open("/proc/cpuinfo", O_RDONLY);
-+        if (read(fd, &buffer, sizeof(buffer) - 1) == -1) {
-+                rpmlog(RPMLOG_WARNING, _("read(/proc/cpuinfo) failed\n"));
-+                close(fd);
-+                return 0;
-+        }
-+        close(fd);
-+
-+        p = strstr(buffer, "Features");
-+        p = strtok(p, "\n");
-+        p = strstr(p, "neon");
-+        p = strtok(p, " ");
-+        if (p == NULL) {
-+                rpmlog(RPMLOG_WARNING, _("/proc/cpuinfo has no 'Features' line\n"));
-+                return 0;
-+        } else if (strcmp(p, "neon") == 0) {
-+                return 1;
-+        }
-+        return 0;
-+}
-+
-+static int has_vfpv3()
-+{
-+        char buffer[4096], *p;
-+        int fd = open("/proc/cpuinfo", O_RDONLY);
-+        if (read(fd, &buffer, sizeof(buffer) - 1) == -1) {
-+                rpmlog(RPMLOG_WARNING, _("read(/proc/cpuinfo) failed\n"));
-+                close(fd);
-+                return 0;
-+        }
-+        close(fd);
-+
-+        p = strstr(buffer, "Features");
-+        p = strtok(p, "\n");
-+        p = strstr(p, "vfpv3");
-+        p = strtok(p, " ");
-+        if (p == NULL) {
-+                rpmlog(RPMLOG_WARNING, _("/proc/cpuinfo has no 'Features' line\n"));
-+                return 0;
-+        } else if (strcmp(p, "vfpv3") == 0) {
-+                return 1;
-+        }
-+        return 0;
-+}
-+
-+static int has_vfp()
-+{
-+        char buffer[4096], *p;
-+        int fd = open("/proc/cpuinfo", O_RDONLY);
-+        if (read(fd, &buffer, sizeof(buffer) - 1) == -1) {
-+                rpmlog(RPMLOG_WARNING, _("read(/proc/cpuinfo) failed\n"));
-+                close(fd);
-+                return 0;
-+        }
-+        close(fd);
-+
-+        p = strstr(buffer, "Features");
-+        p = strtok(p, "\n");
-+        p = strstr(p, "vfp");
-+        p = strtok(p, " ");
-+        if (p == NULL) {
-+                rpmlog(RPMLOG_WARNING, _("/proc/cpuinfo has no 'Features' line\n"));
-+                return 0;
-+        } else if (strcmp(p, "vfp") == 0) {
-+                return 1;
-+        }
-+        return 0;
-+}
-+#endif
-+
- 
- #	if defined(__linux__) && defined(__i386__)
- #include <setjmp.h>
-@@ -1147,6 +1221,20 @@ static void defaultMachine(const char ** arch,
- #	endif	/* __ORDER_BIG_ENDIAN__ */
- #	endif	/* ppc64*-linux */
- 
-+#	if defined(__linux__) && defined(__arm__)
-+	{
-+	    if (strcmp(un.machine, "armv7l") == 0 ) {
-+	        if (has_neon() && has_vfpv3())
-+                    strcpy(un.machine, "armv7hnl");
-+                else if (has_vfpv3())
-+                    strcpy(un.machine, "armv7hl");
-+	    } else if (strcmp(un.machine, "armv6l") == 0 ) {
-+                if (has_vfp())
-+                    strcpy(un.machine, "armv6hl");
-+	    }
-+	}
-+#	endif	/* arm*-linux */
-+
- #	if defined(__GNUC__) && defined(__alpha__)
- 	{
- 	    unsigned long amask, implver;
diff --git a/rpm-4.9.90-armhfp.patch b/rpm-4.9.90-armhfp.patch
deleted file mode 100644
index 6f93f93..0000000
--- a/rpm-4.9.90-armhfp.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-diff --git a/macros.in b/macros.in
-index 5ae8c2b..1234409 100644
---- a/macros.in
-+++ b/macros.in
-@@ -999,7 +999,7 @@ done \
- 
- #------------------------------------------------------------------------------
- # arch macro for all supported ARM processors
--%arm	armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l
-+%arm	armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv6hl armv7l armv7hl armv7hnl
- 
- #------------------------------------------------------------------------------
- # arch macro for all supported Sparc processors
-diff --git a/rpmrc.in b/rpmrc.in
-index 0427913..bd39204 100644
---- a/rpmrc.in
-+++ b/rpmrc.in
-@@ -67,7 +67,11 @@ optflags: armv4tl -O2 -g -march=armv4t
- optflags: armv5tel -O2 -g -march=armv5te
- optflags: armv5tejl -O2 -g -march=armv5te
- optflags: armv6l -O2 -g -march=armv6
-+optflags: armv6hl -O2 -g -march=armv6 -mfloat-abi=hard -mfpu=vfp
-+
- optflags: armv7l -O2 -g -march=armv7
-+optflags: armv7hl -O2 -g -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16
-+optflags: armv7hnl -O2 -g -march=armv7-a -mfloat-abi=hard -mfpu=neon
- 
- optflags: atarist -O2 -g -fomit-frame-pointer
- optflags: atariste -O2 -g -fomit-frame-pointer
-@@ -180,7 +184,10 @@ arch_canon:     armv4l:	armv4l 	12
- arch_canon:     armv5tel: armv5tel 	12
- arch_canon:     armv5tejl: armv5tejl 	12
- arch_canon:     armv6l: armv6l 	12
-+arch_canon:     armv6hl: armv6hl 	12
- arch_canon:     armv7l: armv7l 	12
-+arch_canon:     armv7hl: armv7hl 	12
-+arch_canon:     armv7hnl: armv7hnl 	12
- 
- arch_canon:	m68kmint: m68kmint	13
- arch_canon:	atarist: m68kmint	13
-@@ -293,7 +300,10 @@ buildarchtranslate: armv4tl: armv4tl
- buildarchtranslate: armv5tel: armv5tel
- buildarchtranslate: armv5tejl: armv5tejl
- buildarchtranslate: armv6l: armv6l
-+buildarchtranslate: armv6hl: armv6hl
- buildarchtranslate: armv7l: armv7l
-+buildarchtranslate: armv7hl: armv7hl
-+buildarchtranslate: armv7hnl: armv7hnl
- 
- buildarchtranslate: atarist: m68kmint
- buildarchtranslate: atariste: m68kmint
-@@ -386,6 +396,9 @@ arch_compat: armv5tel: armv4tl
- arch_compat: armv4tl: armv4l
- arch_compat: armv4l: armv3l
- arch_compat: armv3l: noarch
-+arch_compat: armv7hnl: armv7hl
-+arch_compat: armv7hl: armv6hl
-+arch_compat: armv6hl: noarch
- 
- arch_compat: atarist: m68kmint noarch
- arch_compat: atariste: m68kmint noarch
-@@ -497,6 +510,10 @@ buildarch_compat: armv4tl: armv4l
- buildarch_compat: armv4l: armv3l
- buildarch_compat: armv3l: noarch
- 
-+buildarch_compat: armv7hnl: armv7hl
-+buildarch_compat: armv7hl: armv6hl
-+buildarch_compat: armv6hl: noarch
-+
- buildarch_compat: hppa2.0: hppa1.2
- buildarch_compat: hppa1.2: hppa1.1
- buildarch_compat: hppa1.1: hppa1.0
diff --git a/rpm.spec b/rpm.spec
index 93c4038..08f6dec 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -4,18 +4,21 @@
 %bcond_with int_bdb
 # run internal testsuite?
 %bcond_with check
-# disable plugins initially
-%bcond_with plugins
+# build with plugins?
+%bcond_without plugins
 # build with sanitizers?
 %bcond_with sanitizer
+# build with libarchive? (needed for rpm2archive)
+%bcond_without libarchive
 
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
 
 %define rpmhome /usr/lib/rpm
 
-%define rpmver 4.11.2
+%define rpmver 4.11.90
+%define snapver git12844
 %define srcver %{rpmver}%{?snapver:-%{snapver}}
-%define eggver %{rpmver}%{?snapver:_%{snapver}}
+%define eggver %{rpmver}
 
 %define bdbname libdb
 %define bdbver 5.3.15
@@ -24,10 +27,10 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: %{?snapver:0.%{snapver}.}17%{?dist}
+Release: %{?snapver:0.%{snapver}.}1%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
-Source0: http://rpm.org/releases/rpm-4.11.x/%{name}-%{srcver}.tar.bz2
+Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
 %if %{with int_bdb}
 Source1: db-%{bdbver}.tar.gz
 %else
@@ -43,26 +46,8 @@ Patch2: rpm-4.9.90-fedora-specspo.patch
 Patch3: rpm-4.9.90-no-man-dirs.patch
 # gnupg2 comes installed by default, avoid need to drag in gnupg too
 Patch4: rpm-4.8.1-use-gpg2.patch
-Patch5: rpm-4.9.90-armhfp.patch
-#conditionally applied patch for arm hardware floating point
-Patch6: rpm-4.9.0-armhfp-logic.patch
-
-# Fedora has big package stacks based on broken dependency EVRs, reduce the
-# double separator error into an error on released versions (#1065563)
-Patch10: rpm-4.11.2-double-separator-warning.patch
-
-# Patches already in upstream
-# Filter soname dependencies by name
-Patch100: rpm-4.11.x-filter-soname-deps.patch
-Patch101: rpm-4.11.x-do-not-filter-ld64.patch
-Patch102: rpm-4.11.2-macro-newlines.patch
-Patch103: rpm-4.11.x-reset-fileactions.patch
-Patch104: rpm-4.11.2-python3-buildsign.patch
-Patch105: rpm-4.11.x-rpmdeps-wrap.patch
-Patch106: rpm-4.11.2-appdata-prov.patch
 
 # These are not yet upstream
-Patch301: rpm-4.6.0-niagara.patch
 Patch302: rpm-4.7.1-geode-i686.patch
 # Probably to be upstreamed in slightly different form
 Patch304: rpm-4.9.1.1-ld-flags.patch
@@ -72,8 +57,6 @@ Patch305: rpm-4.10.0-dwz-debuginfo.patch
 Patch306: rpm-4.10.0-minidebuginfo.patch
 # Fix CRC32 after dwz (#971119)
 Patch307: rpm-4.11.1-sepdebugcrcfix.patch
-# To be upstreamed in slightly different form
-Patch308: rpm-4.11.0.1-setuppy-fixes.patch
 # Temporary Patch to provide support for updates
 Patch400: rpm-4.10.90-rpmlib-filesystem-check.patch
 
@@ -110,9 +93,6 @@ BuildRequires: nss-softokn-freebl-devel
 BuildRequires: popt-devel >= 1.10.2
 BuildRequires: file-devel
 BuildRequires: gettext-devel
-BuildRequires: libselinux-devel
-# XXX semanage is only used by sepolicy plugin but configure requires it...
-BuildRequires: libsemanage-devel
 BuildRequires: ncurses-devel
 BuildRequires: bzip2-devel >= 0.9.0c-2
 BuildRequires: python-devel >= 2.6
@@ -123,11 +103,19 @@ BuildRequires: libacl-devel
 %if ! %{without xz}
 BuildRequires: xz-devel >= 4.999.8
 %endif
+%if ! %{without libarchive}
+BuildRequires: libarchive-devel
+%endif
 # Only required by sepdebugcrcfix patch
 BuildRequires: binutils-devel
 # Couple of patches change makefiles so, require for now...
 BuildRequires: automake libtool
 
+%if %{with plugins}
+BuildRequires: libselinux-devel
+BuildRequires: dbus-devel
+%endif
+
 %if %{with sanitizer}
 BuildRequires: libasan
 BuildRequires: libubsan
@@ -151,6 +139,10 @@ Requires: rpm = %{version}-%{release}
 # librpm uses cap_compare, introduced sometimes between libcap 2.10 and 2.16.
 # A manual require is needed, see #505596
 Requires: libcap%{_isa} >= 2.16
+# Drag in SELinux support at least for transition phase
+%if %{with plugins}
+Requires: rpm-plugin-selinux%{_isa} = %{version}-%{release}
+%endif
 
 %description libs
 This package contains the RPM shared libraries.
@@ -259,6 +251,32 @@ Requires: crontabs logrotate rpm = %{version}-%{release}
 This package contains a cron job which creates daily logs of installed
 packages on a system.
 
+%if %{with plugins}
+%package plugin-selinux
+Summary: Rpm plugin for SELinux functionality
+Group: System Environment/Base
+Requires: rpm-libs%{_isa} = %{version}-%{release}
+
+%description plugin-selinux
+%{summary}
+
+%package plugin-syslog
+Summary: Rpm plugin for syslog functionality
+Group: System Environment/Base
+Requires: rpm-libs%{_isa} = %{version}-%{release}
+
+%description plugin-syslog
+%{summary}
+
+%package plugin-systemd-inhibit
+Summary: Rpm plugin for systemd inhibit functionality
+Group: System Environment/Base
+Requires: rpm-libs%{_isa} = %{version}-%{release}
+
+%description plugin-systemd-inhibit
+%{summary}
+%endif
+
 %prep
 %setup -q -n %{name}-%{srcver} %{?with_int_bdb:-a 1}
 %patch1 -p1 -b .siteconfig
@@ -266,32 +284,14 @@ packages on a system.
 %patch3 -p1 -b .no-man-dirs
 %patch4 -p1 -b .use-gpg2
 
-%patch10 -p1 -b .double-sep-warning
-
-%patch100 -p1 -b .filter-soname-deps
-%patch101 -p1 -b .dont-filter-ld64
-#patch102 -p1 -b .macro-newlines
-%patch103 -p1 -b .reset-fileactions
-%patch104 -p1 -b .python3-buildsign
-%patch105 -p1 -b .rpmdeps-wrap
-%patch106 -p1 -b .appdata-prov
-
-%patch301 -p1 -b .niagara
 %patch302 -p1 -b .geode
 %patch304 -p1 -b .ldflags
 %patch305 -p1 -b .dwz-debuginfo
 %patch306 -p1 -b .minidebuginfo
 %patch307 -p1 -b .sepdebugcrcfix
-%patch308 -p1 -b .setuppy-fixes
 
 %patch400 -p1 -b .rpmlib-filesystem-check
 
-%patch5 -p1 -b .armhfp
-# this patch cant be applied on softfp builds
-%ifnarch armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l
-%patch6 -p1 -b .armhfp-logic
-%endif
-
 %if %{with int_bdb}
 ln -s db-%{bdbver} db
 %endif
@@ -420,6 +420,7 @@ exit 0
 %attr(0644, root, root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/lib/rpm/*
 
 /bin/rpm
+%{_bindir}/rpm2archive
 %{_bindir}/rpm2cpio
 %{_bindir}/rpmdb
 %{_bindir}/rpmkeys
@@ -458,8 +459,17 @@ exit 0
 %defattr(-,root,root)
 %{_libdir}/librpmio.so.*
 %{_libdir}/librpm.so.*
+%dir %{_libdir}/rpm-plugins
+
 %if %{with plugins}
-%{_libdir}/rpm-plugins
+%files plugin-syslog
+%{_libdir}/rpm-plugins/syslog.so
+
+%files plugin-selinux
+%{_libdir}/rpm-plugins/selinux.so
+
+%files plugin-systemd-inhibit
+%{_libdir}/rpm-plugins/systemd_inhibit.so
 %endif
 
 %files build-libs
@@ -528,6 +538,11 @@ exit 0
 %doc doc/librpm/html/*
 
 %changelog
+* Mon Jun 30 2014 Panu Matilainen <pmatilai@redhat.com> - 4.11.90-0.git12844.1
+- Update to rpm 4.12-alpha ((http://rpm.org/wiki/Releases/4.12.0)
+- Drop/adjust patches as appropriate
+- New sub-package(s) for plugins
+
 * Thu Jun 26 2014 Panu Matilainen <pmatilai@redhat.com> - 4.11.2-17
 - Clean up old, no longer needed cruft from spec
 
diff --git a/sources b/sources
index d09b363..d75c90a 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-876ac9948a88367054f8ddb5c0e87173  rpm-4.11.2.tar.bz2
+c718e4c88cea11a67b182ea0101814aa  rpm-4.11.90-git12844.tar.bz2