@ -1,7 +1,27 @@
## START: Set by rpmautospec
## (rpmautospec version 0.7.2)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 76;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec
%if ! 0%{?fedora} || 0%{?fedora} >= 41
%bcond gimp 0
%bcond pixbuf_extra_modules 1
%else
%bcond gimp 1
%bcond pixbuf_extra_modules 0
%endif
# if you rebuild, please change bugtracker_url accordingly:
%global bugtracker_url http://bugzilla.redhat.com
%global bugtracker_url https ://bugzilla.redhat.com
%global gimpplugindir %(gimptool --gimpplugindir 2>/dev/null || echo INVALID)/plug-ins
%if %{with gimp}
%global gimpplugindir %(%___build_pre; gimptool --gimpplugindir 2>/dev/null || echo INVALID)/plug-ins
%endif
%global iconrootdir %{_datadir}/icons/hicolor
# needed for off-root building
@ -10,7 +30,7 @@
Name: xsane
Summary: X Window System front-end for the SANE scanner interface
Version: 0.999
Release: 42%{?dist }
Release: %{autorelease }
Source0: http://www.xsane.org/download/%{name}-%{version}.tar.gz
Source1: xsane-256x256.png
# use "xdg-open" instead of "netscape" to launch help browser
@ -66,17 +86,25 @@ Patch14: xsane-0.999-snprintf-update.patch
# fix signal handling (#1073698)
# submitted to upstream (Oliver Rauch) via email, 2014-07-03
Patch15: xsane-0.999-signal-handling.patch
# https://gitlab.com/sane-project/frontend/xsane/-/commit/96424e369f67
Patch16: 0001-Follow-new-convention-for-registering-gimp-plugin.patch
# autoconf-generated files
Patch100: xsane-0.999-7-autoconf.patch.bz2
License: GPLv2+ and LGPLv2+
Patch101: xsane-configure-c99.patch
# LGPL-3.0-or-later is due of using gimp libraries
# src/* - GPL2+
# lib/* (copies from glibc) - LGPL2+
License: GPL-2.0-or-later AND LGPL-2.0-or-later AND LGPL-3.0-or-later
URL: http://www.xsane.org/
# gcc is no longer in buildroot by default
BuildRequires: gcc
# uses make
BuildRequires: make
%if 0%{?rhel} <= 8 || 0%{?fedora }
%if %{with gimp }
BuildRequires: gimp-devel
%endif
BuildRequires: gtk2-devel
@ -89,6 +117,12 @@ BuildRequires: libtiff-devel
BuildRequires: gettext-devel
Requires: xsane-common
Requires: hicolor-icon-theme
%if %{with pixbuf_extra_modules}
Requires: gdk-pixbuf2-modules-extra%{?_isa}
%endif
%if %{without gimp}
Obsoletes: xsane-gimp < %{version}-%{release}
%endif
%description
XSane is an X based interface for the SANE (Scanner Access Now Easy)
@ -96,11 +130,14 @@ library, which provides access to scanners, digital cameras, and other
capture devices. XSane is written in GTK+ and provides control for
performing the scan and then manipulating the captured image.
%if 0%{?rhel} <= 8 || 0%{?fedora }
%if %{with gimp }
%package gimp
Summary: GIMP plug-in providing the SANE scanner interface
Requires: gimp >= 2:2.2.12-4
Requires: xsane-common
%if %{with pixbuf_extra_modules}
Requires: gdk-pixbuf2-modules-extra%{?_isa}
%endif
%description gimp
This package provides the regular XSane frontend for the SANE scanner
@ -124,24 +161,26 @@ for doc in xsane.{CHANGES,PROBLEMS,INSTALL}; do
mv "$doc.new" "$doc"
done
%patch0 -p1 -b .xdg-open
%patch1 -p1 -b .close-fds
%patch2 -p1 -b .no-eula
%patch3 -p1 -b .off-root-build
%patch4 -p1 -b .no-file-selected
%patch5 -p1 -b .ipv6
%patch6 -p1 -b .preview-selection.patch
%patch7 -p1 -b .libpng
%patch8 -p1 -b .wmclass
%patch9 -p1 -b .desktop-file
%patch10 -p1 -b .man-page
%patch11 -p1 -b .pdf-no-high-bpp
%patch12 -p1 -b .lcms2
%patch13 -p1 -b .coverity
%patch14 -p1 -b .snprintf-update
%patch15 -p1 -b .signal-handling
%patch100 -p1 -b .autoconf
%patch -P 0 -p1 -b .xdg-open
%patch -P 1 -p1 -b .close-fds
%patch -P 2 -p1 -b .no-eula
%patch -P 3 -p1 -b .off-root-build
%patch -P 4 -p1 -b .no-file-selected
%patch -P 5 -p1 -b .ipv6
%patch -P 6 -p1 -b .preview-selection.patch
%patch -P 7 -p1 -b .libpng
%patch -P 8 -p1 -b .wmclass
%patch -P 9 -p1 -b .desktop-file
%patch -P 10 -p1 -b .man-page
%patch -P 11 -p1 -b .pdf-no-high-bpp
%patch -P 12 -p1 -b .lcms2
%patch -P 13 -p1 -b .coverity
%patch -P 14 -p1 -b .snprintf-update
%patch -P 15 -p1 -b .signal-handling
%patch -P 16 -p1 -b .use-register
%patch -P 100 -p1 -b .autoconf
%patch -P 101 -p1 -b .c99
# in-root config.h breaks off-root building
rm include/config.h
@ -153,9 +192,13 @@ mkdir build-without-gimp
CFLAGS='%optflags -fno-strict-aliasing -DXSANE_BUGTRACKER_URL=\"%{bugtracker_url}\"'
export CFLAGS
%if 0%{?rhel} <= 8 || 0%{?fedora }
%if %{with gimp }
pushd build-with-gimp
%configure --enable-gimp
if grep -Fq '#undef HAVE_ANY_GIMP' include/config.h; then
echo "The configure script didn’ t detect GIMP" >&2
exit 1
fi
%make_build
popd
%endif
@ -173,10 +216,10 @@ pushd build-without-gimp
%make_install
popd
%if 0%{?rhel} <= 8 || 0%{?fedora }
%if %{with gimp }
# install GIMP plugin
install -m 0755 -d %{buildroot}%{gimpplugindir}
install -m 0755 build-with-gimp/src/xsane %{buildroot}%{gimpplugindir}
install -m 0755 build-with-gimp/src/xsane %{buildroot}%{gimpplugindir}/%{name}
%endif
# install customized desktop file
@ -230,32 +273,19 @@ EOF
%find_lang %{name} XSANE.lang
%if 0%{?rhel} <= 8 || 0%{?fedora}
%pre gimp
# remove obsolete gimp-plugin-mgr managed symlink
if [ -L "%{gimpplugindir}/xsane" ]; then
rm -f "%{gimpplugindir}/xsane"
fi
%endif
%files -f XSANE.lang
%doc xsane.ACCELKEYS xsane.AUTHOR xsane.BEGINNERS-INFO xsane.BUGS xsane.CHANGES xsane.FAQ xsane.LANGUAGES xsane.LOGO xsane.NEWS xsane.ONLINEHELP xsane.PROBLEMS xsane.ROOT xsane.TODO
%license xsane.COPYING
%{_bindir}/xsane
%{_mandir}/man1/*
%if %{with desktop_vendor_tag}
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/fedora-xsane.desktop
%else
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/xsane.desktop
%endif
%{_datadir}/pixmaps/xsane.xpm
%{iconrootdir}/*/apps/%{name}.png
%if 0%{?rhel} <= 8 || 0%{?fedora }
%if %{with gimp }
%files gimp
%{gimpplugindir}/xsane
%{gimpplugindir}/%{name}
%endif
%files common
@ -265,12 +295,57 @@ fi
%{_datadir}/sane/xsane
%changelog
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 0.999-42
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Sun Jan 12 2025 Arkady L. Shane <tigro@msvsphere-os.ru> - 0.999-76
- Rebuilt for MSVSphere 10
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.999-41
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
## START: Generated by rpmautospec
* Sun Oct 13 2024 Nils Philippsen <nils@tiptoe.de> - 0.999-75
- Drop GIMP plugin for Fedora >= 41
* Thu Aug 29 2024 Nils Philippsen <nils@tiptoe.de> - 0.999-73
- Use https bugzilla URL
* Tue Aug 27 2024 Zdenek Dohnal <zdohnal@redhat.com> - 0.999-70
- Use procedure registration for the plugin
* Mon Aug 19 2024 Nils Philippsen <nils@tiptoe.de> - 0.999-69
- Rebuild against new gimp
* Fri Jul 26 2024 Benjamin Gilbert <bgilbert@backtick.net> - 0.999-52
- Require gdk-pixbuf2-modules-extra on F41+ to fix crash (rhbz#2276661)
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.999-51
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.999-50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Nov 23 2023 Zdenek Dohnal <zdohnal@redhat.com> - 0.999-49
- add license for gimp library - used in plugin which we build it in Fedora because
* Wed Jul 26 2023 Zdenek Dohnal <zdohnal@redhat.com> - 0.999-48
- SPDX migration
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.999-47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Jul 19 2023 Josef Ridky <jridky@redhat.com> - 0.999-46
- Migrate to SPDX license format
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.999-45
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Jan 17 2023 Florian Weimer <fweimer@redhat.com> - 0.999-44
- Port configure script to C99
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.999-43
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.999-42
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.999-41
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Jan 28 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.999-40
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
@ -358,7 +433,7 @@ fi
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Thu May 29 2014 Tom Callaway <spot@fedoraproject.org> - 0.999-13
- update to newer snprintf implementation from LPRng that resolves license
- update to newer snprintf implementation from LPRng that resolves license
issue (#1102523)
* Thu Apr 03 2014 Nils Philippsen <nils@redhat.com> - 0.999-12
@ -850,3 +925,5 @@ fi
* Thu Apr 22 1999 Preston Brown <pbrown@redhat.com>
- initial RPM for PowerTools 6.0
## END: Generated by rpmautospec