preserve legacy python-rpm (python 2.7) and add python-rpm-py3 [release 4.14.3-2mamba;Fri Aug 14 2020]

This commit is contained in:
Silvan Calarco 2024-01-05 17:29:06 +01:00
parent 83154c9bbb
commit 5cfbd87e9c

View File

@ -16,8 +16,8 @@
%define majver %(echo %version | cut -d. -f1-2)
Name: rpm
Epoch: 1
Version: 4.14.2.1
Release: 14mamba
Version: 4.14.3
Release: 2mamba
Summary: The RPM Package Manager (RPM) is a powerful package management system
Group: System/Management
Vendor: openmamba
@ -59,7 +59,7 @@ BuildRequires: libnettle-devel
BuildRequires: libnss-devel
BuildRequires: libopenssl-devel
BuildRequires: libpopt-devel
BuildRequires: libpython-devel
BuildRequires: libpython3-devel
BuildRequires: libpython27-devel
BuildRequires: libreadline-devel
BuildRequires: libsystemd-devel
@ -115,6 +115,16 @@ Obsoletes: python-rpm4
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.
%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
%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
@ -134,6 +144,10 @@ This package should be installed if you want to develop Python programs that wil
%patch11 -p1
%patch12 -p1
sed -i "s,| arm-\* |,| aarch64-\* | arm-\* |," config.sub
cp -a python python27
%build
#:<< _EOF
./configure \
@ -151,12 +165,26 @@ This package should be installed if you want to develop Python programs that wil
--with-path-cfg=%{_sysconfdir}/rpm%{?program_suffix} \
--enable-python \
--with-external-db \
--with-vendor=openmamba
--with-vendor=openmamba \
PYTHON=%{__python3}
%make
# Build python 2.7 legacy
cd python27
cp ../python/Makefile .
sed -i "s|%{python3_inc}|%{python_inc}|" Makefile
sed -i "s|%{python3_sitearch}|%{python_sitearch}|" Makefile
sed -i "s|%{python3_sitelib}|%{python_sitelib}|" Makefile
sed -i "s|python%{python3_version}[m]*|python%{python_version}|" Makefile
sed -i "s|%{__python3}|%{__python}|" Makefile
%make PYTHON_VERSION=2.7
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall -C python27 PYTHON_VERSION=2.7
%makeinstall
%find_lang rpm --with-man --all-name || touch rpm.lang
@ -171,6 +199,10 @@ install -D -m 644 %{S:2} %{buildroot}%{_sysconfdir}/rpm%{?program_suffix}/macros
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
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
@ -270,10 +302,22 @@ _EOF
%files -n python-rpm
%defattr(-,root,root)
%dir %{python27_sitearch}/rpm
%{python27_sitearch}/rpm/*
%dir %{python_sitearch}/rpm
%{python_sitearch}/rpm/*
%files -n python-rpm-py3
%defattr(-,root,root)
%dir %{python3_sitearch}/rpm
%{python3_sitearch}/rpm/*
%changelog
* 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