diff --git a/.gitignore b/.gitignore index 322f372..b117f32 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -SOURCES/xsane-0.999-7-autoconf.patch.bz2 SOURCES/xsane-0.999.tar.gz -SOURCES/xsane-256x256.png +SOURCES/xsane-0.999-7-autoconf.patch.bz2 diff --git a/.xsane.metadata b/.xsane.metadata index fcafcb3..295a9df 100644 --- a/.xsane.metadata +++ b/.xsane.metadata @@ -1,3 +1,2 @@ -8984dbb732b8b0f98d9bd50fdb16d3510d7d2eef SOURCES/xsane-0.999-7-autoconf.patch.bz2 -633150e4e690c1e8c18d6b82886c2fb4daba4bc9 SOURCES/xsane-0.999.tar.gz -ab0517cb7fa9a7fc30499f56f7e9aac628d9bc40 SOURCES/xsane-256x256.png +633150e4e690c1e8c18d6b82886c2fb4daba4bc9 SOURCES/xsane-0.999.tar.gz +8984dbb732b8b0f98d9bd50fdb16d3510d7d2eef SOURCES/xsane-0.999-7-autoconf.patch.bz2 diff --git a/SOURCES/0001-Follow-new-convention-for-registering-gimp-plugin.patch b/SOURCES/0001-Follow-new-convention-for-registering-gimp-plugin.patch new file mode 100644 index 0000000..23be0d2 --- /dev/null +++ b/SOURCES/0001-Follow-new-convention-for-registering-gimp-plugin.patch @@ -0,0 +1,72 @@ +diff -up xsane-0.999/src/xsane-save.c.use-register xsane-0.999/src/xsane-save.c +--- xsane-0.999/src/xsane-save.c.use-register 2024-08-27 17:26:05.375925695 +0200 ++++ xsane-0.999/src/xsane-save.c 2024-08-27 17:26:05.383925749 +0200 +@@ -6641,10 +6641,14 @@ static void xsane_gimp_query(void) + + snprintf(name, sizeof(name), "%s", xsane.prog_name); + #ifdef GIMP_CHECK_VERSION +-# if GIMP_CHECK_VERSION(1,1,9) ++# if GIMP_CHECK_VERSION(2,10,30) ++ snprintf(mpath, sizeof(mpath), "%s", XSANE_GIMP_MENU_DIALOG_NEW); ++#else ++# if GIMP_CHECK_VERSION(1,1,9) + snprintf(mpath, sizeof(mpath), "%s", XSANE_GIMP_MENU_DIALOG); +-# else ++# else + snprintf(mpath, sizeof(mpath), "%s", XSANE_GIMP_MENU_DIALOG_OLD); ++# endif + # endif + #else + snprintf(mpath, sizeof(mpath), "%s", XSANE_GIMP_MENU_DIALOG_OLD); +@@ -6660,6 +6664,11 @@ static void xsane_gimp_query(void) + GIMP_EXTENSION, + nargs, nreturn_vals, + args, return_vals); ++#ifdef GIMP_CHECK_VERSION ++# if GIMP_CHECK_VERSION(2,10,30) ++ gimp_plugin_menu_register(name, XSANE_GIMP_MENU); ++# endif ++#endif + + sane_init(&xsane.sane_backend_versioncode, (void *) xsane_authorization_callback); + if (SANE_VERSION_MAJOR(xsane.sane_backend_versioncode) != SANE_V_MAJOR) +@@ -6689,10 +6698,14 @@ static void xsane_gimp_query(void) + } + + #ifdef GIMP_CHECK_VERSION +-# if GIMP_CHECK_VERSION(1,1,9) +- snprintf(mpath, sizeof(mpath), "%s", XSANE_GIMP_MENU); ++# if GIMP_CHECK_VERSION(2,10,30) ++ mpath[0] = 0; + # else ++# if GIMP_CHECK_VERSION(1,1,9) ++ snprintf(mpath, sizeof(mpath), "%s", XSANE_GIMP_MENU); ++# else + snprintf(mpath, sizeof(mpath), "%s", XSANE_GIMP_MENU_OLD); ++# endif + # endif + #else + snprintf(mpath, sizeof(mpath), "%s", XSANE_GIMP_MENU_OLD); +@@ -6722,6 +6735,11 @@ static void xsane_gimp_query(void) + GIMP_EXTENSION, + nargs, nreturn_vals, + args, return_vals); ++#ifdef GIMP_CHECK_VERSION ++# if GIMP_CHECK_VERSION(2,10,30) ++ gimp_plugin_menu_register(name, XSANE_GIMP_MENU); ++# endif ++#endif + } + + sane_exit(); +diff -up xsane-0.999/src/xsane-text.h.use-register xsane-0.999/src/xsane-text.h +--- xsane-0.999/src/xsane-text.h.use-register 2024-08-27 17:26:05.383925749 +0200 ++++ xsane-0.999/src/xsane-text.h 2024-08-27 17:28:08.811758730 +0200 +@@ -873,6 +873,7 @@ The format of [DEVICE] is backendname:de + #define XSANE_GIMP_INSTALL_HELP _("This function provides access to scanners and other image acquisition devices through the SANE (Scanner Access Now Easy) interface.") + + /* Menu path must not be translated, this is done by the gimp. Only translate the text behind the last "/" */ ++#define XSANE_GIMP_MENU_DIALOG_NEW _("Device dialog...") + #define XSANE_GIMP_MENU_DIALOG _("/File/Acquire/XSane: Device dialog...") + #define XSANE_GIMP_MENU _("/File/Acquire/XSane: ") + #define XSANE_GIMP_MENU_DIALOG_OLD _("/Xtns/XSane/Device dialog...") diff --git a/SOURCES/xsane-256x256.png b/SOURCES/xsane-256x256.png new file mode 100644 index 0000000..608d63a Binary files /dev/null and b/SOURCES/xsane-256x256.png differ diff --git a/SOURCES/xsane-configure-c99.patch b/SOURCES/xsane-configure-c99.patch new file mode 100644 index 0000000..75e6cff --- /dev/null +++ b/SOURCES/xsane-configure-c99.patch @@ -0,0 +1,36 @@ +Avoid implicit function declarations, for improved compatibility with +future compilers. + +Fixed upstream via: + +commit 562008027f343127d70bae44457cf8f06c666428 +Author: Ralph Little +Date: Thu Aug 29 21:49:08 2019 -0700 + + m4/sane.m4: remove m4/sane.m4 and update aclocal.m4 to suit. + + We are now using pkg-config and it is pretty much a one-liner. + No point in a whole file in m4 for just this feature. + +diff -up xsane-0.999/configure.c99 xsane-0.999/configure +--- xsane-0.999/configure.c99 2023-01-17 17:11:53.179785420 +0100 ++++ xsane-0.999/configure 2023-01-17 17:11:58.234735290 +0100 +@@ -6672,6 +6672,7 @@ else + + #include + #include ++#include + + int + main () +diff -up xsane-0.999/m4/sane.m4.c99 xsane-0.999/m4/sane.m4 +--- xsane-0.999/m4/sane.m4.c99 2023-01-17 17:11:08.940224113 +0100 ++++ xsane-0.999/m4/sane.m4 2023-01-17 17:11:11.565198082 +0100 +@@ -44,6 +44,7 @@ dnl + AC_TRY_RUN([ + #include + #include ++#include + + int + main () diff --git a/SPECS/xsane.spec b/SPECS/xsane.spec index 2eddcee..ac6589c 100644 --- a/SPECS/xsane.spec +++ b/SPECS/xsane.spec @@ -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 - 0.999-42 -- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags - Related: rhbz#1991688 +* Sun Jan 12 2025 Arkady L. Shane - 0.999-76 +- Rebuilt for MSVSphere 10 -* Fri Apr 16 2021 Mohan Boddu - 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 - 0.999-75 +- Drop GIMP plugin for Fedora >= 41 + +* Thu Aug 29 2024 Nils Philippsen - 0.999-73 +- Use https bugzilla URL + +* Tue Aug 27 2024 Zdenek Dohnal - 0.999-70 +- Use procedure registration for the plugin + +* Mon Aug 19 2024 Nils Philippsen - 0.999-69 +- Rebuild against new gimp + +* Fri Jul 26 2024 Benjamin Gilbert - 0.999-52 +- Require gdk-pixbuf2-modules-extra on F41+ to fix crash (rhbz#2276661) + +* Sat Jul 20 2024 Fedora Release Engineering - 0.999-51 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Sat Jan 27 2024 Fedora Release Engineering - 0.999-50 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Nov 23 2023 Zdenek Dohnal - 0.999-49 +- add license for gimp library - used in plugin which we build it in Fedora because + +* Wed Jul 26 2023 Zdenek Dohnal - 0.999-48 +- SPDX migration + +* Sat Jul 22 2023 Fedora Release Engineering - 0.999-47 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Wed Jul 19 2023 Josef Ridky - 0.999-46 +- Migrate to SPDX license format + +* Sat Jan 21 2023 Fedora Release Engineering - 0.999-45 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Jan 17 2023 Florian Weimer - 0.999-44 +- Port configure script to C99 + +* Sat Jul 23 2022 Fedora Release Engineering - 0.999-43 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Sat Jan 22 2022 Fedora Release Engineering - 0.999-42 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 0.999-41 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Thu Jan 28 2021 Fedora Release Engineering - 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 - 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 - 0.999-12 @@ -850,3 +925,5 @@ fi * Thu Apr 22 1999 Preston Brown - initial RPM for PowerTools 6.0 + +## END: Generated by rpmautospec