From c1930049de0de8b9573ee6890f36a1f2c859ea3a Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Thu, 24 Nov 2016 18:45:48 +0100 Subject: [PATCH] Update RHEL conditionals --- libpeas.spec | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/libpeas.spec b/libpeas.spec index 877003d..20bc7ac 100644 --- a/libpeas.spec +++ b/libpeas.spec @@ -1,7 +1,7 @@ -%if 0%{?rhel} && 0%{?rhel} <= 7 -%bcond_with python3 +%if 0%{?rhel} == 0 +%global use_python3 1 %else -%bcond_without python3 +%global use_python3 0 %endif %global nsver 1.0 @@ -25,6 +25,11 @@ BuildRequires: pkgconfig(gmodule-2.0) BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(gobject-introspection-1.0) BuildRequires: pkgconfig(gladeui-2.0) +BuildRequires: pkgconfig(pygobject-3.0) +BuildRequires: python2-devel +%if %{use_python3} +BuildRequires: python3-devel +%endif %description libpeas is a convenience library making adding plug-ins support @@ -41,8 +46,6 @@ to GTK+-based applications. %package loader-python Summary: Python 2 loader for libpeas -BuildRequires: pkgconfig(pygobject-3.0) -BuildRequires: python2-devel Requires: %{name}%{?_isa} = %{version}-%{release} Requires: pygobject3 @@ -50,11 +53,9 @@ Requires: pygobject3 This package contains the Python 2 loader that is needed to run Python 2 plugins that use libpeas. -%if %{with python3} +%if %{use_python3} %package loader-python3 Summary: Python 3 loader for libpeas -BuildRequires: pkgconfig(pygobject-3.0) -BuildRequires: python3-devel Requires: %{name}%{?_isa} = %{version}-%{release} Requires: python3-gobject @@ -86,7 +87,9 @@ find %{buildroot}%{_libdir} -type f -name '*.la' -print -delete # Remove rpath as per https://fedoraproject.org/wiki/Packaging/Guidelines#Beware_of_Rpath chrpath --delete $RPM_BUILD_ROOT%{_bindir}/peas-demo +%if %{use_python3} chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libpeas-1.0/loaders/libpython3loader.so +%endif chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libpeas-1.0/loaders/libpythonloader.so chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libpeas-gtk-1.0.so chrpath --delete $RPM_BUILD_ROOT%{_libdir}/peas-demo/plugins/helloworld/libhelloworld.so @@ -124,7 +127,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor >&/dev/null || : %files loader-python %{_libdir}/libpeas-%{nsver}/loaders/libpythonloader.so -%if %{with python3} +%if %{use_python3} %files loader-python3 %{_libdir}/libpeas-%{nsver}/loaders/libpython3loader.so %endif @@ -147,6 +150,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor >&/dev/null || : %changelog * Thu Nov 24 2016 Kalev Lember - 1.20.0-3 - Remove lib64 rpaths +- Update RHEL conditionals * Tue Nov 08 2016 Igor Gnatenko - 1.20.0-2 - Trivial fixes in spec