Remove more cruft for unstable version packaging

Signed-off-by: Nils Philippsen <nils@tiptoe.de>
This commit is contained in:
Nils Philippsen 2022-09-03 23:07:42 +02:00
parent 3fc73e9483
commit 0300531b71

101
gimp.spec
View File

@ -1,6 +1,3 @@
# Set this to 0 in stable, 1 in (SONAME-wise) unstable releases
%global unstable 0
#### options:
# Use the following --with/--without <option> switches to control how the
# package will be built:
@ -10,11 +7,7 @@
# static: build static libraries
%bcond_with static
# default_binary: install unversioned binary
%if ! %unstable
%bcond_without default_binary
%else
%bcond_with default_binary
%endif
# aalib: build with AAlib (ASCII art gfx library)
%if 0%{?rhel}
# don't use aalib on RHEL
@ -77,22 +70,8 @@ Release: %autorelease
%global interface_age 0
%global gettext_version %{major}0
%global lib_api_version %{major}.0
%if ! %unstable
%global lib_minor %(echo $[%minor * 100])
%global lib_micro %micro
%else
%global lib_minor %(echo $[%minor * 100 + %{micro}])
%global lib_micro 0
%endif
%if %unstable
%global os_bindir %{_bindir}
%global os_datadir %{_datadir}
%undefine _prefix
%undefine _sysconfdir
%global _prefix /opt/gimp-%{major}.%{minor}
%global _sysconfdir %{_prefix}/etc
%endif
# poppler is "GPLv2 or GPLv3" which makes plug-ins linking to libpoppler such
# as file-pdf-load GPLv3-only
@ -167,11 +146,6 @@ BuildRequires: gettext >= 0.19
BuildRequires: make
BuildRequires: pkgconfig
%if %unstable
BuildRequires: desktop-file-utils
BuildRequires: ImageMagick
%endif
Requires: babl%{?_isa} >= 0.1.78
Requires: gegl04%{?_isa} >= 0.4.30
Requires: fontconfig >= 2.12.4
@ -194,10 +168,6 @@ Recommends: %{name}-help-browser = %{epoch}:%{version}-%{release}
Obsoletes: %{name}-help-browser < %{epoch}:%{version}-%{release}
Conflicts: %{name}-help-browser < %{epoch}:%{version}-%{release}
%endif
%if ! %unstable
Obsoletes: %{name}-unstable < %{epoch}:%{major}.%{minor}
Conflicts: %{name}-unstable < %{epoch}:%{major}.%{minor}
%endif
#Demodularizing of gimp (#1772469)
Obsoletes: %{name} < %{epoch}:%{version}-%{release}
@ -230,10 +200,6 @@ with multi-level undo.
%package libs
Summary: GIMP libraries
License: LGPLv3+
%if ! %unstable
Obsoletes: %{name}-unstable-libs < %{epoch}:%{major}.%{minor}
Conflicts: %{name}-unstable-libs < %{epoch}:%{major}.%{minor}
%endif
# Demodularizing of gimp (#1772469)
Obsoletes: %{name}-libs < %{epoch}:%{version}-%{release}
Conflicts: %{name}-libs < %{epoch}:%{version}-%{release}
@ -251,10 +217,6 @@ Requires: gtk2-devel
Requires: glib2-devel
Requires: pkgconfig
Requires: rpm >= 4.11.0
%if ! %unstable
Obsoletes: %{name}-unstable-devel < %{epoch}:%{major}.%{minor}
Conflicts: %{name}-unstable-devel < %{epoch}:%{major}.%{minor}
%endif
# Demodularizing of gimp (#1772469)
Obsoletes: %{name}-devel < %{epoch}:%{version}-%{release}
Conflicts: %{name}-devel < %{epoch}:%{version}-%{release}
@ -268,10 +230,6 @@ extensions.
Summary: GIMP plugin and extension development tools
License: LGPLv3+
Requires: %{name}-devel = %{epoch}:%{version}-%{release}
%if ! %unstable
Obsoletes: %{name}-unstable-devel-tools < %{epoch}:%{major}.%{minor}
Conflicts: %{name}-unstable-devel-tools < %{epoch}:%{major}.%{minor}
%endif
# Demodularizing of gimp (#1772469)
Obsoletes: %{name}-devel-tools < %{epoch}:%{version}-%{release}
Conflicts: %{name}-devel-tools < %{epoch}:%{version}-%{release}
@ -285,10 +243,6 @@ build GNU Image Manipulation Program (GIMP) plug-ins and extensions.
Summary: GIMP help browser plug-in
License: GPLv3+
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
%if ! %unstable
Obsoletes: %{name}-unstable-help-browser < %{epoch}:%{major}.%{minor}
Conflicts: %{name}-unstable-help-browser < %{epoch}:%{major}.%{minor}
%endif
# Demodularizing of gimp (#1772469)
Obsoletes: %{name}-help-browser < %{epoch}:%{version}-%{release}
Conflicts: %{name}-help-browser < %{epoch}:%{version}-%{release}
@ -373,7 +327,6 @@ export RHEL_ALLOW_PYTHON2_FOR_BUILD=1
%make_build
%if ! %{unstable}
# Generate RPM macros from pkg-config data:
# %%_gimp_datadir -- toplevel directory for brushes, gradients, scripts, ...
# %%_gimp_libdir -- toplevel directory for modules, plug-ins, ...
@ -417,13 +370,10 @@ cat << EOF > macros.gimp
%%_gimp_scriptdir ${_gimp_scriptdir}
%%_gimp_plugindir ${_gimp_plugindir}
EOF
%endif
%install
%make_install
%if ! %unstable
install -D -m0644 macros.gimp %{buildroot}%{_rpmconfigdir}/macros.d/macros.gimp
%endif
# remove rpaths
find %buildroot -type f -print0 | xargs -0 -L 20 chrpath --delete --keepgoing 2>/dev/null || :
@ -493,50 +443,6 @@ grep -E -rl '^#!\s*/usr/bin/env\s+python' --include=\*.py "%{buildroot}" |
echo "%{__python2}=%{__python2}" >> %{buildroot}%{_libdir}/gimp/%{lib_api_version}/interpreters/pygimp.interp
%endif
%if %unstable
# install stuff in system locations
# script wrappers for executables
mkdir -p %{buildroot}%{os_bindir}
pushd %{buildroot}%{_bindir}
for exe in *-%{major}.%{minor}; do
cat << EOF > "%{buildroot}%{os_bindir}/$exe"
#!/bin/sh
export LD_LIBRARY_PATH=%{_libdir}
exec %{_bindir}/$exe "\$@"
EOF
chmod 755 %{buildroot}%{os_bindir}/"$exe"
done
popd
# desktop file -- mention version/unstable, use custom icon
desktop-file-install --dir=%{buildroot}%{os_datadir}/applications \
--set-name="GIMP %major.%minor (unstable)" \
--set-icon="gimp-%major.%minor" \
%{buildroot}%{_datadir}/applications/gimp.desktop
mv -f %{buildroot}%{os_datadir}/applications/gimp.desktop \
%{buildroot}%{os_datadir}/applications/gimp-%major.%minor.desktop
# icons -- overlay major.minor version
pushd %{buildroot}%{_datadir}/icons/hicolor
for srcicon in */apps/gimp.png; do
geo=${srcicon%%%%/*}
dim=${geo%%x*}
ps=$((5+$dim/6))
sw=$(($dim/50+1))
o=$(($dim/26+1))
destdir="%{buildroot}%{os_datadir}/icons/hicolor/$geo/apps"
desticon="$destdir/gimp-%{major}.%{minor}.png"
mkdir -p "$destdir"
convert "$srcicon" \
-gravity northeast -pointsize $ps -strokewidth $sw \
-stroke black -annotate +$o+$(($o+$ps)) %{major}.%{minor} \
-stroke none -fill white -annotate +$o+$(($o+$ps)) %{major}.%{minor} \
"$desticon"
done
popd
%endif
%check
# skip tests known to be problematic in a specific version
%if "%{version}" == "%{?skip_checks_version}"
@ -630,11 +536,6 @@ make check %{?_smp_mflags}
%endif
%{_datadir}/icons/hicolor/*/apps/gimp.png
%if %unstable
%{os_bindir}/*-%{major}.%{minor}
%{os_datadir}/applications/gimp-%{major}.%{minor}.desktop
%{os_datadir}/icons/hicolor/*/apps/gimp-%{major}.%{minor}.png
%endif
%files libs
%license COPYING
@ -674,9 +575,7 @@ make check %{?_smp_mflags}
%{_datadir}/aclocal/*.m4
%{_includedir}/gimp-%{lib_api_version}
%{_libdir}/pkgconfig/*
%if ! %unstable
%{_rpmconfigdir}/macros.d/macros.gimp
%endif
%files devel-tools
%{_bindir}/gimptool-%{lib_api_version}