From 8cc55f94cc9ef669a6f5854438e1fa8182605f1a Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 8 Nov 2016 15:10:48 +0100 Subject: [PATCH] use %bcond_* for python3 Signed-off-by: Igor Gnatenko --- libpeas.spec | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/libpeas.spec b/libpeas.spec index e254a20..b54eeaa 100644 --- a/libpeas.spec +++ b/libpeas.spec @@ -1,7 +1,7 @@ -%if 0%{?rhel} == 0 -%global use_python3 1 +%if 0%{?rhel} && 0%{?rhel} <= 7 +%bcond_with python3 %else -%global use_python3 0 +%bcond_without python3 %endif Name: libpeas @@ -15,10 +15,6 @@ Source0: https://download.gnome.org/sources/%{name}/1.20/%{name}-%{version}.tar. BuildRequires: pkgconfig(gtk+-3.0) >= 3.0.0 BuildRequires: pkgconfig(pygobject-3.0) -BuildRequires: python-devel -%if %{use_python3} -BuildRequires: python3-devel -%endif BuildRequires: intltool BuildRequires: pkgconfig(gladeui-2.0) @@ -31,6 +27,7 @@ to GTK+ and glib-based applications. %package loader-python Summary: Python 2 loader for libpeas +BuildRequires: python2-devel Requires: %{name}%{?_isa} = %{version}-%{release} Requires: pygobject3 @@ -38,9 +35,10 @@ Requires: pygobject3 This package contains the Python 2 loader that is needed to run Python 2 plugins that use libpeas. -%if %{use_python3} +%if %{with python3} %package loader-python3 Summary: Python 3 loader for libpeas +BuildRequires: python3-devel Requires: %{name}%{?_isa} = %{version}-%{release} Requires: python3-gobject @@ -95,7 +93,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor >&/dev/null || : %files loader-python %{_libdir}/libpeas-1.0/loaders/libpythonloader.so -%if %{use_python3} +%if %{with python3} %files loader-python3 %{_libdir}/libpeas-1.0/loaders/libpython3loader.so %endif