--- /dev/null
+--- rpm-4.16.0/build/rpmbuild_internal.h~ 2020-05-28 12:04:25.000000000 +0200
++++ rpm-4.16.0/build/rpmbuild_internal.h 2020-11-21 19:32:47.432243301 +0100
+@@ -18,7 +18,7 @@
+ #undef HTDATATYPE
+
+ #define WHITELIST_NAME ".-_+%{}"
+-#define WHITELIST_VERREL "._+%{}~^"
++#define WHITELIST_VERREL "._+%{}~^@"
+ #define WHITELIST_EVR WHITELIST_VERREL "-:"
+ #define LEN_AND_STR(_tag) (sizeof(_tag)-1), (_tag)
+
--- /dev/null
+diff -ur rpm-4.16.0/lib/depends.c rpm-4.16.0-cpuinfo/lib/depends.c
+--- rpm-4.16.0/lib/depends.c 2020-11-08 20:19:15.625093667 +0100
++++ rpm-4.16.0-cpuinfo/lib/depends.c 2020-11-08 20:23:46.685893216 +0100
+@@ -697,6 +697,16 @@
+ }
+ }
+
++ if (strstr(N, "cpuinfo(") == N) {
++ if (tsmem->cpuinfo == NULL)
++ rpmdsCpuinfoPool(rpmtsPool(ts), &(tsmem->cpuinfo));
++
++ if (tsmem->cpuinfo != NULL && rpmdsSearch(tsmem->cpuinfo, dep) >= 0) {
++ rpmdsNotify(dep, "(cpuinfo provides)", rc);
++ goto exit;
++ }
++ }
++
+ /* Dont look at pre-requisites of already installed packages */
+ if (!adding && isTransientReq(dsflags))
+ goto exit;
+diff -ur rpm-4.16.0/lib/rpmds.c rpm-4.16.0-cpuinfo/lib/rpmds.c
+--- rpm-4.16.0/lib/rpmds.c 2020-11-08 20:19:15.625093667 +0100
++++ rpm-4.16.0-cpuinfo/lib/rpmds.c 2020-11-08 20:16:25.941242497 +0100
+@@ -2,6 +2,8 @@
+ * \file lib/rpmds.c
+ */
+ #include "system.h"
++#include <popt.h>
++#include <ctype.h>
+ #include <sys/utsname.h>
+
+ #include <rpm/rpmtypes.h>
+@@ -9,6 +11,9 @@
+ #include <rpm/rpmstring.h>
+ #include <rpm/rpmlog.h>
+ #include <rpm/rpmstrpool.h>
++#include <rpm/rpmmacro.h>
++
++#include "rpmio/rpmio_internal.h" /* XXX for rpmioSlurp */
+
+ #include "lib/rpmds_internal.h"
+
+@@ -1655,3 +1670,203 @@
+ {
+ return rpmdsUnamePool(NULL, dsp);
+ }
++
++struct cpuinfo_s {
++ const char *name;
++ int done;
++ int flags;
++};
++
++static struct cpuinfo_s ctags[] = {
++ { "processor", 0, 0 },
++ { "Processor", 0, 1 }, /* XXX armv5 */
++ { "vendor_id", 0, 0 },
++ { "cpu_family", 0, 1 },
++ { "model", 0, 1 },
++ { "model_name", 0, 0 },
++ { "stepping", 0, 1 },
++ { "cpu_MHz", 0, 1 },
++ { "CPU_implementer",0, 1 }, /* XXX armv5 */
++ { "CPU_architecture",0, 1 }, /* XXX armv5 */
++ { "CPU_variant", 0, 1 }, /* XXX armv5 */
++ { "CPU_part", 0, 1 }, /* XXX armv5 */
++ { "CPU_revision", 0, 1 }, /* XXX armv5 */
++ { "Hardware", 0, 2 }, /* XXX armv5 */
++ { "Revision", 0, 1 }, /* XXX armv5 */
++ { "Serial", 0, 1 }, /* XXX armv5 */
++ { "cache_size", 0, 1 },
++ { "physical_id", 0, 0 },
++ { "siblings", 0, 0 },
++ { "core_id", 0, 0 },
++ { "cpu_cores", 0, 0 },
++ { "fdiv_bug", 0, 3 },
++ { "hlt_bug", 0, 3 },
++ { "f00f_bug", 0, 3 },
++ { "coma_bug", 0, 3 },
++ { "fpu", 0, 0 }, /* XXX use flags attribute instead. */
++ { "fpu_exception", 0, 3 },
++ { "cpuid_level", 0, 0 },
++ { "wp", 0, 3 },
++ { "flags", 0, 4 },
++ { "Features", 0, 4 }, /* XXX armv5 */
++ { "bogomips", 0, 1 },
++ { "BogoMIPS", 0, 1 }, /* XXX armv5 */
++ { "clflush_size", 0, 1 },
++ { NULL, 0, -1 }
++};
++
++/**
++ * Return dependency format to use for a cpuinfo line.
++ * @param name field name
++ * @return type of format (0 == ignore, -1 == not found)
++ */
++static int rpmdsCpuinfoCtagFlags(const char * name)
++{
++ struct cpuinfo_s * ct;
++ int flags = -1;
++
++ for (ct = ctags; ct->name != NULL; ct++) {
++ if (strcmp(ct->name, name))
++ continue;
++ if (ct->done)
++ continue;
++ ct->done = 1; /* XXX insure single occurrence */
++ flags = ct->flags;
++ break;
++ }
++ return flags;
++}
++
++#define _PROC_CPUINFO "/proc/cpuinfo"
++
++int rpmdsCpuinfoPool(rpmstrPool pool, rpmds *dsp)
++{
++ char * cpuinfo_path = NULL;
++ struct cpuinfo_s * ct;
++ const char * NS = "cpuinfo";
++ char * iob = NULL;
++ char * f, * fe, * fend;
++ char * g, * ge;
++ char * t;
++ int rc = -1;
++
++ cpuinfo_path = rpmExpand("%{?_rpmds_cpuinfo_path}", NULL);
++ /* XXX may need to validate path existence somewhen. */
++ if (cpuinfo_path == NULL || *cpuinfo_path != '/') {
++ cpuinfo_path = _free(cpuinfo_path);
++ cpuinfo_path = xstrdup(_PROC_CPUINFO);
++ }
++
++ /* Reset done variables. */
++ for (ct = ctags; ct->name != NULL; ct++)
++ ct->done = 0;
++
++ rc = rpmioSlurp(cpuinfo_path, (uint8_t **) &iob, NULL);
++ if (rc != 0 || iob == NULL)
++ goto exit;
++
++ for (f = (char *)iob; *f != '\0'; f = fend) {
++ /* find EOL */
++ fe = f;
++ while (*fe != '\0' && !(*fe == '\n' || *fe == '\r'))
++ fe++;
++ ge = fe;
++ while (*fe != '\0' && (*fe == '\n' || *fe == '\r'))
++ *fe++ = '\0';
++ fend = fe;
++
++ /* rtrim on line. */
++ while (--ge > f && isspace(*ge))
++ *ge = '\0';
++
++ /* ltrim on line. */
++ while (*f && isspace(*f))
++ f++;
++
++ /* split on ':' */
++ fe = f;
++ while (*fe && *fe != ':')
++ fe++;
++ if (*fe == '\0')
++ continue;
++ g = fe + 1;
++
++ /* rtrim on field 1. */
++ *fe = '\0';
++ while (--fe > f && isspace(*fe))
++ *fe = '\0';
++ if (*f == '\0')
++ continue;
++
++ /* ltrim on field 2. */
++ while (*g && isspace(*g))
++ g++;
++ if (*g == '\0')
++ continue;
++
++ for (t = f; *t != '\0'; t++) {
++ if (isspace(*t))
++ *t = '_';
++ }
++
++ switch (rpmdsCpuinfoCtagFlags(f)) {
++ case -1: /* not found */
++ case 0: /* ignore */
++ default:
++ continue;
++ break;
++ case 1: /* Provides: cpuinfo(f) = g */
++ for (t = g; *t != '\0'; t++) {
++ if (isspace(*t) || *t == '(' || *t == ')')
++ *t = '_';
++ }
++ rc = rpmdsNSAdd(pool, dsp, NS, f, g, RPMSENSE_EQUAL);
++ if (rc < 0)
++ goto exit;
++ break;
++ case 2: /* Provides: cpuinfo(g) */
++ for (t = g; *t != '\0'; t++) {
++ if (isspace(*t) || *t == '(' || *t == ')')
++ *t = '_';
++ }
++ rc = rpmdsNSAdd(pool, dsp, NS, g, "", RPMSENSE_ANY);
++ if (rc < 0)
++ goto exit;
++ break;
++ case 3: /* if ("yes") Provides: cpuinfo(f) */
++ if (!strcmp(g, "yes")) {
++ rc = rpmdsNSAdd(pool, dsp, NS, f, "", RPMSENSE_ANY);
++ if (rc < 0)
++ goto exit;
++ }
++ break;
++ case 4: /* Provides: cpuinfo(g[i]) */
++ { char ** av = NULL;
++ int i = 0;
++ rc = poptParseArgvString(g, NULL, (const char ***)&av);
++ if (!rc && av != NULL)
++ while ((t = av[i++]) != NULL) {
++ rc = rpmdsNSAdd(pool, dsp, NS, t, "", RPMSENSE_ANY);
++ if (rc < 0)
++ goto exit;
++ }
++ t = NULL;
++ if (av != NULL)
++ free(av);
++ } break;
++ }
++ }
++
++exit:
++ _free(cpuinfo_path);
++ free(iob);
++ /* freeze the pool to save memory, but only if private pool */
++ if (*dsp && (*dsp)->pool != pool)
++ rpmstrPoolFreeze((*dsp)->pool, 0);
++ return (rc < 0) ? -1 : 0;
++}
++
++int rpmdsCpuinfo(rpmds * dsp)
++{
++ return rpmdsCpuinfoPool(NULL, dsp);
++}
+diff -ur rpm-4.16.0/lib/rpmds.h rpm-4.16.0-cpuinfo/lib/rpmds.h
+--- rpm-4.16.0/lib/rpmds.h 2020-11-08 20:19:15.625093667 +0100
++++ rpm-4.16.0-cpuinfo/lib/rpmds.h 2020-11-08 20:03:44.001865655 +0100
+@@ -419,6 +419,13 @@
+ */
+ int rpmdsUname(rpmds * dsp);
+
++/**
++ * Load cpuinfo provides into a dependency set.
++ * @retval *dsp (loaded) dependency set
++ * @return 0 on success
++ */
++int rpmdsCpuinfo(rpmds * dsp);
++
+ /** \ingroup rpmds
+ * Create and load a dependency set.
+ * @param pool shared string pool (or NULL for private pool)
+@@ -483,6 +490,14 @@
+ */
+ int rpmdsUnamePool(rpmstrPool pool, rpmds * dsp);
+
++/**
++ * Load cpuinfo provides into a dependency set.
++ * @param pool shared string pool (or NULL for private pool)
++ * @retval *dsp (loaded) dependency set
++ * @return 0 on success
++ */
++int rpmdsCpuinfoPool(rpmstrPool pool, rpmds * dsp);
++
+
+ typedef enum rpmrichOp_e {
+ RPMRICHOP_SINGLE = 1,
+diff -ur rpm-4.16.0/lib/rpmts_internal.h rpm-4.16.0-cpuinfo/lib/rpmts_internal.h
+--- rpm-4.16.0/lib/rpmts_internal.h 2020-11-08 20:19:15.625093667 +0100
++++ rpm-4.16.0-cpuinfo/lib/rpmts_internal.h 2020-11-08 20:22:24.382319931 +0100
+@@ -22,6 +22,7 @@
+
+ rpmds rpmlib; /*!< rpmlib() dependency set. */
+ rpmds uname; /*!< uname() dependency set. */
++ rpmds cpuinfo; /*!< cpuinfo() dependency set. */
+ rpmte * order; /*!< Packages sorted by dependencies. */
+ int orderCount; /*!< No. of transaction elements. */
+ int orderAlloced; /*!< No. of allocated transaction elements. */
fi
fi
-if ! /usr/lib/rpm/rpmdb_reset -r lsn "$ROOTDIR"/var/lib/rpm/Packages ; then
- echo
- echo "rpm database conversion failed!"
- echo
- echo "You have to run:"
- echo
- echo " /usr/lib/rpm/rpmdb_reset -r lsn /var/lib/rpm/Packages"
- echo " /bin/rm -f /var/lib/rpm/__db.00*"
- echo " /bin/rm -rf /var/lib/rpm/log"
- echo " /usr/bin/rpmdb --rebuilddb"
- echo
-else
- /bin/rm --interactive=never -f "$ROOTDIR"/var/lib/rpm/__db.00* >/dev/null 2>/dev/null || :
- /bin/rm --interactive=never -rf "$ROOTDIR"/var/lib/rpm/log >/dev/null 2>/dev/null || :
- /bin/rm --interactive=never -rf "$ROOTDIR"/var/lib/rpm/tmp >/dev/null 2>/dev/null || :
-
- if ! /usr/bin/rpmdb --rebuilddb ${ROOTDIR:+--root="$ROOTDIR"}; then
+if [ -f "$ROOTDIR"/var/lib/rpm/Packages ]; then
+ if ! /usr/lib/rpm/rpmdb_reset -r lsn "$ROOTDIR"/var/lib/rpm/Packages ; then
echo
echo "rpm database conversion failed!"
- echo "You have to run /usr/bin/rpmdb manually"
echo
+ echo "You have to run:"
+ echo
+ echo " /usr/lib/rpm/rpmdb_reset -r lsn /var/lib/rpm/Packages"
+ echo " /bin/rm -f /var/lib/rpm/__db.00*"
+ echo " /bin/rm -rf /var/lib/rpm/log"
+ echo " /usr/bin/rpmdb --rebuilddb"
+ echo
+ exit
fi
+
+ /bin/rm --interactive=never -f "$ROOTDIR"/var/lib/rpm/__db.00* >/dev/null 2>/dev/null || :
+ /bin/rm --interactive=never -rf "$ROOTDIR"/var/lib/rpm/log >/dev/null 2>/dev/null || :
+ /bin/rm --interactive=never -rf "$ROOTDIR"/var/lib/rpm/tmp >/dev/null 2>/dev/null || :
+fi
+
+if ! /usr/bin/rpmdb --rebuilddb ${ROOTDIR:+--root="$ROOTDIR"}; then
+ echo
+ echo "rpm database conversion failed!"
+ echo "You have to run /usr/bin/rpmdb manually"
+ echo
fi
--- /dev/null
+--- rpm-4.16.0/configure.ac~ 2020-11-22 19:47:14.000000000 +0100
++++ rpm-4.16.0/configure.ac 2020-11-22 19:49:03.093877834 +0100
+@@ -76,6 +76,7 @@
+ dnl Find some common programs
+ dnl
+ AC_PATH_PROGS(__7ZIP, [7zip 7za 7z], /usr/bin/7za, $MYPATH)
++AC_PATH_PROG(__BASH, bash, /bin/bash, $MYPATH)
+ AC_PATH_PROG(__BZIP2, bzip2, /usr/bin/bzip2, $MYPATH)
+ AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH)
+ AC_PATH_PROG(__CHGRP, chgrp, /bin/chgrp, $MYPATH)
+@@ -91,6 +92,7 @@
+ AC_PATH_PROG(__UNZIP, unzip, /usr/bin/unzip, $MYPATH)
+ AC_PATH_PROG(__ID, id, /usr/bin/id, $MYPATH)
+ AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH)
++AC_PATH_PROG(__LN, ln, /bin/ln, $MYPATH)
+ AC_PATH_PROG(__LRZIP, lrzip, /usr/bin/lrzip, $MYPATH)
+ AC_PATH_PROG(__LZIP, lzip, /usr/bin/lzip, $MYPATH)
+ AC_PATH_PROG(__XZ, xz, /usr/bin/xz, $MYPATH)
+@@ -104,6 +106,7 @@
+ AC_PATH_PROG(__RSH, rsh, /usr/bin/rsh, $MYPATH)
+ AC_PATH_PROG(__SED, sed, /bin/sed, $MYPATH)
+ AC_PATH_PROG(__SEMODULE, semodule, /usr/bin/semodule, $MYPATH)
++AC_PATH_PROG(__SH, sh, /bin/sh, $MYPATH)
+ AC_PATH_PROG(__SSH, ssh, /usr/bin/ssh, $MYPATH)
+ AC_PATH_PROG(__TAR, tar, /bin/tar, $MYPATH)
+ AC_PATH_PROG(__ZSTD, zstd, /usr/bin/zstd, $MYPATH)
+--- rpm-4.16.0/macros.in~ 2020-11-21 19:41:19.000000000 +0100
++++ rpm-4.16.0/macros.in 2020-11-22 19:45:24.182620411 +0100
+@@ -6,6 +6,7 @@
+ # should be added to /etc/rpm/macros, while per-user configuration should
+ # be added to ~/.rpmmacros.
+ #
++%_rpmversion @VERSION@
+
+ #==============================================================================
+ # ---- A macro that expands to nothing.
+@@ -25,6 +25,7 @@
+ #
+ %__7zip @__7ZIP@
+ %__awk @AWK@
++%__bash @__BASH@
+ %__bzip2 @__BZIP2@
+ %__cat @__CAT@
+ %__chgrp @__CHGRP@
+@@ -39,6 +40,7 @@
+ %__id @__ID@
+ %__id_u %{__id} -u
+ %__install @__INSTALL@
++%__ln @__LN@
+ %__ln_s @LN_S@
+ %__lrzip @__LRZIP@
+ %__lzip @__LZIP@
+@@ -54,6 +57,7 @@
+ %__rsh @__RSH@
+ %__sed @__SED@
+ %__semodule @__SEMODULE@
++%__sh @__SH@
+ %__ssh @__SSH@
+ %__tar @__TAR@
+ %__unzip @__UNZIP@
--- /dev/null
+* Provides for libraries are not populated if %install does not set
+ executable bit on ELF file. One such notable example is libgcc_s
+ installed with mode 644 by `make install`:
+
+rpm5:
+
+$ rpm -q --provides libgcc | grep libgcc_s
+libgcc_s.so.1
+libgcc_s.so.1(GCC_3.0)
+libgcc_s.so.1(GCC_3.3)
+libgcc_s.so.1(GCC_3.3.1)
+libgcc_s.so.1(GCC_3.4)
+libgcc_s.so.1(GCC_3.4.2)
+libgcc_s.so.1(GCC_4.0.0)
+libgcc_s.so.1(GCC_4.2.0)
+libgcc_s.so.1(GCC_4.3.0)
+libgcc_s.so.1(GCC_4.4.0)
+libgcc_s.so.1(GCC_4.5.0)
+libgcc_s.so.1(GCC_4.7.0)
+libgcc_s.so.1(GCC_4.8.0)
+libgcc_s.so.1(GCC_7.0.0)
+libgcc_s.so.1(GLIBC_2.0)
+libgcc_s.so.1()(64bit)
+libgcc_s.so.1(GCC_3.0)(64bit)
+libgcc_s.so.1(GCC_3.3)(64bit)
+libgcc_s.so.1(GCC_3.3.1)(64bit)
+libgcc_s.so.1(GCC_3.4)(64bit)
+libgcc_s.so.1(GCC_3.4.2)(64bit)
+libgcc_s.so.1(GCC_3.4.4)(64bit)
+libgcc_s.so.1(GCC_4.0.0)(64bit)
+libgcc_s.so.1(GCC_4.2.0)(64bit)
+libgcc_s.so.1(GCC_4.3.0)(64bit)
+libgcc_s.so.1(GCC_4.7.0)(64bit)
+libgcc_s.so.1(GCC_4.8.0)(64bit)
+libgcc_s.so.1(GCC_7.0.0)(64bit)
+
+rpm4:
+
+$ rpm -q --provides -p libgcc-10.2.0-1.x86_64.rpm | grep libgcc_s
+(empty)
+
+Aa a workaround we could remove "exeonly" from %__elf_flags in
+/usr/lib/rpm/fileattrs/elf.attr but ideally RPM should not look at
+actual file mode on disk but rather on mode configured in %files.
+
+--- rpm-4.16.0/fileattrs/elf.attr~ 2020-05-28 12:04:25.000000000 +0200
++++ rpm-4.16.0/fileattrs/elf.attr 2020-11-21 19:35:52.405659895 +0100
+@@ -1,4 +1,4 @@
+ %__elf_provides %{_rpmconfigdir}/elfdeps --provides %{?__filter_GLIBC_PRIVATE:--filter-private}
+ %__elf_requires %{_rpmconfigdir}/elfdeps --requires %{?__filter_GLIBC_PRIVATE:--filter-private}
+ %__elf_magic ^(setuid,? )?(setgid,? )?(sticky )?ELF (32|64)-bit.*$
+-%__elf_flags exeonly
++#__elf_flags exeonly
+++ /dev/null
-#!/bin/sh
-build_hrmib_cache() {
- # skip if no rpm(1), touch(1), xargs(1)
- [ -x /bin/rpm -a -x /bin/touch -a -x /bin/xargs ] || return
-
- export LC_ALL=C
- umask 002
-
- mydir=/var/cache/hrmib
-
- echo >&2 "Populating $mydir with initial contents"
- mkdir -p $mydir || return
- echo $mydir/* | xargs rm -f
-
- buf=$(rpm --nodigest --nosignature -qa --qf '%{N}-%{V}-%{R}.%{ARCH} %{INSTALLTIME:date}\n')
- echo "$buf" | while read nvra idate; do
- touch -d "$idate" "$mydir/$nvra"
- done
- touch $mydir
-}
-
-build_hrmib_cache
Summary(uk.UTF-8): Менеджер пакетів від RPM
Name: rpm
Version: 4.16.0
-Release: 0.4
+Release: 0.9
Epoch: 1
License: GPL v2 / LGPL v2.1
Group: Base
Source5: %{name}.groups
Source6: %{name}-groups-po.awk
Source7: %{name}-install-tree
-Source8: %{name}-hrmib-cache
Source9: %{name}-user_group.sh
# http://svn.pld-linux.org/banner.sh/
Source10: banner.sh
Patch15: x32.patch
Patch16: rpm5-db-compat.patch
Patch17: python-internal-build.patch
-Patch18: rpmversion.patch
+Patch18: missing-macros.patch
Patch19: pkgconfig.patch
Patch20: uname-deps.patch
Patch21: aarch64.patch
Patch22: ix86-platforms.patch
+Patch23: shortcircuited-deps.patch
+Patch24: cpuinfo-deps.patch
+Patch25: rpmio-read-proc-files.patch
+Patch26: allow-at-in-ver-rel.patch
+Patch27: no-exeonly-for-elf-reqprov.patch
URL: https://rpm.org/
BuildRequires: acl-devel
BuildRequires: db-devel >= %{db_ver}
%patch20 -p1
%patch21 -p1
%patch22 -p1
+%patch23 -p1
+%patch24 -p1
+%patch25 -p1
+%patch26 -p1
+%patch27 -p1
install %{SOURCE15} scripts/perl.prov.in
--disable-silent-rules \
--enable-shared \
--enable-bdb \
+ --enable-bdb-ro \
--enable-ndb \
--enable-sqlite \
--enable-zstd \
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{/bin,/%{_lib},/etc/sysconfig,%{_sysconfdir}/{rpm,pki/rpm-gpg}} \
- $RPM_BUILD_ROOT{/var/lib/{banner,rpm},/var/cache/hrmib}
+ $RPM_BUILD_ROOT/var/lib/{banner,rpm}
%{__make} install \
pkgconfigdir=%{_pkgconfigdir} \
rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/aarch64-linux/macros
%endif
-rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/alpha*-linux/macros
+%ifnarch %{arm}
rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/arm*-linux/macros
+%endif
+
+rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/alpha*-linux/macros
rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/ia64-linux/macros
rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/mips*-linux/macros
rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/riscv64-linux/macros
cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_rpmlibdir}/install-build-tree
cp -p %{SOURCE9} $RPM_BUILD_ROOT%{_rpmlibdir}/user_group.sh
-cp -p %{SOURCE8} $RPM_BUILD_ROOT%{_rpmlibdir}/hrmib-cache
cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/rpm
cp -p %{SOURCE10} $RPM_BUILD_ROOT%{_bindir}/banner.sh
%{_rpmlibdir}/dbupgrade.sh
fi
-%triggerpostun -- %{name} < 4.4.9-44
-%{_rpmlibdir}/hrmib-cache
-
%post lib -p /sbin/ldconfig
%postun lib -p /sbin/ldconfig
%dir /var/lib/rpm
-# exported package NVRA (stamped with install tid)
-# net-snmp hrSWInstalledName queries, bash-completions
-%dir /var/cache/hrmib
-
%{_rpmlibdir}/rpmpopt*
%{_rpmlibdir}/rpmrc
%{_rpmlibdir}/macros
%ifarch aarch64
%{_rpmlibdir}/platform/aarch64*
%endif
+%ifarch %{arm}
+%{_rpmlibdir}/platform/arm*
+%endif
%ifarch ia64
%{_rpmlibdir}/platform/ia64*
%endif
%dir %{_rpmlibdir}/tld
-%attr(755,root,root) %{_rpmlibdir}/hrmib-cache
-
%attr(755,root,root) %{_rpmlibdir}/dbupgrade.sh
%attr(755,root,root) %{_rpmlibdir}/rpmdb_checkversion
%attr(755,root,root) %{_rpmlibdir}/rpmdb_reset
--- /dev/null
+--- rpm-4.16.0/rpmio/rpmio.c~ 2020-08-27 15:13:08.000000000 +0200
++++ rpm-4.16.0/rpmio/rpmio.c 2020-11-08 21:31:26.311430982 +0100
+@@ -1709,6 +1709,22 @@
+ }
+ b[blen] = '\0';
+ }
++#if defined(__linux__)
++ /* XXX st->st_size = 0 for /proc files on linux, see stat(2). */
++ /* XXX glibc mmap'd libio no workie for /proc files on linux?!? */
++ else if (!strncmp(fn, "/proc/", sizeof("/proc/")-1)) {
++ blen = blenmax;
++ b = xmalloc(blen+1);
++ b[0] = '\0';
++
++ size = read(Fileno(fd), b, blen);
++ if (size < 0) {
++ rc = 1;
++ goto exit;
++ }
++ blen = size;
++ }
++#endif
+
+ exit:
+ if (fd) (void) Fclose(fd);
+++ /dev/null
---- rpm-4.16.0/macros.in~ 2020-09-30 09:48:01.000000000 +0200
-+++ rpm-4.16.0/macros.in 2020-10-18 17:23:24.762186901 +0200
-@@ -6,6 +6,7 @@
- # should be added to /etc/rpm/macros, while per-user configuration should
- # be added to ~/.rpmmacros.
- #
-+%_rpmversion @VERSION@
-
- #==============================================================================
- # ---- A macro that expands to nothing.
--- /dev/null
+--- rpm-4.16.0/build/build.c~ 2020-05-28 12:04:24.000000000 +0200
++++ rpm-4.16.0/build/build.c 2020-10-31 18:57:03.678941782 +0100
+@@ -401,7 +401,7 @@
+ goto exit;
+
+ if (((what & RPMBUILD_PACKAGEBINARY) && !test) &&
+- (rc = packageBinaries(spec, cookie, (didBuild == 0))))
++ (rc = packageBinaries(spec, cookie, ((didBuild == 0) && !rpmExpandNumeric("%{?disable_short_circuited_deps}")))))
+ goto exit;
+
+ if ((what & RPMBUILD_CLEAN) &&
}
+ char * N = rpmdsN(dep);
-+ if (strstr(N, "uname") == N) {
++ if (strstr(N, "uname(") == N) {
+ if (tsmem->uname == NULL)
+ rpmdsUnamePool(rpmtsPool(ts), &(tsmem->uname));
+
#include <rpm/rpmtypes.h>
#include <rpm/rpmlib.h> /* rpmvercmp */
-@@ -1596,3 +1597,51 @@ rpmRC rpmdsParseRichDep(rpmds dep, rpmds *leftds, rpmds *rightds, rpmrichOp *op,
+@@ -1596,3 +1597,60 @@ rpmRC rpmdsParseRichDep(rpmds dep, rpmds *leftds, rpmds *rightds, rpmrichOp *op,
return rc;
}
++/**
++ * Merge a single provides, wrapping N as "NS(N)".
++ */
++static int rpmdsNSAdd(rpmstrPool pool, rpmds *dsp, const char * NS,
++ const char *N, const char *EVR, rpmsenseFlags Flags)
++{
++ char *t;
++ rpmds ds;
++ int rc;
++
++ t = (char *) alloca(strlen(NS)+sizeof("()")+strlen(N));
++ *t = '\0';
++ (void) stpcpy( stpcpy( stpcpy( stpcpy(t, NS), "("), N), ")");
++
++ ds = rpmdsSinglePool(pool, RPMTAG_PROVIDENAME, t, EVR, Flags);
++ rc = rpmdsMerge(dsp, ds);
++ rpmdsFree(ds);
++ return rc;
++}
++
+int rpmdsUnamePool(rpmstrPool pool, rpmds * dsp)
+{
+ int rc = -1;
+ static const char * NS = "uname";
+ struct utsname un;
-+ rpmds ds;
+
+ if (uname(&un) < 0)
+ goto exit;
+
-+ ds = rpmdsSinglePool(pool, RPMTAG_PROVIDENAME, "uname(sysname)", un.sysname, RPMSENSE_EQUAL);
-+ rc = rpmdsMerge(dsp, ds);
-+ rpmdsFree(ds);
++ rc = rpmdsNSAdd(pool, dsp, NS, "sysname", un.sysname, RPMSENSE_EQUAL);
+ if (rc < 0)
+ goto exit;
-+ ds = rpmdsSinglePool(pool, RPMTAG_PROVIDENAME, "uname(nodename)", un.nodename, RPMSENSE_EQUAL);
-+ rc = rpmdsMerge(dsp, ds);
-+ rpmdsFree(ds);
++ rc = rpmdsNSAdd(pool, dsp, NS, "nodename", un.nodename, RPMSENSE_EQUAL);
+ if (rc < 0)
+ goto exit;
-+ ds = rpmdsSinglePool(pool, RPMTAG_PROVIDENAME, "uname(release)", un.release, RPMSENSE_EQUAL);
-+ rc = rpmdsMerge(dsp, ds);
-+ rpmdsFree(ds);
++ rc = rpmdsNSAdd(pool, dsp, NS, "release", un.release, RPMSENSE_EQUAL);
+ if (rc < 0)
+ goto exit;
-+ ds = rpmdsSinglePool(pool, RPMTAG_PROVIDENAME, "uname(machine)", un.machine, RPMSENSE_EQUAL);
-+ rc = rpmdsMerge(dsp, ds);
-+ rpmdsFree(ds);
++ rc = rpmdsNSAdd(pool, dsp, NS, "machine", un.machine, RPMSENSE_EQUAL);
+ if (rc < 0)
+ goto exit;
+#if defined(__linux__)
-+ ds = rpmdsSinglePool(pool, RPMTAG_PROVIDENAME, "uname(domainname)", un.domainname, RPMSENSE_EQUAL);
-+ rc = rpmdsMerge(dsp, ds);
-+ rpmdsFree(ds);
++ rc = rpmdsNSAdd(pool, dsp, NS, "domainname", un.domainname, RPMSENSE_EQUAL);
+ if (rc < 0)
+ goto exit;
+#endif
+ ;;
+ x32)
+ ISANAME=x86
-+ ISABITS=32
++ ISABITS=x32
+ CANONARCH=x32
+ CANONCOLOR=4
+ FORCE_RPMRC_GNU="${RPMRC_GNU}x32"