From: Jakub Bogusz Date: Sun, 10 Dec 2017 20:15:13 +0000 (+0100) Subject: - added update patch (fix build with libcdio 1.0.0: remove obsolete constant) X-Git-Tag: auto/th/python-pycdio-0.20-5 X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=2749bbb73cd2285a145adef34544c1bf03ce51d4;p=packages%2Fpython-pycdio.git - added update patch (fix build with libcdio 1.0.0: remove obsolete constant) - added python3 package - release 5 --- diff --git a/python-pycdio-update.patch b/python-pycdio-update.patch new file mode 100644 index 0000000..ac5e48f --- /dev/null +++ b/python-pycdio-update.patch @@ -0,0 +1,10 @@ +--- pycdio-0.20/swig/device_const.swg.orig 2013-02-20 12:32:41.000000000 +0100 ++++ pycdio-0.20/swig/device_const.swg 2017-12-10 20:53:27.839959959 +0100 +@@ -83,7 +83,6 @@ + /* driver_id_t enums. */ + %constant long int DRIVER_UNKNOWN = DRIVER_UNKNOWN; + %constant long int DRIVER_AIX = DRIVER_AIX; +-%constant long int DRIVER_BSDI = DRIVER_BSDI; + %constant long int DRIVER_FREEBSD = DRIVER_FREEBSD; + %constant long int DRIVER_LINUX = DRIVER_LINUX; + %constant long int DRIVER_SOLARIS = DRIVER_SOLARIS; diff --git a/python-pycdio.spec b/python-pycdio.spec index 777626c..4bdeac7 100644 --- a/python-pycdio.spec +++ b/python-pycdio.spec @@ -1,28 +1,48 @@ -Summary: Python bindings for libcdio -Summary(pl.UTF-8): Wiązania Pythona do libcdio +# +# Conditional build: +%bcond_without python2 # CPython 2.x module +%bcond_without python3 # CPython 3.x module + +Summary: Python 2 bindings for libcdio +Summary(pl.UTF-8): Wiązania Pythona 2 do libcdio Name: python-pycdio Version: 0.20 -Release: 4 +Release: 5 License: GPL v2+ Group: Libraries/Python Source0: http://ftp.gnu.org/gnu/libcdio/pycdio-%{version}.tar.gz # Source0-md5: 3f075574f661f49f4ede89aff9ff0cda +Patch0: %{name}-update.patch URL: http://www.gnu.org/software/libcdio/ BuildRequires: libcdio-devel >= 0.84 BuildRequires: pkgconfig -BuildRequires: python-devel >= 1:2.3.5 +%{?with_python2:BuildRequires: python-devel >= 1:2.3.5} +%{?with_python3:BuildRequires: python3-devel >= 1:3.2} BuildRequires: rpm-pythonprov -BuildRequires: rpmbuild(macros) >= 1.710 -BuildRequires: swig-python -%pyrequires_eq python-libs +BuildRequires: rpmbuild(macros) >= 1.714 +BuildRequires: swig-python >= 3 Requires: libcdio >= 0.84 +Requires: python-libs >= 1:2.3.5 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description -Python bindings for libcdio. +Python 2 bindings for libcdio. %description -l pl.UTF-8 -Wiązania Pythona do libcdio. +Wiązania Pythona 2 do libcdio. + +%package -n python3-pycdio +Summary: Python 3 bindings for libcdio +Summary(pl.UTF-8): Wiązania Pythona 3 do libcdio +Group: Libraries/Python +Requires: libcdio >= 0.84 +Requires: python3-libs >= 1:3.2 + +%description -n python3-pycdio +Python 3 bindings for libcdio. + +%description -n python3-pycdio -l pl.UTF-8 +Wiązania Pythona 3 do libcdio. %package examples Summary: Example programs using Python libcdio bindings @@ -38,26 +58,40 @@ Przykładowe programy w Pythonie używające libcdio. %prep %setup -q -n pycdio-%{version} +%patch0 -p1 %build +%if %{with python2} %py_build +%endif + +%if %{with python3} +%py3_build +%endif %install rm -rf $RPM_BUILD_ROOT +%if %{with python2} %py_install +%py_postclean +%endif + +%if %{with python3} +%py3_install +%endif + install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} install example/{*.py,README} $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -%py_postclean - %clean rm -rf $RPM_BUILD_ROOT +%if %{with python2} %files %defattr(644,root,root,755) -%doc README.txt +%doc ChangeLog README.txt THANKS %attr(755,root,root) %{py_sitedir}/_pycdio.so %attr(755,root,root) %{py_sitedir}/_pyiso9660.so %{py_sitedir}/cdio.py[co] @@ -65,6 +99,24 @@ rm -rf $RPM_BUILD_ROOT %{py_sitedir}/pycdio.py[co] %{py_sitedir}/pyiso9660.py[co] %{py_sitedir}/pycdio-%{version}-py*.egg-info +%endif + +%if %{with python3} +%files -n python3-pycdio +%defattr(644,root,root,755) +%doc ChangeLog README.txt THANKS +%attr(755,root,root) %{py3_sitedir}/_pycdio.cpython-*.so +%attr(755,root,root) %{py3_sitedir}/_pyiso9660.cpython-*.so +%{py3_sitedir}/cdio.py +%{py3_sitedir}/iso9660.py +%{py3_sitedir}/pycdio.py +%{py3_sitedir}/pyiso9660.py +%{py3_sitedir}/__pycache__/cdio.cpython-*.py[co] +%{py3_sitedir}/__pycache__/iso9660.cpython-*.py[co] +%{py3_sitedir}/__pycache__/pycdio.cpython-*.py[co] +%{py3_sitedir}/__pycache__/pyiso9660.cpython-*.py[co] +%{py3_sitedir}/pycdio-%{version}-py*.egg-info +%endif %files examples %defattr(644,root,root,755)