Browse Source

updated 4 packages

geeqie-1.5.1-1

lcms2-2.9-2

sane-1.0.29-1

xsane-0.999-3

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@12394 ec354946-7b23-47d6-9f5a-488ba84defc7
tomop 3 years ago
parent
commit
a3a0cd3b8f
4 changed files with 369 additions and 104 deletions
  1. 33 17
      g/geeqie/geeqie-vl.spec
  2. 10 7
      l/lcms2/lcms2-vl.spec
  3. 117 34
      s/sane/sane-vl.spec
  4. 209 46
      x/xsane/xsane-vl.spec

+ 33 - 17
g/geeqie/geeqie-vl.spec

@@ -1,38 +1,43 @@
 Summary: Geeqie Image Viewer
 Summary(ja): Geeqie 画像ビューア
 Name: geeqie
-Version: 1.3
+Version: 1.5.1
 Release: 1%{?_dist_release}
-License: GPL2
 Group: Applications/Multimedia
-URL: http://geeqie.sourceforge.net/
-Source: %{name}-%{version}.tar.xz
-Source1: %{name}-1.0-2.1-ja.po
-Buildroot: %{_tmppath}/%{name}-%{version}-root
-
-BuildRequires: gtk2-devel >= 2.16.0
-BuildRequires: lcms-devel >= 1.14
-BuildRequires: exiv2-devel >= 0.18.1
-
 Vendor: Project Vine
 Distribution: Vine Linux
 Packager:TANAKA hiroaki
 
+License: GPL2
+URL: http://www.geeqie.org/
+Source: http://www.geeqie.org/%{name}-%{version}.tar.xz
+
+Buildroot: %{_tmppath}/%{name}-%{version}-root
+
+BuildRequires: exiv2-devel
+BuildRequires: gtk3-devel
+BuildRequires: lcms2-devel
+BuildRequires: poppler-devel
+
 %description
 Geeqie is a lightweight Gtk+ based image viewer.
 
 %description -l ja
 Geeqie は gtk+ ベースの軽量な画像ファイルブラウザです。
 
+
 %prep
 %setup -q -n %{name}-%{version}
-%__cp -f %{SOURCE1} po/ja.po
+
 
 %build
 ./autogen.sh
-%configure
+%configure \
+	--enable-gtk3 \
+	--enable-pdf
 %__make %{?_smp_mflags}
 
+
 %install
 %__rm -rf $RPM_BUILD_ROOT
 
@@ -40,19 +45,30 @@ Geeqie は gtk+ ベースの軽量な画像ファイルブラウザです。
 
 mv $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} installed-doc
 
+%find_lang %{name}
+
 %clean
 %__rm -rf ${RPM_BUILD_ROOT}
 
-%files
+
+%files -f %{name}.lang
 %defattr(-,root,root)
-%doc README COPYING TODO ChangeLog
+%license COPYING
+%doc README* TODO
 %doc installed-doc/html
 %{_bindir}/*
-%{_datadir}/*
-%{_prefix}/lib/%{name}/*
+%{_prefix}/lib/%{name}
+%{_mandir}/man1/*
+%{_datadir}/applications/geeqie.desktop
+%{_datadir}/%{name}
+%{_datadir}/pixmaps/*
 
 
 %changelog
+* Mon May 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.5.1-1
+- new upstream release.
+- dropped old ja.po.
+
 * Thu Jun 30 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.3-1
 - new upstream release.
 

+ 10 - 7
l/lcms2/lcms2-vl.spec

@@ -4,21 +4,20 @@ Name:           lcms2
 Summary:        Color Management Engine
 Summary(ja):    カラーマネージメントエンジン
 Version:        2.9
-Release:        1%{?_dist_release}
-
+Release:        2%{?_dist_release}
 Group:          System Environment/Libraries
+Vendor:         Project Vine
+Distribution:   Vine Linux
+
 License:        MIT
 URL:            http://www.littlecms.com/
-
-Source0:        http://www.littlecms.com/%{name}-%{version}.tar.gz
+Source0:        https://github.com/mm2/Little-CMS/archive/lcms%{version}.tar.gz#/%{name}-%{version}.tar.gz
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-root
 BuildRequires:  libjpeg-devel
 BuildRequires:  libtiff-devel
 BuildRequires:  zlib-devel
 
-Vendor: Project Vine
-Distribution: Vine Linux
 
 %description
 LittleCMS intends to be a small-footprint, speed optimized color management
@@ -96,7 +95,8 @@ rm -rf ${RPM_BUILD_ROOT}
 
 %files
 %defattr(-,root,root,-)
-%doc AUTHORS COPYING
+%license COPYING
+%doc AUTHORS
 %{_libdir}/*.so.*
 
 %files utils
@@ -123,6 +123,9 @@ rm -rf ${RPM_BUILD_ROOT}
 
 
 %changelog
+* Mon May 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2.9-2
+- rebuilt with current environment.
+
 * Fri Dec 15 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2.9-1
 - new upstream release.
 

+ 117 - 34
s/sane/sane-vl.spec

@@ -1,40 +1,55 @@
+%bcond_with systemd
+
 # To make src.rpm
 # rpm -bs --define 'src:1'
 # To make nosrc.rpm
 # rpm -bs --define 'nosrc:1'
 
+%{?!_udevhwdbdir:%global _udevhwdbdir /etc/udev/hwdb.d}
+%{?!_udevrulesdir:%global _udevrulesdir /lib/udev/rules.d}
+
 %define build_html 0
 
 Summary:	SANE -- Easy local and networked scanner access
 Summary(ja):	スキャナ操作ツール
 Name:		sane
-Version:	1.0.25
-Release:	1%{?_dist_release}
+Version:	1.0.29
+Release:	1%{?_dist_release}%{?with_systemd:.systemd}
+Group:		Applications/Multimedia
+Vendor:		Project Vine
+Distribution:	Vine Linux
+
+License:	GPL (programs), relaxed LGPL (libraries), and public domain (docs)
 URL:		http://www.sane-project.org/
-Source:		ftp://ftp.sane-project.org/pub/sane/%{name}-backends-%{version}.tar.gz
-Source10:       sane-hierarchy.png
-Patch0:		sane-1.0.24-vine.patch
+Source:		https://gitlab.com/sane-project/backends/uploads/54f858b20a364fc35d820df935a86478/sane-backends-%{version}.tar.gz
+Source1:	saned.xinetd
+Source2:	saned.socket
+Source3:	saned@.service.in
+Source5:	66-saned.rules
+Source10:	sane-hierarchy.png
 %{?nosrc:NoSource: 0}
-License:	GPL (programs), relaxed LGPL (libraries), and public domain (docs)
-Group:		Applications/Multimedia
 #Icon:		sane-logo.png
 Provides:	libsane.so.1 sane-backends
 
+BuildRoot: 	%{_tmppath}/%{name}-%{version}-root
 BuildRequires:  sed
 BuildRequires:  libjpeg-devel
 BuildRequires:  libusb1-devel
 BuildRequires:  libgphoto2-devel
 #BuildPrereq:    latex2html
 #BuildPrereq: emacs/or/xemacs pLaTeX2e/or/tetex-latex pTeX/or/tetex
-Buildroot: 	%{_tmppath}/%{name}-%{version}-root
+%if %{with systemd}
+BuildRequires: systemd-devel
+BuildRequires: systemd
+%{?systemd_requires}
+%else
+Requires: xinetd
+%endif
 
 %{?nosrc:%define src 1} 
 %{?src:%define _src 1}
 %{?!src:%define _src 0}
 
-Vendor: Project Vine
-Distribution: Vine Linux
-
 %description
 SANE (Scanner Access Now Easy) is a sane and simple interface
 to both local and networked scanners and other image acquisition devices
@@ -83,14 +98,35 @@ Static libraries and header files for writing SANE modules.
 SANE のモジュールを書くための、ヘッダファイルと静的ライブラリ
 です。
 
+
+%debug_package
+
+
 %prep
-%setup -q -n %{name}-backends-%{version}
-%patch0 -p1 -b .vine
+%setup -q -n sane-backends-%{version}
+
 
 %build
-%configure --with-gnu-ld --enable-static --enable-libusb_1_0
-# don't set smp flags!
-make
+%configure \
+	--enable-static \
+	--with-usb \
+	--with-gphoto2=%{_prefix} \
+%if %{with systemd}
+	--with-systemd \
+%endif
+	--disable-locking \
+	--disable-rpath \
+	--enable-pthread
+
+make %{?_smp_mflags}
+
+# Write udev/hwdb files
+_topdir="$PWD"
+pushd tools
+./sane-desc -m udev+hwdb -s "${_topdir}/doc/descriptions:${_topdir}/doc/descriptions-external" -d0 > udev/sane-backends.rules
+./sane-desc -m hwdb -s "${_topdir}/doc/descriptions:${_topdir}/doc/descriptions-external" -d0 > udev/sane-backends.hwdb
+
+popd
 
 # dll.conf: comment out all lines
 # epson.conf: add example for usb scanner
@@ -115,10 +151,11 @@ echo "#usb /dev/usb/scanner0" >> epson.conf
 [ -d doc/html ] || %__mkdir doc/html
 %endif
 
+
 %install
 %__rm -rf $RPM_BUILD_ROOT
 %{__make} install DESTDIR=${RPM_BUILD_ROOT}
-%__mv $RPM_BUILD_ROOT%{_sbindir}/saned $RPM_BUILD_ROOT%{_sbindir}/in.saned
+ln -sf saned $RPM_BUILD_ROOT%{_sbindir}/in.saned
 %__install -m755 tools/xerox $RPM_BUILD_ROOT%{_bindir}
 %__install -m755 tools/umax_pp $RPM_BUILD_ROOT%{_bindir}
 %__cp tools/README README.tools
@@ -138,46 +175,78 @@ cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf << EOF
 %{_libdir}/%{name}
 EOF
 
+mkdir -p %{buildroot}%{_udevrulesdir}
+mkdir -p %{buildroot}%{_udevhwdbdir}
+install -m 0644 tools/udev/sane-backends.rules %{buildroot}%{_udevrulesdir}/65-sane-backends.rules
+install -m 0644 tools/udev/sane-backends.hwdb %{buildroot}%{_udevhwdbdir}/20-sane-backends.hwdb
+install -m 0644 %{SOURCE5} %{buildroot}%{_udevrulesdir}/66-saned.rules
+
+%if %{with systemd}
+install -m 755 -d %{buildroot}%{_unitdir}
+install -m 644 %{SOURCE2} %{buildroot}%{_unitdir}
+sed 's|@CONFIGDIR@|%{_sysconfdir}/sane.d|g' < %{SOURCE3} > saned@.service
+install -m 644 saned@.service %{buildroot}%{_unitdir}
+%else
+mkdir -p %{buildroot}%{_sysconfdir}/xinetd.d
+install -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/xinetd.d/saned
+%endif
+
+rm -rf ./pkgdoc
+cp -rf %{buildroot}/%{_docdir}/sane-backends ./pkgdoc
+rm -rf %{buildroot}/%{_docdir}/sane-backends
+
 # clear uninstall files
 %__rm -rf $RPM_BUILD_ROOT%{_prefix}/doc
 %__rm -rf $RPM_BUILD_ROOT%{_libdir}/lib*.la
 %__rm -rf $RPM_BUILD_ROOT%{_libdir}/sane/lib*.la
 
+%find_lang sane-backends
 
-%post
-/sbin/ldconfig
 
-[ -d /dev/usb ] || %__mkdir /dev/usb
-[ -c /dev/usb/scanner0 ] || mknod /dev/usb/scanner0 c 180 48 -m 777
+%pre
+getent group saned >/dev/null || groupadd -r saned
+getent passwd saned >/dev/null || \
+    useradd -r -g saned -d %{_datadir}/sane -s /sbin/nologin \
+                -c "SANE scanner daemon user" saned
+exit 0
 
+%post
+/sbin/ldconfig
+udevadm hwdb --update >/dev/null 2>&1 || :
+%if %{with systemd}
+%systemd_post saned.socket
+%else
 # network settings
 SERVICES=%{_sysconfdir}/services
 if [ -x "%__grep" -a -f "$SERVICES" ] ; then
 %__grep -q "^sane" $SERVICES || \
 echo "sane          6566/tcp       # network sccaner deamon" >> $SERVICES
 fi
-INETDCONF=%{_sysconfdir}/inetd.conf 
-if [ -x "%__grep" -a -f "$INETDCONF" ] ; then
-%__grep -q "^#*sane" $INETDCONF || \
-echo "#sane    stream  tcp     nowait  root    %{_sbindir}/in.saned   %{_sbindir}/in.saned" >>   $INETDCONF
-fi
-#kill -HUP `/sbin/pidof inetd`
+%endif
+
+%if %{with systemd}
+%preun
+%systemd_preun saned.socket
+%endif
 
-%postun -p /sbin/ldconfig
+%postun
+/sbin/ldconfig
+udevadm hwdb --update >/dev/null 2>&1 || :
+%if %{with systemd}
+%systemd_postun_with_restart saned.socket
+%endif
 
 
 %clean
 %__rm -rf $RPM_BUILD_ROOT
 
-%files
+%files -f sane-backends.lang
 %defattr(-,root,root)
-%doc README* AUTHORS ChangeLog* COPYING LICENSE PROBLEMS PROJECTS NEWS
-%doc doc/figs doc/icons doc/canon doc/mustek doc/mustek_usb doc/umax
+%license COPYING LICENSE
+%doc pkgdoc/*
 %if %{build_html}
 %doc doc/html
 %endif
-%doc doc/*.{txt,tex,sty}
-%doc tools
 %dir %{_sysconfdir}/sane.d
 %config %{_sysconfdir}/sane.d/*
 %config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
@@ -198,7 +267,15 @@ fi
 %{_mandir}/man5/*.5*
 %{_mandir}/man7/*.7*
 %{_mandir}/man8/*.8*
-%{_datadir}/locale
+%{_udevhwdbdir}/20-sane-backends.hwdb
+%{_udevrulesdir}/65-sane-backends.rules
+%{_udevrulesdir}/66-saned.rules
+%if %{with systemd}
+%{_unitdir}/saned.socket
+%{_unitdir}/saned@.service
+%else
+%{_sysconfdir}/xinetd.d/saned
+%endif
 
 %files devel
 %defattr(-,root,root)
@@ -209,6 +286,12 @@ fi
 %{_libdir}/sane/lib*.a
 
 %changelog
+* Mon May 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.29-1
+- new upstream release.
+- dropped Patch0.
+- added xinetd support.
+- added systemd support (disabled as default).
+
 * Wed May 18 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.25-1
 - new upstream release.
 - replace BR:libusb with BR:libusb1.

+ 209 - 46
x/xsane/xsane-vl.spec

@@ -1,24 +1,90 @@
 %define gimpdirs %(/bin/ls -d %{_libdir}/gimp/*/plug-ins 2> /dev/null)
+%global gimpplugindir %(gimptool --gimpplugindir 2>/dev/null || echo INVALID)/plug-ins
+%global iconrootdir %{_datadir}/icons/hicolor
+
+# needed for off-root building
+%global _configure ../configure
+
 Name: xsane
 Summary: XSane is a graphical frontend for scanners. It uses the library SANE.
-Summary: SANE スキャナインタフェースの Xウィンドウ用フロントエンドです
+Summary(ja): SANE スキャナインタフェースの Xウィンドウ用フロントエンドです
 Version: 0.999
-Release: 2%{?_dist_release}
-Source: http://www.xsane.org/download/%{name}-%{version}.tar.gz
-%{?nosrc:NoSource:     0}
+Release: 3%{?_dist_release}
+Group: Applications/Multimedia
+Vendor: Project Vine
+Distribution: Vine Linux
+
 License: GPL
 URL: http://www.xsane.org/
-Group: Applications/Multimedia
+Source: http://www.xsane.org/download/%{name}-%{version}.tar.gz
+Source1: xsane-256x256.png
+# use "xdg-open" instead of "netscape" to launch help browser
+# submitted to upstream (Oliver Rauch) via email, 2013-06-04
+Patch0: xsane-0.995-xdg-open.patch
+# submitted to upstream (Oliver Rauch) via email, 2009-08-18
+Patch1: xsane-0.995-close-fds.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=504344
+# distro-specific(?), upstream won't accept it: "don't show license dialog"
+# submitted to upstream (Oliver Rauch) anyway via email, 2013-06-04
+Patch2: xsane-0.996-no-eula.patch
+# enable off-root building
+# submitted to upstream (Oliver Rauch) via email, 2010-06-23
+Patch3: xsane-0.997-off-root-build.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=608047
+# https://bugzilla.redhat.com/show_bug.cgi?id=621778
+# submitted to upstream (Oliver Rauch) via email, 2013-07-05
+Patch4: xsane-0.999-no-file-selected.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=198422
+# submitted to upstream (Oliver Rauch) via email, 2010-06-29
+Patch5: xsane-0.997-ipv6.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=624190
+# fix from: https://bugs.launchpad.net/ubuntu/+source/xsane/+bug/370818
+# submitted to upstream (Oliver Rauch) via email, 2011-06-01
+Patch6: xsane-0.998-preview-selection.patch
+# fix building with libpng >= 1.5
+# submitted to upstream (Oliver Rauch) via email, 2011-11-21
+Patch7: xsane-0.998-libpng.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=795085
+# set program name/wmclass so GNOME shell picks appropriate high resolution
+# icon file
+# submitted to upstream (Oliver Rauch) via email, 2013-06-04
+Patch8: xsane-0.998-wmclass.patch
+# partly distro-specific: customize desktop file
+# submitted to upstream (Oliver Rauch) via email, 2013-06-04
+Patch9: xsane-0.998-desktop-file.patch
+# man page: update command line options
+# submitted to upstream (Oliver Rauch) via email, 2013-07-08
+Patch10: xsane-0.999-man-page.patch
+# avoid producing PDFs with bpp > 8
+# submitted to upstream (Oliver Rauch) via email, 2013-09-09
+Patch11: xsane-0.999-pdf-no-high-bpp.patch
+# build against lcms 2.x
+# submitted to upstream (Oliver Rauch) via email, 2013-09-23
+Patch12: xsane-0.999-lcms2.patch
+# fix issues found during static analysis that don't require far-reaching
+# refactoring
+# submitted to upstream (Oliver Rauch) via email, 2014-04-02
+Patch13: xsane-0.999-coverity.patch
+# update lib/snprintf.c to the latest version from LPRng that has a Free license
+# submitted to upstream (Oliver Rauch) via email, 2014-05-29
+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
+
+# autoconf-generated files
+Patch100: xsane-0.999-7-autoconf.patch.bz2
+
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
-Requires: sane >= 1.0.0, gtk2, glib2, atk, pango, zlib 
-BuildRequires: sane-devel, gtk2-devel, atk-devel, pango-devel 
-BuildRequires: gimp >= 1.3.23
-BuildRequires: libjpeg-devel, libpng-devel, libtiff-devel,zlib-devel
-BuildRequires: lcms-devel
-BuildRequires: sed, glibc-common
+BuildRequires: sane-devel
 BuildRequires: gimp-devel
-
-Patch0:	xsane-0.999-libpng.patch
+BuildRequires: lcms2-devel
+BuildRequires: libjpeg-devel
+BuildRequires: libpng-devel
+BuildRequires: desktop-file-utils >= 0.2.92
+BuildRequires: libtiff-devel
+BuildRequires: gettext-devel
+Requires: hicolor-icon-theme
 
 %description
 Xsane is a grahical frontend for sane. Install this if you want a grahpical
@@ -30,44 +96,74 @@ XSane は、多くのスキャナ、デジタルカメラ、その他の画像
 XSane は GTK+ で書かれ、画像取り込みや取込み画像の操作を行うことができま
 す。
 
+
 %prep
 %setup -q
-%patch0 -p1 -b .libpng
-
-# correct some links in html documents
-cd doc
-DOCFILE=sane-backends-doc.html
-cat ${DOCFILE} | sed 's,/usr/local/share,%{_datadir},' > ${DOCFILE}.new
-[ -f  ${DOCFILE}.new ] && mv -f ${DOCFILE}.new ${DOCFILE}
-DOCFILE=sane-xsane-gimp-doc.html
-cat ${DOCFILE} | sed 's,/usr/local/bin,%{_bindir},' > ${DOCFILE}.new
-[ -f  ${DOCFILE}.new ] && mv -f ${DOCFILE}.new ${DOCFILE}
-ICONFILE=sane-logo2.jpg
-[ -f %{_datadir}/sane/${ICONFILE} ] && cp %{_datadir}/sane/${ICONFILE} ./
+
+# convert some files to UTF-8
+for doc in xsane.{CHANGES,PROBLEMS,INSTALL}; do
+    iconv -f ISO-8859-1 -t utf8 "$doc" -o "$doc.new" && \
+    touch -r "$doc" "$doc.new" && \
+    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
+
+# in-root config.h breaks off-root building
+rm include/config.h
+
+mkdir build-with-gimp
+mkdir build-without-gimp
+
 
 %build
-%configure
-%{__make} %{?_smp_mflags}
+CFLAGS='%optflags -fno-strict-aliasing'
+export CFLAGS
+
+pushd build-with-gimp
+%configure --enable-gimp
+make %{?_smp_mflags}
+popd
+
+pushd build-without-gimp
+%configure --disable-gimp
+make
+popd
+
+cp %{SOURCE1} src/
+
 
 %install
 %__rm -rf $RPM_BUILD_ROOT
-%{__make} install DESTDIR=${RPM_BUILD_ROOT}
+pushd build-without-gimp
+make DESTDIR=%{buildroot} install
+popd
 
-cp src/*.xpm $RPM_BUILD_ROOT%{_datadir}/sane/%{name}
-
-if (echo "%{gimpdirs}" | grep -q plug-ins) ;then
-	for D in %{gimpdirs} ; do
-		mkdir -p $RPM_BUILD_ROOT${D}
-		%__ln_s -f %{_bindir}/xsane $RPM_BUILD_ROOT${D}/xsane
-	done
-fi
+# install GIMP plugin
+install -m 0755 -d %{buildroot}%{gimpplugindir}
+install -m 0755 build-with-gimp/src/xsane %{buildroot}%{gimpplugindir}
 
-# prepare applnk
-%define applnkdir /etc/X11/applnk/Graphics
-%define icondir %{_datadir}/sane/%{name}
+# install customized desktop file
+rm %{buildroot}%{_datadir}/applications/xsane.desktop
 
-mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
-cat > $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop <<EOF
+cat > src/xsane.desktop <<EOF
 [Desktop Entry]
 Encoding=UTF-8
 Name=XSane
@@ -76,28 +172,95 @@ Comment=Scanner program
 Comment[ja]=スキャナを操作するツールです
 Terminal=false
 Type=Application
-Icon=%{icondir}/xsane-48x48.xpm
+Icon=%{iconrootdir}/48x48/apps/xsane.png
 Exec=xsane 
-MultipleArgs=false
+X-MultipleArgs=false
 Categories=Application;Graphics;
 EOF
 
+desktop-file-install \
+    --dir %{buildroot}%{_datadir}/applications \
+    src/xsane.desktop
+
+# icon files in multiple resolutions
+for res in 16 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
+
+# Register as an application to be visible in the software center
+#
+# NOTE: It would be *awesome* if this file was maintained by the upstream
+# project, translated and installed into the right place during `make install`.
+#
+# See http://www.freedesktop.org/software/appstream/docs/ for more details.
+#
+
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata
+cat > $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml <<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2014 Ryan Lerch <rlerch@redhat.com> -->
+<!--
+EmailAddress: Oliver.Rauch@xsane.org
+SentUpstream: 2014-09-17
+-->
+<application>
+  <id type="desktop">xsane.desktop</id>
+  <metadata_license>CC0-1.0</metadata_license>
+  <summary>Scan images with a scanner</summary>
+  <description>
+    <p>
+      XSane is an application to scan images using a hardware scanner attached
+      to your computer.
+      It is able to save in a variety of image formats, including TIFF and JPEG
+      and can even save your scan as a PDF.
+      XSane also has support for scanning multiple pages and merging them into
+      a single document.
+    </p>
+  </description>
+  <url type="homepage">http://www.xsane.org/</url>
+  <screenshots>
+    <screenshot type="default">http://www.xsane.org/doc/xsane-save.jpg</screenshot>
+  </screenshots>
+</application>
+EOF
+
 %find_lang %{name}
 
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+
+%pre
+# remove obsolete gimp-plugin-mgr managed symlink
+if [ -L "%{gimpplugindir}/xsane" ]; then
+    rm -f "%{gimpplugindir}/xsane"
+fi
+
+
 %files -f %{name}.lang
 %defattr(-,root,root)
-%doc xsane.*
+%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}/*
 %{_mandir}/*/*
+%dir %{_datadir}/sane
 %{_datadir}/sane/*
-%{_libdir}/gimp/*/plug-ins/*
+%{gimpplugindir}/xsane
+%{_datadir}/appdata/%{name}.appdata.xml
+%{_datadir}/applications/xsane.desktop
 %{_datadir}/pixmaps/xsane.xpm
-%config(missingok) %{_datadir}/applications/*
+%{iconrootdir}/*/apps/%{name}.png
+
 
 %changelog
+* Mon May 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.999-3
+- rebuilt with lcms2.
+- dropped Patch0.
+- imported patches from rawhide.
+
 * Mon Feb 09 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.999-2
 - rebuild with libgphoto2-2.5.7
 - add BuildRequires: lcms-devel