From 2ea139f15b6b7f8be0059e82fb9b9f647df5bb706b2593055337a1606f2d7ede Mon Sep 17 00:00:00 2001 From: Alexei Sorokin Date: Tue, 5 May 2020 16:10:03 +0000 Subject: [PATCH] Accepting request 800333 from home:dimstar:Factory - Let distros decide if they still want to build python2 bindings (bcond_without python2). Tumbleweed disables this by now. OBS-URL: https://build.opensuse.org/request/show/800333 OBS-URL: https://build.opensuse.org/package/show/X11:Unity/evemu?expand=0&rev=12 --- evemu.changes | 6 ++++++ evemu.spec | 17 ++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/evemu.changes b/evemu.changes index 3a5f7cf..6df6d5a 100644 --- a/evemu.changes +++ b/evemu.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue May 5 10:55:57 UTC 2020 - Dominique Leuenberger + +- Let distros decide if they still want to build python2 bindings + (bcond_without python2). Tumbleweed disables this by now. + ------------------------------------------------------------------- Mon May 4 07:11:48 UTC 2020 - Luigi Baldoni diff --git a/evemu.spec b/evemu.spec index 5d998c4..2a0611a 100644 --- a/evemu.spec +++ b/evemu.spec @@ -16,6 +16,9 @@ # +# Let the distro decide if py2 support is still valid. TW disables it +%bcond_without python2 + %define soname libevemu %define sover 3 Name: evemu @@ -32,7 +35,9 @@ BuildRequires: asciidoc BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: pkgconfig +%if %{with python2} BuildRequires: python2-devel +%endif BuildRequires: python3-devel BuildRequires: xmlto BuildRequires: pkgconfig(libevdev) >= 1.2.99.902 @@ -103,7 +108,11 @@ sed -i \ %build %global _configure ../configure -for py in python2 python3; do +%if %{with python2} +PYTHONS=python2 +%endif +PYTHONS="$PYTHONS python3" +for py in $PYTHONS; do export PYTHON=$py mkdir -p build-$py pushd build-$py @@ -116,7 +125,9 @@ for py in python2 python3; do done %install +%if %{with python2} %make_install -C build-python2 +%endif %make_install -C build-python3 find %{buildroot} -type f -name "*.la" -delete -print @@ -127,7 +138,9 @@ rm -f %{buildroot}%{python_sitelib}/%{name}/*.pyo \ %fdupes %{buildroot}%{_bindir}/ %fdupes %{buildroot}%{_mandir}/ +%if %{with python2} %fdupes %{buildroot}%{python2_sitelib} +%endif %post -n %{soname}%{sover} -p /sbin/ldconfig @@ -142,9 +155,11 @@ rm -f %{buildroot}%{python_sitelib}/%{name}/*.pyo \ %license COPYING %{_libdir}/%{soname}.so.%{sover}* +%if %{with python2} %files -n python2-%{name} %license COPYING %{python2_sitelib}/%{name}/ +%endif %files -n python3-%{name} %license COPYING