%bcond_without apidocs # don't generate documentation with doxygen
%bcond_without python3 # don't build python bindings
%bcond_without plugins # build plugins
-%bcond_with recommends_tags # build without Recommends tag (bootstrapping)
+%bcond_without recommends_tags # build without Recommends tag (bootstrapping)
%bcond_with imaevm # build with IMA/EVM support (requires libimaevm from ima-evm-utils)
%define db_ver 5.3.28.0
Summary(uk.UTF-8): Менеджер пакетів від RPM
Name: rpm
Version: 4.16.1.2
-Release: 0.1
+Release: 0.3
Epoch: 1
License: GPL v2 / LGPL v2.1
Group: Base
Source13: %{name}.noautoreq
Source14: %{name}.noautoreqfiles
Source15: perl.prov
-Source16: %{name}db_checkversion.c
-Source17: %{name}db_reset.c
-Source18: dbupgrade.sh
Patch0: %{name}-man_pl.patch
Patch1: %{name}-popt-aliases.patch
Patch2: %{name}-perl-macros.patch
Patch30: missing-ghost-terminate-build.patch
Patch31: missing-doc-terminate-build.patch
Patch32: noexpand.patch
+Patch33: sqlite-db-backend.patch
Patch100: build-id-links.patch
URL: https://rpm.org/
BuildRequires: acl-devel
# needed only for AM_PROG_CXX used for CXX substitution in rpm.macros
BuildRequires: libstdc++-devel
BuildRequires: libtool >= 1:1.4.2-9
-BuildRequires: ossp-uuid-devel
BuildRequires: patch >= 2.2
BuildRequires: pkgconfig(lua) >= 5.1
BuildRequires: popt-devel >= %{popt_ver}
Requires: FHS >= 3.0-2
Requires: libgcrypt
Requires: popt >= %{popt_ver}
-#%if %{with recommends_tags}
-#Recommends: rpm-plugin-audit
-#Recommends: rpm-plugin-prioreset
-#Recommends: rpm-plugin-syslog
-#Recommends: rpm-plugin-systemd-inhibit
-#%endif
+%if %{with recommends_tags}
+Recommends: rpm-plugin-audit
+Recommends: rpm-plugin-prioreset
+Recommends: rpm-plugin-syslog
+%endif
Obsoletes: rpm-utils-perl
Obsoletes: rpm-utils-static
Conflicts: glibc < 2.2.92
Group: Applications/File
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: popt >= %{popt_ver}
-#%if %{with recommends_tags}
-#Recommends: bzip2
-#Recommends: gzip
-#%endif
+%if %{with recommends_tags}
+Recommends: bzip2
+Recommends: gzip
+%endif
Conflicts: filesystem-debuginfo < 3.0-16
%description utils
%description plugin-syslog
This plugin exports RPM actions to the system log.
-%package plugin-systemd-inhibit
-Summary: Plugin for systemd inhibit functionality
-Group: Base
-Requires: %{name}-lib = %{epoch}:%{version}-%{release}
-
-%description plugin-systemd-inhibit
-This plugin blocks systemd from entering idle, sleep or shutdown while
-an rpm transaction is running using the systemd-inhibit mechanism.
-
%package plugin-ima
Summary: Plugin for IMA file signatures
Group: Base
%description plugin-prioreset
This plugin is useful on legacy SysV init systems if you run rpm
-transactions with nice/ionice priorities. Should not be used on
-systemd systems.
+transactions with nice/ionice priorities.
%package plugin-selinux
Summary: Plugin for SELinux functionality
%patch30 -p1
%patch31 -p1
%patch32 -p1
+%patch33 -p1
%patch100 -p1
install %{SOURCE15} scripts/perl.prov.in
# generate Group translations to *.po
awk -f %{SOURCE6} %{SOURCE5}
-install %{SOURCE16} tools/rpmdb_checkversion.c
-install %{SOURCE17} tools/rpmdb_reset.c
-
%{__sed} -i -e '1s,/usr/bin/python,%{__python3},' scripts/pythondistdeps.py
%build
PYTHON=python3 \
--enable-python \
%endif
+ --disable-inhibit-plugin \
--disable-silent-rules \
--enable-shared \
--enable-bdb \
%{__make}
-%{__cc} %{rpmcflags} tools/rpmdb_checkversion.c -o tools/rpmdb_checkversion -ldb
-%{__cc} %{rpmcflags} tools/rpmdb_reset.c -o tools/rpmdb_reset -ldb
-
-if tools/rpmdb_checkversion -V 2>&1 | grep "t match library version"; then
- echo "Error linking rpmdb tools!"
- exit 1
-fi
-if tools/rpmdb_reset -V 2>&1 | grep "t match library version"; then
- echo "Error linking rpmdb tools!"
- exit 1
-fi
-
%if %{with python3}
cd python
%py3_build
cp -p %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoreq
cp -p %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoreqfiles
-cp -p tools/rpmdb_checkversion $RPM_BUILD_ROOT%{_rpmlibdir}/
-cp -p tools/rpmdb_reset $RPM_BUILD_ROOT%{_rpmlibdir}/
-cp -p %{SOURCE18} $RPM_BUILD_ROOT%{_rpmlibdir}/dbupgrade.sh
-
# move rpm to /bin
%{__mv} $RPM_BUILD_ROOT%{_bindir}/rpm $RPM_BUILD_ROOT/bin
ln -sf /bin/rpm $RPM_BUILD_ROOT%{_bindir}/rpmquery
ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/${a}.*.*.*) $RPM_BUILD_ROOT%{_libdir}/${a}
done
-# Make sure we have bdb set a default backend
-grep -qE "db_backend[[:blank:]]+bdb" $RPM_BUILD_ROOT%{_rpmlibdir}/macros
+# init an empty database for %ghost'ing for all supported backends
+for be in sqlite bdb ndb; do
+ ./rpmdb \
+ --macros=$RPM_BUILD_ROOT%{_rpmlibdir}/macros \
+ --rcfile=$RPM_BUILD_ROOT%{_rpmlibdir}/rpmrc \
+ --dbpath=${PWD}/${be} \
+ --define "_db_backend ${be}" \
+ --initdb
+ cp -va ${be}/. $RPM_BUILD_ROOT/var/lib/rpm/
+done
%if %{with python3}
# Remove anything that rpm make install might put there
rm -rf $RPM_BUILD_ROOT
%posttrans
-if [ -e /var/lib/rpm/Packages ] && \
- ! %{_rpmlibdir}/rpmdb_checkversion -h /var/lib/rpm -d /var/lib/rpm; then
+if [ -e /var/lib/rpm/Packages ]; then
if [ ! -e /var/lib/rpm.rpmbackup-%{version}-%{release} ] && \
/bin/cp -a /var/lib/rpm /var/lib/rpm.rpmbackup-%{version}-%{release}; then
echo
echo 'If poldek aborts after migration with rpmdb error, this is expected behaviour,'
echo 'you should ignore it and restart poldek'
echo
- %{_rpmlibdir}/dbupgrade.sh
+ %{__rm} -rf /var/lib/rpm/log >/dev/null 2>/dev/null || :
+ %{__rm} -rf /var/lib/rpm/tmp >/dev/null 2>/dev/null || :
+ # Unlock database for rebuild, safe since this is posttrans
+ %{__rm} -rf /var/lib/rpm/.rpm.lock >/dev/null 2>/dev/null || :
+ if ! /usr/bin/rpmdb --rebuilddb; then
+ echo
+ echo "rpm database conversion failed!"
+ echo "You have to run '/usr/bin/rpmdb --rebuilddb' manually"
+ echo
+ exit 1
+ fi
fi
%post lib -p /sbin/ldconfig
%lang(sk) %{_mandir}/sk/man8/rpm.8*
%dir /var/lib/rpm
+%ghost %config(missingok,noreplace) /var/lib/rpm/*
+%ghost /var/lib/rpm/.*.lock
%{_rpmlibdir}/rpmpopt*
%{_rpmlibdir}/rpmrc
%dir %{_rpmlibdir}/tld
-%attr(755,root,root) %{_rpmlibdir}/dbupgrade.sh
-%attr(755,root,root) %{_rpmlibdir}/rpmdb_checkversion
-%attr(755,root,root) %{_rpmlibdir}/rpmdb_reset
%attr(755,root,root) %{_rpmlibdir}/rpmdb_dump
%attr(755,root,root) %{_rpmlibdir}/rpmdb_load
%attr(755,root,root) %{_libdir}/rpm-plugins/syslog.so
%{_mandir}/man8/rpm-plugin-syslog.8*
-%files plugin-systemd-inhibit
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/rpm-plugins/systemd_inhibit.so
-%{_mandir}/man8/rpm-plugin-systemd-inhibit.8*
-
%files plugin-ima
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/rpm-plugins/ima.so