xsane-vl.spec 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. %define gimpdirs %(/bin/ls -d %{_libdir}/gimp/*/plug-ins 2> /dev/null)
  2. %global gimpplugindir %(gimptool --gimpplugindir 2>/dev/null || echo INVALID)/plug-ins
  3. %global iconrootdir %{_datadir}/icons/hicolor
  4. # needed for off-root building
  5. %global _configure ../configure
  6. Name: xsane
  7. Summary: XSane is a graphical frontend for scanners. It uses the library SANE.
  8. Summary(ja): SANE スキャナインタフェースの Xウィンドウ用フロントエンドです
  9. Version: 0.999
  10. Release: 3%{?_dist_release}
  11. Group: Applications/Multimedia
  12. Vendor: Project Vine
  13. Distribution: Vine Linux
  14. License: GPL
  15. URL: http://www.xsane.org/
  16. Source: http://www.xsane.org/download/%{name}-%{version}.tar.gz
  17. Source1: xsane-256x256.png
  18. # use "xdg-open" instead of "netscape" to launch help browser
  19. # submitted to upstream (Oliver Rauch) via email, 2013-06-04
  20. Patch0: xsane-0.995-xdg-open.patch
  21. # submitted to upstream (Oliver Rauch) via email, 2009-08-18
  22. Patch1: xsane-0.995-close-fds.patch
  23. # https://bugzilla.redhat.com/show_bug.cgi?id=504344
  24. # distro-specific(?), upstream won't accept it: "don't show license dialog"
  25. # submitted to upstream (Oliver Rauch) anyway via email, 2013-06-04
  26. Patch2: xsane-0.996-no-eula.patch
  27. # enable off-root building
  28. # submitted to upstream (Oliver Rauch) via email, 2010-06-23
  29. Patch3: xsane-0.997-off-root-build.patch
  30. # https://bugzilla.redhat.com/show_bug.cgi?id=608047
  31. # https://bugzilla.redhat.com/show_bug.cgi?id=621778
  32. # submitted to upstream (Oliver Rauch) via email, 2013-07-05
  33. Patch4: xsane-0.999-no-file-selected.patch
  34. # https://bugzilla.redhat.com/show_bug.cgi?id=198422
  35. # submitted to upstream (Oliver Rauch) via email, 2010-06-29
  36. Patch5: xsane-0.997-ipv6.patch
  37. # https://bugzilla.redhat.com/show_bug.cgi?id=624190
  38. # fix from: https://bugs.launchpad.net/ubuntu/+source/xsane/+bug/370818
  39. # submitted to upstream (Oliver Rauch) via email, 2011-06-01
  40. Patch6: xsane-0.998-preview-selection.patch
  41. # fix building with libpng >= 1.5
  42. # submitted to upstream (Oliver Rauch) via email, 2011-11-21
  43. Patch7: xsane-0.998-libpng.patch
  44. # https://bugzilla.redhat.com/show_bug.cgi?id=795085
  45. # set program name/wmclass so GNOME shell picks appropriate high resolution
  46. # icon file
  47. # submitted to upstream (Oliver Rauch) via email, 2013-06-04
  48. Patch8: xsane-0.998-wmclass.patch
  49. # partly distro-specific: customize desktop file
  50. # submitted to upstream (Oliver Rauch) via email, 2013-06-04
  51. Patch9: xsane-0.998-desktop-file.patch
  52. # man page: update command line options
  53. # submitted to upstream (Oliver Rauch) via email, 2013-07-08
  54. Patch10: xsane-0.999-man-page.patch
  55. # avoid producing PDFs with bpp > 8
  56. # submitted to upstream (Oliver Rauch) via email, 2013-09-09
  57. Patch11: xsane-0.999-pdf-no-high-bpp.patch
  58. # build against lcms 2.x
  59. # submitted to upstream (Oliver Rauch) via email, 2013-09-23
  60. Patch12: xsane-0.999-lcms2.patch
  61. # fix issues found during static analysis that don't require far-reaching
  62. # refactoring
  63. # submitted to upstream (Oliver Rauch) via email, 2014-04-02
  64. Patch13: xsane-0.999-coverity.patch
  65. # update lib/snprintf.c to the latest version from LPRng that has a Free license
  66. # submitted to upstream (Oliver Rauch) via email, 2014-05-29
  67. Patch14: xsane-0.999-snprintf-update.patch
  68. # fix signal handling (#1073698)
  69. # submitted to upstream (Oliver Rauch) via email, 2014-07-03
  70. Patch15: xsane-0.999-signal-handling.patch
  71. # autoconf-generated files
  72. Patch100: xsane-0.999-7-autoconf.patch.bz2
  73. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  74. BuildRequires: sane-devel
  75. BuildRequires: gimp-devel
  76. BuildRequires: lcms2-devel
  77. BuildRequires: libjpeg-devel
  78. BuildRequires: libpng-devel
  79. BuildRequires: desktop-file-utils >= 0.2.92
  80. BuildRequires: libtiff-devel
  81. BuildRequires: gettext-devel
  82. Requires: hicolor-icon-theme
  83. %description
  84. Xsane is a grahical frontend for sane. Install this if you want a grahpical
  85. frontend for sane for use in the X Windowing System.
  86. %description -l ja
  87. XSane は、多くのスキャナ、デジタルカメラ、その他の画像取り込み装置に対応
  88. した SANE スキャナインタフェースの Xウィンドウ用フロントエンドです。
  89. XSane は GTK+ で書かれ、画像取り込みや取込み画像の操作を行うことができま
  90. す。
  91. %prep
  92. %setup -q
  93. # convert some files to UTF-8
  94. for doc in xsane.{CHANGES,PROBLEMS,INSTALL}; do
  95. iconv -f ISO-8859-1 -t utf8 "$doc" -o "$doc.new" && \
  96. touch -r "$doc" "$doc.new" && \
  97. mv "$doc.new" "$doc"
  98. done
  99. %patch0 -p1 -b .xdg-open
  100. %patch1 -p1 -b .close-fds
  101. %patch2 -p1 -b .no-eula
  102. %patch3 -p1 -b .off-root-build
  103. %patch4 -p1 -b .no-file-selected
  104. %patch5 -p1 -b .ipv6
  105. %patch6 -p1 -b .preview-selection.patch
  106. %patch7 -p1 -b .libpng
  107. %patch8 -p1 -b .wmclass
  108. %patch9 -p1 -b .desktop-file
  109. %patch10 -p1 -b .man-page
  110. %patch11 -p1 -b .pdf-no-high-bpp
  111. %patch12 -p1 -b .lcms2
  112. %patch13 -p1 -b .coverity
  113. %patch14 -p1 -b .snprintf-update
  114. %patch15 -p1 -b .signal-handling
  115. %patch100 -p1 -b .autoconf
  116. # in-root config.h breaks off-root building
  117. rm include/config.h
  118. mkdir build-with-gimp
  119. mkdir build-without-gimp
  120. %build
  121. CFLAGS='%optflags -fno-strict-aliasing'
  122. export CFLAGS
  123. pushd build-with-gimp
  124. %configure --enable-gimp
  125. make %{?_smp_mflags}
  126. popd
  127. pushd build-without-gimp
  128. %configure --disable-gimp
  129. make
  130. popd
  131. cp %{SOURCE1} src/
  132. %install
  133. %__rm -rf $RPM_BUILD_ROOT
  134. pushd build-without-gimp
  135. make DESTDIR=%{buildroot} install
  136. popd
  137. # install GIMP plugin
  138. install -m 0755 -d %{buildroot}%{gimpplugindir}
  139. install -m 0755 build-with-gimp/src/xsane %{buildroot}%{gimpplugindir}
  140. # install customized desktop file
  141. rm %{buildroot}%{_datadir}/applications/xsane.desktop
  142. cat > src/xsane.desktop <<EOF
  143. [Desktop Entry]
  144. Encoding=UTF-8
  145. Name=XSane
  146. Name[ja]=XSane スキャナ操作
  147. Comment=Scanner program
  148. Comment[ja]=スキャナを操作するツールです
  149. Terminal=false
  150. Type=Application
  151. Icon=%{iconrootdir}/48x48/apps/xsane.png
  152. Exec=xsane
  153. X-MultipleArgs=false
  154. Categories=Application;Graphics;
  155. EOF
  156. desktop-file-install \
  157. --dir %{buildroot}%{_datadir}/applications \
  158. src/xsane.desktop
  159. # icon files in multiple resolutions
  160. for res in 16 32 48 256; do
  161. tdir="%{buildroot}%{iconrootdir}/${res}x${res}/apps"
  162. install -m 0755 -d "$tdir"
  163. install -m 0644 src/xsane-${res}x${res}.png "${tdir}/xsane.png"
  164. done
  165. # Register as an application to be visible in the software center
  166. #
  167. # NOTE: It would be *awesome* if this file was maintained by the upstream
  168. # project, translated and installed into the right place during `make install`.
  169. #
  170. # See http://www.freedesktop.org/software/appstream/docs/ for more details.
  171. #
  172. mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata
  173. cat > $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml <<EOF
  174. <?xml version="1.0" encoding="UTF-8"?>
  175. <!-- Copyright 2014 Ryan Lerch <rlerch@redhat.com> -->
  176. <!--
  177. EmailAddress: Oliver.Rauch@xsane.org
  178. SentUpstream: 2014-09-17
  179. -->
  180. <application>
  181. <id type="desktop">xsane.desktop</id>
  182. <metadata_license>CC0-1.0</metadata_license>
  183. <summary>Scan images with a scanner</summary>
  184. <description>
  185. <p>
  186. XSane is an application to scan images using a hardware scanner attached
  187. to your computer.
  188. It is able to save in a variety of image formats, including TIFF and JPEG
  189. and can even save your scan as a PDF.
  190. XSane also has support for scanning multiple pages and merging them into
  191. a single document.
  192. </p>
  193. </description>
  194. <url type="homepage">http://www.xsane.org/</url>
  195. <screenshots>
  196. <screenshot type="default">http://www.xsane.org/doc/xsane-save.jpg</screenshot>
  197. </screenshots>
  198. </application>
  199. EOF
  200. %find_lang %{name}
  201. %clean
  202. rm -rf $RPM_BUILD_ROOT
  203. %pre
  204. # remove obsolete gimp-plugin-mgr managed symlink
  205. if [ -L "%{gimpplugindir}/xsane" ]; then
  206. rm -f "%{gimpplugindir}/xsane"
  207. fi
  208. %files -f %{name}.lang
  209. %defattr(-,root,root)
  210. %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
  211. %license xsane.COPYING
  212. %{_bindir}/*
  213. %{_mandir}/*/*
  214. %dir %{_datadir}/sane
  215. %{_datadir}/sane/*
  216. %{gimpplugindir}/xsane
  217. %{_datadir}/appdata/%{name}.appdata.xml
  218. %{_datadir}/applications/xsane.desktop
  219. %{_datadir}/pixmaps/xsane.xpm
  220. %{iconrootdir}/*/apps/%{name}.png
  221. %changelog
  222. * Mon May 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.999-3
  223. - rebuilt with lcms2.
  224. - dropped Patch0.
  225. - imported patches from rawhide.
  226. * Mon Feb 09 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.999-2
  227. - rebuild with libgphoto2-2.5.7
  228. - add BuildRequires: lcms-devel
  229. * Wed Jan 14 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.999-1
  230. - update to 0.999
  231. - add Patch0 (xsane-0.999-libpng.patch)
  232. * Fri Jan 11 2013 IWAI, Masaharu <iwai@alib.jp> 0.997-2
  233. - build with libgphoto2 2.5.0-1
  234. * Sun Jul 25 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.997-1
  235. - new upstream release
  236. - add BuildRequires: gimp-devel
  237. - remove configure option (--enable-gimp)
  238. - fix %files
  239. * Sat Jul 26 2008 Shu KONNO <owa@bg.wakwak.com> 0.995-1vl5
  240. - applied new versioning policy
  241. - updated script to create %{name}.desktop
  242. * Mon Dec 24 2007 Shu KONNO <owa@bg.wakwak.com> 0.995-0vl1
  243. - new upstream
  244. - updated xsane.desktop
  245. * Sat Jan 08 2005 Satoshi MACHINO <machino@vinelinux.org> 0.96-0vl1
  246. - new upstream version (xsane-0.96)
  247. - fixed spec file
  248. -- cleaned up
  249. -- added Requires: sane >= 1.0.0, gtk2, glib2, atk, pango, zlib
  250. -- added BuildRequires: sane-devel, gtk2-devel, atk-devel, pango-devel
  251. -- added BuildRequires: gimp >= 1.3.23
  252. -- added BuildRequires: libjpeg-devel, libpng-devel, libtiff-devel,zlib-devel
  253. * Fri Oct 25 2002 Tomoya TAKA <taka@vinelinux.org> 0.89-0vl1
  254. - new upstream release
  255. * Mon May 13 2002 Satoshi MACHINO <machino@vinelinux.org> xsane-0.86-0vl1
  256. - updated xsane-0.86
  257. * Thu Apr 4 2002 Masaki Shinomiya <shino@pos.to>
  258. - 0.84-0vl1 for Vine Linux-2.x
  259. - 0.84-0.1
  260. - symlink for gimp listed in %file section
  261. - some html-documents
  262. - set %_sysconfdir to /etc for RedHat6.x/Vine2.x
  263. - RPM Group move to Applications/Multimedia
  264. * Tue Mar 12 2002 Masaki Shinomiya <shino@pos.to>
  265. - 0.84-0
  266. - bugfix in %post script
  267. * Sun Dec 23 2001 Masaki Shinomiya <shino@pos.to>
  268. - 0.82-0.1
  269. - use mocros as possible, nosrc
  270. * Thu Jul 5 2001 Masaki Shinomiya <shino@pos.to>
  271. - 0.79-0test
  272. - remove the patch of the tooltips
  273. * Thu Jul 5 2001 Masaki Shinomiya <shino@pos.to>
  274. - 0.78-1vl2
  275. - fixed script for gimp plug-in setup
  276. * Sat Jun 23 2001 Masaki Shinomiya <shino@pos.to>
  277. - rename for VinePlus. program registoration for gnome
  278. * Tue Jun 19 2001 Masaki Shinomiya <shino@pos.to>
  279. - patch to provide proper fonts for the tooltips
  280. * Thu Jun 14 2001 Masaki Shinomiya <shino@pos.to>
  281. - 0.78-1
  282. - escape confliction of the document file 'sane-pnm-doc.html' with one from SANE
  283. * Sun Jun 3 2001 Masaki Shinomiya <shino@pos.to>
  284. - 0.77-1
  285. * Mon May 21 2001 Masaki Shinomiya <shino@pos.to>
  286. - 0.76-1
  287. - refined script for gimp plug-in setup
  288. * Wed Nov 15 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
  289. - 0.64-0vl1
  290. - updated to 0.64 (hope it'll be compatible with gimp-1.1.27...)
  291. * Mon Oct 16 2000 Jun Nishii <jun@vinelinux.org>
  292. - 0.61-0vl3
  293. - build with gimp-1.1.27
  294. * Mon Sep 25 2000 Jun Nishii <jun@vinelinux.org>
  295. - 0.61-0vl2
  296. - build with gimp-1.1.25
  297. * Thu Sep 21 2000 Jun Nishii <jun@vinelinux.org>
  298. - 0.61-0vl1
  299. * Sat Jan 22 2000 Jun Nishii <jun@vinelinux.org>
  300. - 0.51-0vl1
  301. * Mon Aug 30 1999 Tim Powers <timp@redhat.com>
  302. - changed group
  303. * Mon Jul 26 1999 Tim Powers <timp@redhat.com>
  304. - update to 0.30
  305. - added %defattr
  306. - built for 6.1
  307. * Thu Apr 22 1999 Preston Brown <pbrown@redhat.com>
  308. - initial RPM for PowerTools 6.0