#
# TODO:
-# - rebuild database after upgrading from rpm5
# - when adopting, use 4.5 ticket for checklist: https://bugs.launchpad.net/pld-linux/+bug/262985
#
# Conditional build:
%bcond_without apidocs # don't generate documentation with doxygen
-%bcond_without python2 # don't build python bindings
%bcond_without python3 # don't build python bindings
%bcond_without plugins # build plugins
%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
%define popt_ver 1.15
-%define openssl_ver 1.1.1d
-%define sover 9.0.1
+%define sover 9.1.0
+
+%if "%{_rpmversion}" >= "4.12" && "%{_rpmversion}" < "5"
+%define with_recommends_tags 1
+%endif
Summary: RPM Package Manager
Summary(de.UTF-8): RPM Packet-Manager
Summary(ru.UTF-8): Менеджер пакетов от RPM
Summary(uk.UTF-8): Менеджер пакетів від RPM
Name: rpm
-Version: 4.15.1
-Release: 0.1
+Version: 4.16.0
+Release: 0.5
Epoch: 1
License: GPL v2 / LGPL v2.1
Group: Base
-Source0: http://ftp.rpm.org/releases/rpm-4.15.x/%{name}-%{version}.tar.bz2
-# Source0-md5: ed72147451a5ed93b2a48e2f8f5413c3
+Source0: http://ftp.rpm.org/releases/rpm-4.16.x/%{name}-%{version}.tar.bz2
+# Source0-md5: 434e166a812e35ef181f6dd176326920
Source1: ftp://ftp.pld-linux.org/dists/th/PLD-3.0-Th-GPG-key.asc
# Source1-md5: 23914bb49fafe7153cee87126d966461
Source2: macros.local
Source9: %{name}-user_group.sh
# http://svn.pld-linux.org/banner.sh/
Source10: banner.sh
-Source11: %{name}.noautocompressdoc
-Source12: %{name}.noautoprov
-Source13: %{name}.noautoprovfiles
-Source14: %{name}.noautoreq
-Source15: %{name}.noautoreqfiles
-Source16: perl.prov
-Source17: %{name}db_checkversion.c
-Source18: %{name}db_reset.c
-Source19: dbupgrade.sh
+Source11: %{name}.noautoprov
+Source12: %{name}.noautoprovfiles
+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
Patch3: %{name}-perl-req-perlfile.patch
Patch4: %{name}-scripts-closefds.patch
-Patch5: %{name}-lua.patch
Patch6: %{name}-perl_req-INC_dirs.patch
Patch7: %{name}-debuginfo.patch
Patch8: %{name}-libtool-deps.patch
Patch13: %{name}-perl-magic.patch
Patch14: %{name}-ignore-missing-macro-files.patch
Patch15: x32.patch
-Patch16: %{name}-add-compress-doc.patch
-Patch17: rpm5-db-compat.patch
-Patch18: python-internal-build.patch
-Patch19: create-build-tree-after-parse.patch
+Patch16: rpm5-db-compat.patch
+Patch17: python-internal-build.patch
+Patch18: rpmversion.patch
+Patch19: pkgconfig.patch
+Patch20: uname-deps.patch
+Patch21: aarch64.patch
+Patch22: ix86-platforms.patch
+Patch23: shortcircuited-deps.patch
URL: https://rpm.org/
+BuildRequires: acl-devel
BuildRequires: db-devel >= %{db_ver}
BuildRequires: autoconf >= 2.63
BuildRequires: automake >= 1.4
BuildRequires: elfutils-devel >= 0.108
BuildRequires: gettext-tools >= 0.19.2
BuildRequires: libarchive-devel
+BuildRequires: libcap-devel
BuildRequires: libmagic-devel
-BuildRequires: openssl-devel >= %{openssl_ver}
+BuildRequires: libgcrypt-devel
%if %{with plugins}
BuildRequires: audit-libs-devel
BuildRequires: dbus-devel
+%{?with_imaevm:BuildRequires: libimaevm-devel >= 1.0}
BuildRequires: libselinux-devel >= 2.1.0
%endif
# needed only for AM_PROG_CXX used for CXX substitution in rpm.macros
BuildRequires: libstdc++-devel
BuildRequires: libtool >= 1:1.4.2-9
-BuildRequires: lua53-devel >= 5.3.5
BuildRequires: ossp-uuid-devel
BuildRequires: patch >= 2.2
+BuildRequires: pkgconfig(lua) >= 5.1
BuildRequires: popt-devel >= %{popt_ver}
-%{?with_python2:BuildRequires: python-devel >= 1:2.3}
-%{?with_python3:BuildRequires: python3-devel}
-BuildRequires: python-modules >= 1:2.3
-%if %{with python2} || %{with python3}
+BuildRequires: python3-modules
+%if %{with python3}
+BuildRequires: python3-devel
BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.750
%endif
+BuildRequires: sqlite3-devel >= 3.22.0
BuildRequires: tcl
BuildRequires: xz-devel
BuildRequires: zlib-devel
Requires: %{name}-lib = %{epoch}:%{version}-%{release}
Requires: rpm-pld-macros >= 1.744
Requires: FHS >= 3.0-2
-Requires: openssl >= %{openssl_ver}
+Requires: libgcrypt
Requires: popt >= %{popt_ver}
%if %{with recommends_tags}
Recommends: rpm-plugin-audit
Recommends: rpm-plugin-syslog
Recommends: rpm-plugin-systemd-inhibit
%endif
-Obsoletes: rpm-getdeps
Obsoletes: rpm-utils-perl
Obsoletes: rpm-utils-static
Conflicts: glibc < 2.2.92
%define x8664 amd64 ia32e x86_64
%define _rpmlibdir /usr/lib/rpm
-%define _noautocompressdoc RPM-GPG-KEY
%description
RPM is a powerful package manager, which can be used to build,
Group: Libraries
Requires: db >= %{db_ver}
Requires: libmagic >= 1.15-2
-Requires: openssl >= %{openssl_ver}
Requires: popt >= %{popt_ver}
Obsoletes: rpm-libs
# avoid SEGV caused by mixed db versions
Summary(uk.UTF-8): Хедери та бібліотеки для програм, що працюють з пакетами rpm
Group: Development/Libraries
Requires: %{name}-lib = %{epoch}:%{version}-%{release}
-Requires: db-devel >= %{db_ver}
Requires: bzip2-devel
+Requires: db-devel >= %{db_ver}
Requires: elfutils-devel
Requires: libmagic-devel
-Requires: openssl-devel >= %{openssl_ver}
+Requires: libgcrypt-devel
%if %{with selinux}
Requires: libselinux-devel
Requires: libsemanage-devel
Summary(pl.UTF-8): Makra ułatwiające tworzenie pakietów RPM z programami napisanymi w Pythonie
Group: Applications/File
Requires: %{name} = %{epoch}:%{version}-%{release}
-Requires: python
-Requires: python-modules
-Requires: python-setuptools
+Requires: python3
+Requires: python3-modules
+Requires: python3-setuptools
%description pythonprov
Python macros, which simplifies creation of RPM packages with Python
Makra ułatwiające tworzenie pakietów RPM z programami napisanymi w
Pythonie.
-%package -n python-rpm
-Summary: Python interface to RPM library
-Summary(pl.UTF-8): Pythonowy interfejs do biblioteki RPM-a
-Summary(pt_BR.UTF-8): Módulo Python para aplicativos que manipulam pacotes RPM
-Group: Development/Languages/Python
-Requires: %{name} = %{epoch}:%{version}-%{release}
-Requires: python
-Obsoletes: rpm-python
-
-%description -n python-rpm
-The python-rpm package contains a module which permits applications
-written in the Python programming language to use the interface
-supplied by RPM (RPM Package Manager) libraries.
-
-This package should be installed if you want to develop Python
-programs that will manipulate RPM packages and databases.
-
-%description -n python-rpm -l pl.UTF-8
-Pakiet python-rpm zawiera moduł, który pozwala aplikacjom napisanym w
-Pythonie na używanie interfejsu dostarczanego przez biblioteki RPM-a.
-
-Pakiet ten powinien zostać zainstalowany, jeśli chcesz pisać w
-Pythonie programy manipulujące pakietami i bazami danych rpm.
-
-%description -n python-rpm -l pt_BR.UTF-8
-O pacote python-rpm contém um módulo que permite que aplicações
-escritas em Python utilizem a interface fornecida pelas bibliotecas
-RPM (RPM Package Manager).
-
-Esse pacote deve ser instalado se você quiser desenvolver programas em
-Python para manipular pacotes e bancos de dados RPM.
-
%package -n python3-rpm
Summary: Python 3 interface to RPM library
Summary(pl.UTF-8): Interfejs Pythona 3 do biblioteki RPM-a
Group: Development/Languages/Python
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: python3
+Obsoletes: python-rpm < 1:4.16.0
+Obsoletes: rpm-python
%description -n python3-rpm
The python3-rpm package contains a module which permits applications
%description -n python3-rpm -l pl.UTF-8
Pakiet python3-rpm zawiera moduł, który pozwala aplikacjom napisanym w
-Pythonie 3 na używanie interfejsu dostarczanego przez biblioteki RPM-a.
+Pythonie 3 na używanie interfejsu dostarczanego przez biblioteki
+RPM-a.
Pakiet ten powinien zostać zainstalowany, jeśli chcesz pisać w
Pythonie 3 programy manipulujące pakietami i bazami danych rpm.
%package plugin-audit
Summary: Plugin for logging audit events on package operations
-Group: System/Base
+Group: Base
Requires: %{name}-lib = %{epoch}:%{version}-%{release}
%description plugin-audit
%package plugin-syslog
Summary: Plugin for syslog functionality
-Group: System/Base
+Group: Base
Requires: %{name}-lib = %{epoch}:%{version}-%{release}
%description plugin-syslog
%package plugin-systemd-inhibit
Summary: Plugin for systemd inhibit functionality
-Group: System/Base
+Group: Base
Requires: %{name}-lib = %{epoch}:%{version}-%{release}
%description plugin-systemd-inhibit
%patch2 -p1
%patch3 -p1
%patch4 -p1
-%patch5 -p1
%patch6 -p0
%patch7 -p1
%patch8 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
+%patch20 -p1
+%patch21 -p1
+%patch22 -p1
+%patch23 -p1
-install %{SOURCE16} scripts/perl.prov.in
+install %{SOURCE15} scripts/perl.prov.in
%{__mv} -f scripts/perl.req{,.in}
# generate Group translations to *.po
awk -f %{SOURCE6} %{SOURCE5}
-install %{SOURCE17} tools/rpmdb_checkversion.c
-install %{SOURCE18} tools/rpmdb_reset.c
+install %{SOURCE16} tools/rpmdb_checkversion.c
+install %{SOURCE17} tools/rpmdb_reset.c
-%{__sed} -i -e '1s,/usr/bin/python,%{__python},' scripts/pythondistdeps.py
+%{__sed} -i -e '1s,/usr/bin/python,%{__python3},' scripts/pythondistdeps.py
%build
%{__libtoolize}
-e 's|@host_os@|%{_target_os}|' \
macros.in
-CPPFLAGS="-I/usr/include/lua53 %{rpmcppflags}"
%configure \
WITH_PERL_VERSION=no \
__GST_INSPECT=%{_bindir}/gst-inspect-1.0 \
__GPG=%{_bindir}/gpg \
- %{?with_python3:PYTHON=python3} \
- %{!?with_python3:%{?with_python2:PYTHON=python2}} \
+%if %{with python3}
+ PYTHON=python3 \
+ --enable-python \
+%endif
--disable-silent-rules \
--enable-shared \
--enable-bdb \
+ --enable-ndb \
+ --enable-sqlite \
--enable-zstd \
- --with-crypto=openssl \
--with-lua \
+ %{?with_imaevm:--with-imaevm} \
--with-cap \
--with-acl \
--with-audit \
--with-archive \
-%if %{with python2} || %{with python3}
- --enable-python \
-%endif
--with-selinux=%{!?with_plugins:no}%{?with_plugins:yes} \
%{!?with_plugins:--disable-plugins} \
--with-vendor=pld
-# --enable-ndb (EXPERIMENTAL) enable the new rpm database format
-# --enable-lmdb=[yes/no/auto] (EXPERIMENTAL) build with LMDB rpm database format support (default=auto)
-# --with-imaevm build with imaevm support
-
%{__make}
%{__cc} %{rpmcflags} tools/rpmdb_checkversion.c -o tools/rpmdb_checkversion -ldb
exit 1
fi
-%if %{with python2}
-cd python
-%py_build
-cd ..
-%endif
-
%if %{with python3}
cd python
%py3_build
rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/ppc*series-linux/macros
%endif
+%ifnarch aarch64
rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/aarch64-linux/macros
+%endif
+
rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/alpha*-linux/macros
rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/arm*-linux/macros
rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/ia64-linux/macros
rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/sh*-linux/macros
rm $RPM_BUILD_ROOT%{_rpmlibdir}/platform/sparc*-linux/macros
+cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/rpm/platform
+%ifarch x32
+%{_target_cpu}-%{_target_vendor}-linux-gnux32
+%else
+%{_target_cpu}-%{_target_vendor}-linux
+%endif
+EOF
+
%{__rm} $RPM_BUILD_ROOT%{_rpmlibdir}/find-lang.sh
install -d $RPM_BUILD_ROOT%{_rpmlibdir}/pld
cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros
cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.lang
-cp -p %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautocompressdoc
-cp -p %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoprov
-cp -p %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoprovfiles
-cp -p %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoreq
-cp -p %{SOURCE15} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoreqfiles
+cp -p %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoprov
+cp -p %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoprovfiles
+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 %{SOURCE19} $RPM_BUILD_ROOT%{_rpmlibdir}/dbupgrade.sh
+cp -p %{SOURCE18} $RPM_BUILD_ROOT%{_rpmlibdir}/dbupgrade.sh
# move rpm to /bin
%{__mv} $RPM_BUILD_ROOT%{_bindir}/rpm $RPM_BUILD_ROOT/bin
#./rpmdb --macros=macros --rcfile=rpmrc --dbpath=/home/users/baggins/devel/PLD/rpm/BUILD/rpm-4.15.1/x/ --initdb
-%if %{with python2}
-# Remove anything that rpm make install might put there
-%{__rm} -rf $RPM_BUILD_ROOT%{py_sitedir}
-cd python
-%py_install
-%py_postclean
-cd ..
-%endif
+# Make sure we have bdb set a default backend
+grep -qE "db_backend[[:blank:]]+bdb" $RPM_BUILD_ROOT%{_rpmlibdir}/macros
%if %{with python3}
# Remove anything that rpm make install might put there
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rpm/macros
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rpm/macros.lang
+# this is ok to be replaced
+%config %verify(not md5 mtime size) %{_sysconfdir}/rpm/platform
%{_mandir}/man8/rpm.8*
%{_mandir}/man8/rpmdb.8*
%{_mandir}/man8/rpmkeys.8*
%{_mandir}/man8/rpm-misc.8*
+%{?with_plugins:%{_mandir}/man8/rpm-plugins.8*}
%lang(fr) %{_mandir}/fr/man8/rpm.8*
%lang(ja) %{_mandir}/ja/man8/rpm.8*
%lang(ko) %{_mandir}/ko/man8/rpm.8*
%ifarch alpha
%{_rpmlibdir}/platform/alpha*
%endif
+%ifarch aarch64
+%{_rpmlibdir}/platform/aarch64*
+%endif
%ifarch ia64
%{_rpmlibdir}/platform/ia64*
%endif
%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
# valgrind suppression file for rpm
%{_rpmlibdir}/rpm.supp
%attr(755,root,root) %{_bindir}/rpmgraph
%attr(755,root,root) %{_rpmlibdir}/rpm2cpio.sh
%attr(755,root,root) %{_rpmlibdir}/find-debuginfo.sh
-%attr(755,root,root) %{_rpmlibdir}/rpmdb_loadcvt
%attr(755,root,root) %{_rpmlibdir}/tgpg
%attr(755,root,root) %{_rpmlibdir}/debugedit
%attr(755,root,root) %{_rpmlibdir}/rpmdeps
+%{_mandir}/man8/rpm2archive.8*
%{_mandir}/man8/rpm2cpio.8*
%{_mandir}/man8/rpmdeps.8*
%{_mandir}/man8/rpmgraph.8*
%attr(755,root,root) %{_rpmlibdir}/check-prereqs
%attr(755,root,root) %{_rpmlibdir}/check-rpaths
%attr(755,root,root) %{_rpmlibdir}/check-rpaths-worker
-%attr(755,root,root) %{_rpmlibdir}/debuginfo.prov
-%attr(755,root,root) %{_rpmlibdir}/desktop-file.prov
%attr(755,root,root) %{_rpmlibdir}/find-provides
%attr(755,root,root) %{_rpmlibdir}/find-requires
-%attr(755,root,root) %{_rpmlibdir}/metainfo.prov
-%attr(755,root,root) %{_rpmlibdir}/ocaml-find-provides.sh
-%attr(755,root,root) %{_rpmlibdir}/ocaml-find-requires.sh
+%attr(755,root,root) %{_rpmlibdir}/ocamldeps.sh
%attr(755,root,root) %{_rpmlibdir}/script.req
%attr(755,root,root) %{_rpmlibdir}/sepdebugcrcfix
-# Fedora has this in -build, but shouldn't this be in -devel?
-%attr(755,root,root) %{_rpmlibdir}/config.guess
-%attr(755,root,root) %{_rpmlibdir}/config.sub
%dir %{_rpmlibdir}/fileattrs
%{_rpmlibdir}/fileattrs/debuginfo.attr
%files pythonprov
%defattr(644,root,root,755)
-%attr(755,root,root) %{_rpmlibdir}/pythondeps.sh
%attr(755,root,root) %{_rpmlibdir}/pythondistdeps.py
-%if %{with python2}
-%files -n python-rpm
-%defattr(644,root,root,755)
-%dir %{py_sitedir}/rpm
-%attr(755,root,root) %{py_sitedir}/rpm/*.so
-%{py_sitedir}/rpm/*.py[co]
-%{py_sitedir}/rpm-%{version}-py*.egg-info
-%endif
-
%if %{with python3}
%files -n python3-rpm
%defattr(644,root,root,755)
%files plugin-audit
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/rpm-plugins/audit.so
+%{_mandir}/man8/rpm-plugin-audit.8*
%files plugin-syslog
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/rpm-plugins/syslog.so
+%{_mandir}/man8/rpm-plugin-syslog.8*
%files plugin-systemd-inhibit
%defattr(644,root,root,755)
%files plugin-ima
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/rpm-plugins/ima.so
+%{_mandir}/man8/rpm-plugin-ima.8*
%files plugin-prioreset
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/rpm-plugins/prioreset.so
+%{_mandir}/man8/rpm-plugin-prioreset.8*
%files plugin-selinux
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/rpm-plugins/selinux.so
+%{_mandir}/man8/rpm-plugin-selinux.8*
%endif
%files sign