From b33286d407a9635b88f9fa21c4b755f591ded3c5 Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: May 26 2012 10:35:50 +0000 Subject: install and use higher resolution icons (#795085) --- diff --git a/xsane-0.998-wmclass.patch b/xsane-0.998-wmclass.patch new file mode 100644 index 0000000..a12a156 --- /dev/null +++ b/xsane-0.998-wmclass.patch @@ -0,0 +1,33 @@ +From 27f6119af76011d6cbc2e40468a804b6bef31651 Mon Sep 17 00:00:00 2001 +From: Nils Philippsen +Date: Fri, 25 May 2012 11:47:39 +0200 +Subject: [PATCH] patch: wmclass + +Squashed commit of the following: + +commit d42b7a9dbe397a301373e3cbaa589540a1475a0b +Author: Nils Philippsen +Date: Fri May 25 11:45:48 2012 +0200 + + set program name -> wmclass to match desktop file name +--- + src/xsane.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/xsane.c b/src/xsane.c +index 775610e..5177758 100644 +--- a/src/xsane.c ++++ b/src/xsane.c +@@ -6169,6 +6169,9 @@ int main(int argc, char **argv) + xsane.ipc_pipefd[1] = 0; + } + ++ /* Set program name -> wmclass to match desktop file name */ ++ g_set_prgname("xsane"); ++ + #if 0 + bindtextdomain(PACKAGE, STRINGIFY(LOCALEDIR)); + textdomain(PACKAGE); +-- +1.7.10.2 + diff --git a/xsane.spec b/xsane.spec index e963934..ba9e36e 100644 --- a/xsane.spec +++ b/xsane.spec @@ -2,6 +2,7 @@ %global bugtracker_url http://bugzilla.redhat.com %global gimpplugindir %(gimptool --gimpplugindir)/plug-ins +%global iconrootdir %{_datadir}/icons/hicolor # work around old %%configure macro %if ! (0%{?rhel} > 6 || 0%{?fedora} > 12) @@ -14,8 +15,9 @@ Name: xsane Summary: X Window System front-end for the SANE scanner interface Version: 0.998 -Release: 8%{?dist} +Release: 9%{?dist} Source0: http://www.xsane.org/download/%{name}-%{version}.tar.gz +Source1: xsane-256x256.png # distro-specific: use "xdg-open" instead of "netscape" to launch help browser Patch0: xsane-0.995-xdg-open.patch # submitted to upstream (Oliver Rauch) via email, 2009-08-18 @@ -44,6 +46,10 @@ Patch8: xsane-0.998-preview-selection.patch # build with libpng-1.5 # submitted to upstream (Oliver Rauch) via email, 2011-11-21 Patch9: xsane-0.998-libpng.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=795085 +# distro-specific: set program name/wmclass so GNOME shell picks appropriate +# high resolution icon file +Patch10: xsane-0.998-wmclass.patch # autoconf-generated files Patch100: xsane-0.998-1-autoconf.patch.bz2 License: GPLv2+ @@ -58,6 +64,7 @@ BuildRequires: sane-backends-devel >= 1.0.19-15 BuildRequires: desktop-file-utils >= 0.2.92 BuildRequires: libtiff-devel BuildRequires: gettext-devel +BuildRequires: ImageMagick Requires: xsane-common %description @@ -104,6 +111,7 @@ done %patch7 -p1 -b .xsane_update_param-crash %patch8 -p1 -b .preview-selection.patch %patch9 -p1 -b .libpng +%patch10 -p1 -b .wmclass %patch100 -p1 -b .autoconf @@ -127,6 +135,13 @@ pushd build-without-gimp make popd +# Ensure that src/xsane.xpm is 32px high/wide +test "$(identify -format "%wx%h" src/xsane.xpm)" = "32x32" + +convert src/xsane.xpm src/xsane-32x32.png + +cp %{SOURCE1} src/ + %install rm -rf %{buildroot} @@ -144,6 +159,13 @@ desktop-file-install --vendor fedora \ --dir %{buildroot}%{_datadir}/applications \ src/xsane.desktop +# icon files in multiple resolutions +for res in 32 48 256; do + tdir="%{buildroot}%{iconrootdir}/${res}x${res}/apps" + install -m 0755 -d "$tdir" + install -m 0644 src/xsane-${res}x${res}.png "${tdir}/xsane.png" +done + %find_lang %{name} XSANE.lang %clean @@ -162,6 +184,7 @@ fi %{_mandir}/man1/* %{_datadir}/applications/fedora-xsane.desktop %{_datadir}/pixmaps/xsane.xpm +%{iconrootdir} %files gimp %defattr(-,root,root) @@ -174,6 +197,9 @@ fi %{_datadir}/sane/xsane %changelog +* Fri May 25 2012 Nils Philippsen - 0.998-9 +- install and use higher resolution icons (#795085) + * Tue Apr 03 2012 Nils Philippsen - 0.998-8 - rebuild against gimp 2.8.0 release candidate