rpm/rpm.spec

431 lines
16 KiB
RPMSpec

#% define program_suffix 4
%define __prefix %{?_prefix}%{!?_prefix:/usr}
%ifarch x86_64 aarch64
%{?!_lib: %define _lib lib64}
%{?!_libexec: %define _libexec libexec64}
%else
%{?!_lib: %define _lib lib}
%{?!_libexec: %define _libexec libexec}
%endif
%define __bindir %{__prefix}/bin
%define __includedir %{__prefix}/include
%define __libdir %{__prefix}/%{_lib}
%define __mandir %{__prefix}/share/man
%define packager_groupid 65028
%define packager_userid 65028
%define majver %(echo %version | cut -d. -f1-2)
Name: rpm
Epoch: 1
Version: 4.19.1.1
Release: 3mamba
Summary: The RPM Package Manager (RPM) is a powerful package management system
Group: System/Management
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://rpm.org/index.html
Source: http://ftp.rpm.org/releases/rpm-%{majver}.x/rpm-%{version}.tar.bz2
Source2: rpm4-macros_openmamba
Source3: rpmdb-rebuild.service
Source4: python.attr
Source5: pythondist.attr
Source6: pythondistdeps.py
Patch0: rpm-4.14.2.1-fix-rebuilddb-from-rpm-5.2.patch
Patch1: rpm-4.14.2.1-fix-rebuilddb-from-rpm-5.2-better.patch
Patch2: rpm-4.14.2.1-fix-missing-translations-from-rpm4-segfault.patch
Patch3: rpm-4.16.1.3-arm-openmamba-arch-support.patch
Patch4: rpm-4.19.0-i586-openmamba-arch-support.patch
Patch5: rpm-4.14.2.1-debuginfo-rename-to-debug.patch
Patch6: rpm-4.14.2.1-add-usrlibrpm-macro.patch
Patch7: rpm-4.14.2.1-remove_macro_expanded_in_comment_warning.patch
Patch9: rpm-4.14.2.1-increase_default_patch_fuzz.patch
Patch10: rpm-4.19.0-openmamba-buildroot.patch
Patch11: rpm-4.19.0-target-platform-gnu.patch
Patch12: rpm-4.17.0-find-lang-qt-fix.patch
Patch14: rpm-4.19.0-brp-strip-fix-for-plus-in-buildroot.patch
Patch15: rpm-4.18.0-allow-disabling-rmbuild.patch
Patch16: rpm-4.19.1.1-i586-add-sse-sse2-build-flags.patch
Patch17: rpm-4.19.1.1-i586-only-force-i586-host-cpu.patch
Patch18: rpm-4.19.1.1-disable-specpartsdir.patch
License: LGPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libacl-devel
BuildRequires: libarchive-devel
BuildRequires: libaudit-devel
BuildRequires: libbzip2-devel
BuildRequires: libcap-devel
BuildRequires: libdbus-devel
BuildRequires: libdw-devel
BuildRequires: libelf-devel
BuildRequires: libgomp-devel
BuildRequires: liblua-devel
BuildRequires: liblzma-devel
BuildRequires: libmagic-devel
BuildRequires: libpopt-devel
BuildRequires: libpython311-devel
BuildRequires: libreadline-devel
BuildRequires: librpm-sequoia-devel
BuildRequires: libselinux-devel
BuildRequires: libsqlite-devel
BuildRequires: libz-devel
BuildRequires: libzstd-devel
## AUTOBUILDREQ-END
BuildRequires: librpm-sequoia-devel
BuildRequires: libpython3-devel >= 3.11
BuildRequires: setup >= 1.2.0
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
Provides: rpm-build
Obsoletes: rpm-build < 1:4.16.1.2
Requires: debugedit
%description
The RPM Package Manager (RPM) is a powerful package management system capable of building computer software from source into easily distributable packages installing, updating and uninstalling packaged software querying detailed information about the packaged software, whether installed or not verifying integrity of packaged software and resulting software installation.
%package build
Summary: The RPM package build tools and environment
Group: Development/Tools
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: elfutils
%description build
The RPM Package Manager (RPM) is a powerful package management system capable of building computer software from source into easily distributable packages installing, updating and uninstalling packaged software querying detailed information about the packaged software, whether installed or not verifying integrity of packaged software and resulting software installation.
This package provides the RPM package build tools and environment.
%package -n lib%{name}
Group: System/Libraries
Summary: Shared libraries for %{name}
Provides: group(packager)
%description -n lib%{name}
This package contains shared libraries for %{name}.
%package -n lib%{name}-devel
Group: Development/Libraries
Summary: Development files for %{name}
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: pkg-config
Provides: rpm-devel
Obsoletes: rpm-devel < 1:4.16.1.2
%description -n lib%{name}-devel
This package contains libraries and header files for developing applications that use %{name}.
%package -n python-rpm-py3
Summary: Python bindings for apps which will manipulate RPM packages
Group: Development/Libraries/Python
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: python3
Obsoletes: python-rpm < 1:4.16.1.2
Obsoletes: python-rpm4 < 1:4.16.1.2
Obsoletes: python-rpm-py310 < 1:4.19.1.1-2mamba
%description -n python-rpm-py3
The rpm-python 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.
%debug_package
%prep
%setup -q -n rpm-%{version}
#-D -T
#:<< _EOF
%patch 1 -p1
%patch 2 -p1
%patch 3 -p1
%patch 4 -p1
%patch 5 -p1
%patch 6 -p1
%patch 7 -p1
%patch 9 -p1
%patch 10 -p1
%patch 11 -p1
%patch 12 -p1
%patch 14 -p1
%patch 15 -p1
%ifarch %{ix86}
%patch 16 -p1
%patch 17 -p1
%endif
%patch 18 -p1
%build
#:<< _EOF
%cmake -d buildx \
-DENABLE_BDB_RO=ON \
-DRPM_VENDOR="openmamba" \
-DPython3_EXECUTABLE=%{__python3} \
%ifarch aarch64 %{ix86}
-DENABLE_TESTSUITE=OFF
%endif
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall -C buildx
%find_lang rpm --with-man --all-name || touch rpm.lang
# create system-wide build directories
mkdir -p %{buildroot}%{_usr}/src/RPM/{BUILD,RPMS/{aarch64,arm,i586,noarch,x86_64},SOURCES,SPECS,SRPMS}
# install rpm macros for openmamba
install -D -m 644 %{S:2} %{buildroot}%{_sysconfdir}/rpm%{?program_suffix}/macros.openmamba
# install rpmdb-rebuild service
install -D -m0644 %{SOURCE3} %{buildroot}%{_unitdir}/rpmdb-rebuild.service
%ifarch x86_64
sed -i "s|/libexec$|/%{_libexec}|" %{buildroot}%{_prefix}/lib/rpm/platform/x86_64-linux/macros
%endif
%ifarch aarch64
sed -i "s|/libexec$|/%{_libexec}|" %{buildroot}%{_prefix}/lib/rpm/platform/aarch64-linux/macros
%endif
# Install python distdeps scripts and fileattrs removed since 4.17 (in Fedora they are moved to python-rpm-generators)
install -m0644 %{SOURCE4} %{buildroot}%{_prefix}/lib/rpm/fileattrs/python.attr
install -m0644 %{SOURCE5} %{buildroot}%{_prefix}/lib/rpm/fileattrs/pythondist.attr
install -m0755 %{SOURCE6} %{buildroot}%{_prefix}/lib/rpm/pythondistdeps.py
rm -f %{buildroot}%{_libdir}/librpm*.la
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%pretrans
# Prepare upgrade from bdb to sqlite
[ -e /var/lib/rpm/Packages -a ! -e /var/lib/rpm/.rebuilddb ] && {
cp -a /var/lib/rpm /var/lib/rpm.bdb.bak && touch /var/lib/rpm/.rebuilddb
}
:
%post
%systemd_post rpmdb-rebuild.service
:
%preun
%systemd_preun rpmdb-rebuild.service
:
%post -n lib%{name}
/sbin/ldconfig
/usr/sbin/groupadd packager -g %{packager_groupid} 2>/dev/null || :
/usr/sbin/useradd packager -u %{packager_userid} -g packager -d /dev/null -s /bin/false 2>/dev/null || :
:
%postun -n lib%{name} -p /sbin/ldconfig
%triggerpostun -- rpm < 1:4.17.1.1-4mamba
# Ensuring enabling rpmdb-rebuild service on update
/usr/bin/systemctl enable rpmdb-rebuild.service
:
%files -f rpm.lang
%defattr(-,root,root)
%dir %{_sysconfdir}/rpm%{?program_suffix}
%config %{_sysconfdir}/rpm%{?program_suffix}/macros.openmamba
%{_bindir}/gendiff%{?program_suffix}
%{_bindir}/rpm%{?program_suffix}
%{_bindir}/rpm2archive%{?program_suffix}
%{_bindir}/rpm2cpio%{?program_suffix}
%{_bindir}/rpmbuild%{?program_suffix}
%{_bindir}/rpmdb%{?program_suffix}
%{_bindir}/rpmgraph%{?program_suffix}
%{_bindir}/rpmkeys%{?program_suffix}
%{_bindir}/rpmlua
%{_bindir}/rpmquery
%{_bindir}/rpmsign%{?program_suffix}
%{_bindir}/rpmsort
%{_bindir}/rpmspec%{?program_suffix}
%{_bindir}/rpmverify
%{_unitdir}/rpmdb-rebuild.service
%{_datadir}/dbus-1/system.d/org.rpm.conf
%dir %{_prefix}/lib/rpm
%{_prefix}/lib/rpm/*
%dir /usr/src/RPM
%attr(775,root,packager) %dir /usr/src/RPM/BUILD
%attr(775,root,packager) %dir /usr/src/RPM/SOURCES
%attr(775,root,packager) %dir /usr/src/RPM/SRPMS
%attr(775,root,packager) %dir /usr/src/RPM/RPMS
%attr(775,root,packager) %dir /usr/src/RPM/SPECS
%attr(775,root,packager) /usr/src/RPM/RPMS/*
%{_mandir}/man1/gendiff.1*
%{_mandir}/man8/rpm-misc.8*
%{_mandir}/man8/rpm.8*
%{_mandir}/man8/rpm2archive.8*
%{_mandir}/man8/rpm2cpio.8*
%{_mandir}/man8/rpmbuild.8*
%{_mandir}/man8/rpmdb.8*
%{_mandir}/man8/rpmdeps.8*
%{_mandir}/man8/rpmgraph.8*
%{_mandir}/man8/rpmkeys.8*
%{_mandir}/man8/rpmlua.8*
%{_mandir}/man8/rpmsign.8*
%{_mandir}/man8/rpmsort.8*
%{_mandir}/man8/rpmspec.8*
%{_mandir}/man8/rpm-plugin*.8*
%doc COPYING CREDITS
%files -n lib%{name}
%defattr(-,root,root)
%{_libdir}/librpm.so.*
%{_libdir}/librpmbuild.so.*
%{_libdir}/librpmio.so.*
%{_libdir}/librpmsign.so.*
%dir %{_libdir}/rpm-plugins
%{_libdir}/rpm-plugins/*
%files -n lib%{name}-devel
%defattr(-,root,root)
%dir %{_includedir}/rpm
%{_includedir}/rpm/*.h
%{_libdir}/librpm.so
%{_libdir}/librpmbuild.so
%{_libdir}/librpmio.so
%{_libdir}/librpmsign.so
%{_libdir}/pkgconfig/rpm.pc
%dir %{_libdir}/cmake/rpm
%{_libdir}/cmake/rpm/rpm-*.cmake
%dir %{_docdir}/rpm
%dir %{_docdir}/rpm/API
%{_docdir}/rpm/*
%doc ChangeLog README
%files -n python-rpm-py3
%defattr(-,root,root)
%{python3_sitearch}/rpm-%{version}-py*.egg-info
%dir %{python3_sitearch}/rpm
%{python3_sitearch}/rpm/*
%changelog
* Fri May 17 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 4.19.1.1-3mamba
- added a patch to disable SPECPARTS feature by default by not setting %specpartsdir
* Mon May 13 2024 Automatic Build System <autodist@openmamba.org> 4.19.1.1-2mamba
- i586: add sse and sse2 build flags; fix forcing host_cpu to i586
- drop python 3.10 support
* Thu Feb 08 2024 Automatic Build System <autodist@openmamba.org> 4.19.1.1-1mamba
- automatic version update by autodist
* Wed Dec 13 2023 Automatic Build System <autodist@mambasoft.it> 4.19.1-1mamba
- automatic version update by autodist
* Sun Dec 03 2023 Automatic Build System <autodist@mambasoft.it> 4.19.0-1mamba
- automatic version update by autodist
* Tue Oct 17 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 4.18.1-4mamba
- rebuilt with python3 == 3.11
* Sun Jul 02 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 4.18.1-3mamba
- added upstream patch to fix dnf problem with sqlite 3.42.0 ( https://github.com/rpm-software-management/rpm/pull/2553 )
* Thu Mar 23 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 4.18.1-2mamba
- rebuilt with python 3.10 subpackage
* Thu Mar 16 2023 Automatic Build System <autodist@mambasoft.it> 4.18.1-1mamba
- automatic version update by autodist
* Fri Oct 28 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 4.18.0-4mamba
- fix typo error in last patch
* Thu Oct 27 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 4.18.0-3mamba
- added a patch to allow disabling rmbuild without disabling whole clean section
* Sun Oct 09 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 4.18.0-2mamba
- brp-strip: added patch to fix exclusion of /usr/lib/debug when buildroot contains a plus (+) symbol
* Fri Sep 23 2022 Automatic Build System <autodist@mambasoft.it> 4.18.0-1mamba
- automatic version update by autodist
* Sun Sep 11 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 4.17.1.1-5mamba
- restore python distdeps generators by adding pythondistdeps.py and fileattrs/python*
* Sun Sep 04 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 4.17.1.1-4mamba
- use a triggerpostun script to enable rpmdb-rebuild on upgrade
* Sun Sep 04 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 4.17.1.1-3mamba
- enable rpmdb-rebuild service on update
* Sat Sep 03 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 4.17.1.1-2mamba
- install rpmdb-rebuild service and configure to perform upgrade from bdb to sqlite
- require debugedit for find-debuginfo
* Sat Sep 03 2022 Automatic Build System <autodist@mambasoft.it> 4.17.1.1-1mamba
- automatic version update by autodist
* Fri Jul 01 2022 Automatic Build System <autodist@mambasoft.it> 4.17.1-1mamba
- automatic version update by autodist
* Tue Sep 14 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 4.17.0-2mamba
- rebuilt with --enable-bdb-ro
* Mon Sep 13 2021 Automatic Build System <autodist@mambasoft.it> 4.17.0-1mamba
- automatic version update by autodist
* Sun Apr 18 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 4.16.1.3-2mamba
- patches: pythondistdeps: use normal deps instead of rich deps; rpmrc: armv7l: set march=armv7-a
* Tue Mar 23 2021 Automatic Build System <autodist@mambasoft.it> 4.16.1.3-1mamba
- automatic version update by autodist
* Sun Mar 07 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 4.16.1.2-3mamba
- fix shebank in pythondistdeps.py to use python3 instead of python
* Sun Mar 07 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 4.16.1.2-2mamba
- python-rpm-py3: fix obsolete for python-rpm and python-rpm4 (add epoch)
* Sat Mar 06 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 4.16.1.2-1mamba
- update to 4.16.1.2
* Fri Aug 14 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.3-2mamba
- preserve legacy python-rpm (python 2.7) and add python-rpm-py3
* Fri Aug 14 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.3-1mamba
- update to 4.14.3
- python-rpm: base on python3
* Tue May 05 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.2.1-14mamba
- arm: drop armv5t patch in favor of armv7l
* Sat Aug 31 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.2.1-13mamba
- find-lang.sh: patched to fix detection of qt translations
* Thu Aug 01 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.2.1-12mamba
- added patch to add %{_gnu} to %_target platform
* Wed Jul 24 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.2.1-11mamba
- x86_64: set libexecdir as libexec64; arm: force armv5t; set default_patch_fuzz to 1
* Mon Jul 22 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.2.1-10mamba
- added patch to remove 'Macro expanded in commit...' warnings
* Sun Jul 21 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.2.1-9mamba
- i586: patch rpmrc to set as default x86 arch; debuginfo: patch macros to rename suffix to debug
* Fri Jul 12 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.2.1-8mamba
- readd host and build options to configure
* Sun Jun 30 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.2.1-7mamba
- fix rpmdb upgrade by running a background scripts delayed
* Sat Jun 29 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.2.1-6mamba
- added patch to fix a segfault in checkInstalledFiles for missing installed translation files
* Tue Jun 25 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.2.1-5mamba
- install macros for default build environment with openmamba
* Mon Jun 24 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.2.1-4mamba
- better patch for rebuilddb from 5.2
* Sat Jun 22 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.2.1-3mamba
- rebuilt against external libdb53
* Fri Jun 21 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.2.1-2mamba
- patch to fix rebuilddb from rpm 5.2, --enable-python, create packager user and group
* Wed Jun 05 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.14.2.1-1mamba
- package created using the webbuild interface