gutenprint.spec: use bcond instead of OS conditions

This commit is contained in:
Zdenek Dohnal 2023-04-05 12:15:45 +02:00
parent 1a5c5b428d
commit 86f460b8a6

View File

@ -5,6 +5,12 @@
#%%global majminver 5.3
%global majminver $(echo %{version} | sed -E 's/\.[0-9]+$//')
%if 0%{?rhel} <= 8 || 0%{?fedora}
%bcond_without plugin
%else
%bcond_with plugin
%endif
%if 0%{?rhel} <= 9 || 0%{?fedora}
%bcond_without gtk2
%else
@ -72,7 +78,7 @@ BuildRequires: sed
# the plugin is built only in Fedora, so
# no need gimp devel files for its ui
%if 0%{?rhel} <= 8 || 0%{?fedora}
%if %{with plugin}
BuildRequires: pkgconfig(gimpui-2.0)
%endif
@ -124,7 +130,7 @@ Requires: gtk2-devel
This package contains headers and libraries required to build applications that
uses gutenprint package.
%if 0%{?rhel} <= 8 || 0%{?fedora}
%if %{with plugin}
%package plugin
Summary: GIMP plug-in for gutenprint
Requires: %{name}%{?_isa} = %{version}-%{release}
@ -227,7 +233,7 @@ cat %{name}-po.lang >>%{name}.lang
# to chrpath, please let me know!
for file in \
%{buildroot}%{_sbindir}/cups-genppd.%{majminver} \
%if 0%{?rhel} <= 8 || 0%{?fedora}
%if %{with plugin}
%{buildroot}%{_libdir}/gimp/*/plug-ins/* \
%endif
%{buildroot}%{_libdir}/*.so.* \
@ -238,7 +244,7 @@ do
chrpath --delete ${file}
done
%if 0%{?rhel} > 8
%if %{without plugin}
%{_bindir}/rm -f %{buildroot}%{_bindir}/testpattern \
%endif
@ -285,7 +291,7 @@ exit 0
%{_libdir}/pkgconfig/gutenprintui2.pc
%endif
%if 0%{?rhel} <= 8 || 0%{?fedora}
%if %{with plugin}
%files plugin
%{_libdir}/gimp/*/plug-ins/gutenprint