- add python3 sub-package, based on patch by Bohuslav Kabrda

This commit is contained in:
Panu Matilainen 2013-08-21 13:39:02 +03:00
parent 063bc78547
commit f5c5c333a8
2 changed files with 104 additions and 3 deletions

View File

@ -0,0 +1,61 @@
--- rpm-4.11.0.1/python/setup.py.in.setuppy-fixes 2012-11-07 13:55:24.000000000 +0100
+++ rpm-4.11.0.1/python/setup.py.in 2013-04-03 14:16:48.149931703 +0200
@@ -1,13 +1,19 @@
#!/usr/bin/env python
from distutils.core import setup, Extension
+import os
import subprocess
from glob import glob
def pkgconfig(what):
out = []
cmd = 'pkg-config %s %s' % (what, '@PACKAGE_NAME@')
- pcout = subprocess.check_output(cmd.split()).decode()
+ env = dict(os.environ, **{'PKG_CONFIG_PATH': '..'})
+ proc = subprocess.Popen(cmd.split(),
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ env=env)
+ pcout = proc.communicate()[0].decode()
for token in pcout.split():
out.append(token[2:])
return out
@@ -18,7 +24,8 @@
srcs.extend(glob('%s*.c' % n))
return srcs
-cflags = ['-std=c99']
+cflags = ['-std=c99', '-I../include']
+additional_link_args = ['-Wl,-L../rpmio/.libs', '-Wl,-L../lib/.libs', '-Wl,-L../build/.libs', '-Wl,-L../sign/.libs']
rpmmod = Extension('rpm._rpm',
sources = mksources([
@@ -28,21 +35,24 @@
]),
include_dirs = pkgconfig('--cflags'),
libraries = pkgconfig('--libs'),
- extra_compile_args = cflags
+ extra_compile_args = cflags,
+ extra_link_args = additional_link_args
)
rpmbuild_mod = Extension('rpm._rpmb',
sources = mksources(['rpmbmodule', 'spec']),
include_dirs = pkgconfig('--cflags'),
libraries = pkgconfig('--libs') + ['rpmbuild'],
- extra_compile_args = cflags
+ extra_compile_args = cflags,
+ extra_link_args = additional_link_args
)
rpmsign_mod = Extension('rpm._rpms',
sources = mksources(['rpmbmodule']),
include_dirs = pkgconfig('--cflags'),
libraries = pkgconfig('--libs') + ['rpmsign'],
- extra_compile_args = cflags
+ extra_compile_args = cflags,
+ extra_link_args = additional_link_args
)
setup(name='@PACKAGE_NAME@-python',

View File

@ -21,7 +21,7 @@
Summary: The RPM package management system Summary: The RPM package management system
Name: rpm Name: rpm
Version: %{rpmver} Version: %{rpmver}
Release: %{?snapver:0.%{snapver}.}5%{?dist}.1 Release: %{?snapver:0.%{snapver}.}6%{?dist}
Group: System Environment/Base Group: System Environment/Base
Url: http://www.rpm.org/ Url: http://www.rpm.org/
Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2 Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
@ -62,6 +62,8 @@ Patch305: rpm-4.10.0-dwz-debuginfo.patch
Patch306: rpm-4.10.0-minidebuginfo.patch Patch306: rpm-4.10.0-minidebuginfo.patch
# Fix CRC32 after dwz (#971119) # Fix CRC32 after dwz (#971119)
Patch307: rpm-4.11.1-sepdebugcrcfix.patch Patch307: rpm-4.11.1-sepdebugcrcfix.patch
# To be upstreamed in slightly different form
Patch308: rpm-4.11.0.1-setuppy-fixes.patch
# Temporary Patch to provide support for updates # Temporary Patch to provide support for updates
Patch400: rpm-4.10.90-rpmlib-filesystem-check.patch Patch400: rpm-4.10.90-rpmlib-filesystem-check.patch
@ -104,6 +106,7 @@ BuildRequires: libsemanage-devel%{_isa}
BuildRequires: ncurses-devel%{_isa} BuildRequires: ncurses-devel%{_isa}
BuildRequires: bzip2-devel%{_isa} >= 0.9.0c-2 BuildRequires: bzip2-devel%{_isa} >= 0.9.0c-2
BuildRequires: python-devel%{_isa} >= 2.6 BuildRequires: python-devel%{_isa} >= 2.6
BuildRequires: python3-devel%{_isa} >= 3.2
BuildRequires: lua-devel%{_isa} >= 5.1 BuildRequires: lua-devel%{_isa} >= 5.1
BuildRequires: libcap-devel%{_isa} BuildRequires: libcap-devel%{_isa}
BuildRequires: libacl-devel%{_isa} BuildRequires: libacl-devel%{_isa}
@ -194,7 +197,7 @@ Requires: rpm-build-libs%{_isa} = %{version}-%{release}
This package contains support for digitally signing RPM packages. This package contains support for digitally signing RPM packages.
%package python %package python
Summary: Python bindings for apps which will manipulate RPM packages Summary: Python 2 bindings for apps which will manipulate RPM packages
Group: Development/Libraries Group: Development/Libraries
Requires: rpm = %{version}-%{release} Requires: rpm = %{version}-%{release}
@ -203,7 +206,20 @@ The rpm-python package contains a module that permits applications
written in the Python programming language to use the interface written in the Python programming language to use the interface
supplied by RPM Package Manager libraries. supplied by RPM Package Manager libraries.
This package should be installed if you want to develop Python This package should be installed if you want to develop Python 2
programs that will manipulate RPM packages and databases.
%package python3
Summary: Python 3 bindings for apps which will manipulate RPM packages
Group: Development/Libraries
Requires: rpm = %{version}-%{release}
%description python3
The rpm-python3 package contains a module that permits applications
written in the Python programming language to use the interface
supplied by RPM Package Manager libraries.
This package should be installed if you want to develop Python 3
programs that will manipulate RPM packages and databases. programs that will manipulate RPM packages and databases.
%package apidocs %package apidocs
@ -242,6 +258,7 @@ packages on a system.
%patch305 -p1 -b .dwz-debuginfo %patch305 -p1 -b .dwz-debuginfo
%patch306 -p1 -b .minidebuginfo %patch306 -p1 -b .minidebuginfo
%patch307 -p1 -b .sepdebugcrcfix %patch307 -p1 -b .sepdebugcrcfix
%patch308 -p1 -b .setuppy-fixes
%patch400 -p1 -b .rpmlib-filesystem-check %patch400 -p1 -b .rpmlib-filesystem-check
@ -285,11 +302,25 @@ export CPPFLAGS CFLAGS LDFLAGS
make %{?_smp_mflags} make %{?_smp_mflags}
pushd python
%{__python} setup.py build
%{__python3} setup.py build
popd
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
make DESTDIR="$RPM_BUILD_ROOT" install make DESTDIR="$RPM_BUILD_ROOT" install
# We need to build with --enable-python for the self-test suite, but we
# actually package the bindings built with setup.py (#531543#c26)
rm -rf $RPM_BUILD_ROOT/%{python_sitearch}
pushd python
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
popd
# Save list of packages through cron # Save list of packages through cron
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily
install -m 755 scripts/rpm.daily ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily/rpm install -m 755 scripts/rpm.daily ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily/rpm
@ -451,6 +482,12 @@ exit 0
%files python %files python
%defattr(-,root,root) %defattr(-,root,root)
%{python_sitearch}/rpm %{python_sitearch}/rpm
%{python_sitearch}/rpm_python-%{version}-py2.7.egg-info
%files python3
%defattr(-,root,root)
%{python3_sitearch}/rpm
%{python3_sitearch}/rpm_python-%{version}-py%{python3_version}.egg-info
%files devel %files devel
%defattr(-,root,root) %defattr(-,root,root)
@ -470,6 +507,9 @@ exit 0
%doc COPYING doc/librpm/html/* %doc COPYING doc/librpm/html/*
%changelog %changelog
* Wed Aug 21 2013 Panu Matilainen <pmatilai@redhat.com> - 4.11.1-6
- add python3 sub-package, based on patch by Bohuslav Kabrda
* Sat Aug 03 2013 Petr Pisar <ppisar@redhat.com> - 4.11.1-5.1 * Sat Aug 03 2013 Petr Pisar <ppisar@redhat.com> - 4.11.1-5.1
- Perl 5.18 rebuild - Perl 5.18 rebuild