sane-vl.spec 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. %bcond_with systemd
  2. # To make src.rpm
  3. # rpm -bs --define 'src:1'
  4. # To make nosrc.rpm
  5. # rpm -bs --define 'nosrc:1'
  6. %{?!_udevhwdbdir:%global _udevhwdbdir /etc/udev/hwdb.d}
  7. %{?!_udevrulesdir:%global _udevrulesdir /lib/udev/rules.d}
  8. %define build_html 0
  9. Summary: SANE -- Easy local and networked scanner access
  10. Summary(ja): スキャナ操作ツール
  11. Name: sane
  12. Version: 1.0.32
  13. Release: 1%{?_dist_release}%{?with_systemd:.systemd}
  14. Group: multimedia
  15. Vendor: Project Vine
  16. Distribution: Vine Linux
  17. License: GPL (programs), relaxed LGPL (libraries), and public domain (docs)
  18. URL: http://www.sane-project.org/
  19. Source: https://gitlab.com/sane-project/backends/uploads/104f09c07d35519cc8e72e604f11643f/sane-backends-1.0.32.tar.gz
  20. Source1: saned.xinetd
  21. Source2: saned.socket
  22. Source3: saned@.service.in
  23. Source5: 66-saned.rules
  24. Source10: sane-hierarchy.png
  25. %{?nosrc:NoSource: 0}
  26. #Icon: sane-logo.png
  27. Provides: libsane.so.1 sane-backends
  28. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  29. BuildRequires: sed
  30. BuildRequires: libjpeg-devel
  31. BuildRequires: libpng-devel
  32. BuildRequires: libtiff-devel
  33. BuildRequires: libusb1-devel
  34. #BuildPrereq: latex2html
  35. #BuildPrereq: emacs/or/xemacs pLaTeX2e/or/tetex-latex pTeX/or/tetex
  36. %if %{with systemd}
  37. BuildRequires: systemd-devel
  38. BuildRequires: systemd
  39. %{?systemd_requires}
  40. %else
  41. Requires: xinetd
  42. %endif
  43. %{?nosrc:%define src 1}
  44. %{?src:%define _src 1}
  45. %{?!src:%define _src 0}
  46. %description
  47. SANE (Scanner Access Now Easy) is a sane and simple interface
  48. to both local and networked scanners and other image acquisition devices
  49. like digital still and video cameras. SANE currently includes modules for
  50. accessing a range of scanners, including models from Agfa SnapScan, Apple,
  51. Artec, Canon, CoolScan, Epson, HP, Microtek, Mustek, Nikon, Siemens,
  52. Tamarack, UMAX, Connectix, QuickCams and other SANE devices via network.
  53. This package also include a client program 'scanimage','sane-find-scanner',
  54. 'xerox' and etc.
  55. For the latest information on SANE, the SANE standard definition, and
  56. mailing list access, see http://www.mostang.com/sane/
  57. %if %{_src}
  58. You need xemacs or emacs to build this package.
  59. And you need latex2html to build this package if you like html documents.
  60. %endif
  61. %description -l ja
  62. SANE (Scanner Access Now Easy) はローカル/ネットワーク・スキャナや
  63. デジタルカメラ、デジタルビデオカメラなど画像取り込み装置の簡単なイン
  64. ターフェースです。SANE は Agfa SnapScan, Apple, Artec, Canon, CoolScan,
  65. Epson, HP, Microtek, Mustek, Nikon, Siemens, Tamarack, UMAX, Connectix,
  66. QuickCams その他、いろいろなスキャナを使うことができます。
  67. コマンドラインで動くscanimage, sane-find-scanner, xeroxなどもこのパッケージに
  68. 含まれています。
  69. %if %{_src}
  70. このソースパッケージからビルドするにはxemacsまたはemacsが必要です。
  71. またHTMLドキュメントを含めるにはlatex2htmlが必要です。
  72. %endif
  73. %package devel
  74. Summary: SANE (Scanner Access Now Easy) development toolkit
  75. Summary(ja): SANE (Scanner Access Now Easy) 開発ツールキット
  76. Group: programming
  77. Requires: %{name} = %{version}
  78. Requires: pkgconfig
  79. Requires: libgphoto2-devel
  80. Requires: libexif-devel
  81. Requires: libusb1-devel
  82. %description devel
  83. Static libraries and header files for writing SANE modules.
  84. %description devel -l ja
  85. SANE のモジュールを書くための、ヘッダファイルと静的ライブラリ
  86. です。
  87. %debug_package
  88. %prep
  89. %setup -q -n sane-backends-%{version}
  90. %build
  91. %configure \
  92. --enable-static \
  93. --with-usb \
  94. --with-gphoto2=%{_prefix} \
  95. %if %{with systemd}
  96. --with-systemd \
  97. %endif
  98. --disable-locking \
  99. --disable-rpath \
  100. --enable-pthread
  101. make %{?_smp_mflags}
  102. # Write udev/hwdb files
  103. _topdir="$PWD"
  104. pushd tools
  105. ./sane-desc -m udev+hwdb -s "${_topdir}/doc/descriptions:${_topdir}/doc/descriptions-external" -d0 > udev/sane-backends.rules
  106. ./sane-desc -m hwdb -s "${_topdir}/doc/descriptions:${_topdir}/doc/descriptions-external" -d0 > udev/sane-backends.hwdb
  107. popd
  108. # dll.conf: comment out all lines
  109. # epson.conf: add example for usb scanner
  110. ( cd backend
  111. cat dll.conf | %__sed "s/^\([^#]\)/#\1/" > dll.conf~
  112. %__mv -f dll.conf~ dll.conf
  113. echo "#usb /dev/usb/scanner0" >> epson.conf
  114. )
  115. %if %{build_html}
  116. ( cd doc
  117. %__make html
  118. %__mv sane html
  119. cd html
  120. %__cp -f %{SOURCE10} img1.png
  121. %__cat node10.html | \
  122. %__sed 's/WIDTH="5.." HEIGHT="2"/WIDTH="500" HEIGHT="246"/' \
  123. > node10.html~
  124. %__mv -f node10.html~ node10.html
  125. %__rm -f WARNINGS
  126. )
  127. [ -d doc/html ] || %__mkdir doc/html
  128. %endif
  129. %install
  130. %__rm -rf $RPM_BUILD_ROOT
  131. %{__make} install DESTDIR=${RPM_BUILD_ROOT}
  132. ln -sf saned $RPM_BUILD_ROOT%{_sbindir}/in.saned
  133. %__install -m755 tools/xerox $RPM_BUILD_ROOT%{_bindir}
  134. %__install -m755 tools/umax_pp $RPM_BUILD_ROOT%{_bindir}
  135. %__cp tools/README README.tools
  136. %__mkdir_p $RPM_BUILD_ROOT%{_datadir}/%{name}
  137. %if %{build_html}
  138. %__cp doc/*.html doc/*.png doc/*.jpg $RPM_BUILD_ROOT%{_datadir}/%{name}
  139. ##%__mv doc/*.html doc/*.png doc/*.jpg doc/html
  140. %endif
  141. pushd $RPM_BUILD_ROOT%{_bindir}
  142. %__ln_s sane-find-scanner find-scanner
  143. popd
  144. # Create ld.so.conf.d entry
  145. mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
  146. cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf << EOF
  147. %{_libdir}/%{name}
  148. EOF
  149. mkdir -p %{buildroot}%{_udevrulesdir}
  150. mkdir -p %{buildroot}%{_udevhwdbdir}
  151. install -m 0644 tools/udev/sane-backends.rules %{buildroot}%{_udevrulesdir}/65-sane-backends.rules
  152. install -m 0644 tools/udev/sane-backends.hwdb %{buildroot}%{_udevhwdbdir}/20-sane-backends.hwdb
  153. install -m 0644 %{SOURCE5} %{buildroot}%{_udevrulesdir}/66-saned.rules
  154. %if %{with systemd}
  155. install -m 755 -d %{buildroot}%{_unitdir}
  156. install -m 644 %{SOURCE2} %{buildroot}%{_unitdir}
  157. sed 's|@CONFIGDIR@|%{_sysconfdir}/sane.d|g' < %{SOURCE3} > saned@.service
  158. install -m 644 saned@.service %{buildroot}%{_unitdir}
  159. %else
  160. mkdir -p %{buildroot}%{_sysconfdir}/xinetd.d
  161. install -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/xinetd.d/saned
  162. %endif
  163. rm -rf ./pkgdoc
  164. cp -rf %{buildroot}/%{_docdir}/sane-backends ./pkgdoc
  165. rm -rf %{buildroot}/%{_docdir}/sane-backends
  166. # clear uninstall files
  167. %__rm -rf $RPM_BUILD_ROOT%{_prefix}/doc
  168. %__rm -rf $RPM_BUILD_ROOT%{_libdir}/lib*.la
  169. %__rm -rf $RPM_BUILD_ROOT%{_libdir}/sane/lib*.la
  170. %find_lang sane-backends
  171. %pre
  172. getent group saned >/dev/null || groupadd -r saned
  173. getent passwd saned >/dev/null || \
  174. useradd -r -g saned -d %{_datadir}/sane -s /sbin/nologin \
  175. -c "SANE scanner daemon user" saned
  176. exit 0
  177. %post
  178. udevadm hwdb --update >/dev/null 2>&1 || :
  179. %if %{with systemd}
  180. %systemd_post saned.socket
  181. %else
  182. # network settings
  183. SERVICES=%{_sysconfdir}/services
  184. if [ -x "%__grep" -a -f "$SERVICES" ] ; then
  185. %__grep -q "^sane" $SERVICES || \
  186. echo "sane 6566/tcp # network sccaner deamon" >> $SERVICES
  187. fi
  188. %endif
  189. %if %{with systemd}
  190. %preun
  191. %systemd_preun saned.socket
  192. %endif
  193. %postun
  194. udevadm hwdb --update >/dev/null 2>&1 || :
  195. %if %{with systemd}
  196. %systemd_postun_with_restart saned.socket
  197. %endif
  198. %clean
  199. %__rm -rf $RPM_BUILD_ROOT
  200. %files -f sane-backends.lang
  201. %defattr(-,root,root)
  202. %license COPYING LICENSE
  203. %doc pkgdoc/*
  204. %if %{build_html}
  205. %doc doc/html
  206. %endif
  207. %dir %{_sysconfdir}/sane.d
  208. %config %{_sysconfdir}/sane.d/*
  209. %config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
  210. %{_sbindir}/*
  211. %{_bindir}/find-scanner
  212. %{_bindir}/gamma4scanimage
  213. %{_bindir}/sane-find-scanner
  214. %{_bindir}/scanimage
  215. %{_bindir}/umax_pp
  216. %{_bindir}/xerox
  217. %{_libdir}/lib*.so.*
  218. %{_libdir}/lib*.so
  219. %{_libdir}/sane/lib*.so.*
  220. %{_libdir}/sane/lib*.so
  221. %dir %{_libdir}/sane
  222. %{_datadir}/sane
  223. %{_mandir}/man1/*.1*
  224. %{_mandir}/man5/*.5*
  225. %{_mandir}/man7/*.7*
  226. %{_mandir}/man8/*.8*
  227. %{_udevhwdbdir}/20-sane-backends.hwdb
  228. %{_udevrulesdir}/65-sane-backends.rules
  229. %{_udevrulesdir}/66-saned.rules
  230. %if %{with systemd}
  231. %{_unitdir}/saned.socket
  232. %{_unitdir}/saned@.service
  233. %else
  234. %{_sysconfdir}/xinetd.d/saned
  235. %endif
  236. %files devel
  237. %defattr(-,root,root)
  238. %{_bindir}/sane-config
  239. %{_includedir}/sane
  240. %{_libdir}/pkgconfig/sane-backends.pc
  241. %{_libdir}/lib*.a
  242. %{_libdir}/sane/lib*.a
  243. %changelog
  244. * Wed Nov 03 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.32-1
  245. - new upstream release.
  246. - dropped ldconfig scriptlets.
  247. * Thu Jul 09 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.30-1
  248. - new upstream release.
  249. * Mon May 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.29-1
  250. - new upstream release.
  251. - dropped Patch0.
  252. - added xinetd support.
  253. - added systemd support (disabled as default).
  254. * Wed May 18 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.25-1
  255. - new upstream release.
  256. - replace BR:libusb with BR:libusb1.
  257. * Mon Feb 09 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.24-2
  258. - rebuild with libgphoto2-2.5.7
  259. * Sun Feb 01 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.24-1
  260. - update to 1.0.24
  261. - update Patch0 (sane-1.0.24-vine.patch)
  262. - remove Patch1 (sane-backends-1.0.21-i18n.patch)
  263. - fix %%post and %%postun (fix BTS:2514)
  264. * Fri Jan 11 2013 IWAI, Masaharu <iwai@alib.jp> 1.0.21-2
  265. - build with libghoto2 2.5.0-1
  266. - stop generating HTML manual: missing man2html(1) in current VineSeed
  267. - add Vendor and Distribution tags
  268. * Sun Jul 25 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.21-1
  269. - new upstream release
  270. - change Patch (from sane-1.0.15-vine.patch to sane-1.0.21-vine.patch)
  271. - move sane-config to devel package
  272. - add Requires: libjpeg-devel, libgphoto2-devel, libexif-devel, libusb-devel (devel package)
  273. - add Patch1(sane-backends-1.0.21-i18n.patch)
  274. * Sun Oct 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0.18-3
  275. - added BuildRequires: libgphoto2-devel instead of ghoto2-devel
  276. * Sat Oct 11 2008 Shu KONNO <owa@bg.wakwak.com> 1.0.18-2
  277. - spec in utf-8
  278. * Mon May 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0.18-1
  279. - applied new versioning policy
  280. - removed lib*.la files from devel package
  281. * Mon Dec 24 2007 Shu KONNO <owa@bg.wakwak.com> 1.0.18-0vl1
  282. - new upstream release
  283. * Sun Jan 09 2005 Satoshi MACHINO <machino@vinelinux.org> 1.0.15-0vl1
  284. - new upstream version(sane-1.0.15)
  285. - fixed spec file
  286. -- cleaned up patches
  287. -- added Requires: libjpeg, libusb
  288. -- added BuildRequires: glibc, libjpeg-devel, libusb-devel
  289. * Fri Oct 25 2002 Tomoya TAKA <taka@vinelinux.org> 1.0.8-0vl1
  290. - new upstream release
  291. - update sane-1.0.8-vine.patch
  292. - add --enable-static option to %%configure
  293. * Mon May 13 2002 Masaki Shinomiya <shino@pos.to>
  294. - 1.0.7-0vl2: sparc.patch, ppc.patch both from Mandrake(4mdk)
  295. - informed by Iohara [VinePlus:01130]
  296. * Thu Apr 4 2002 Masaki Shinomiya <shino@pos.to>
  297. - 1.0.7-0vl1 for Vine Linux-2.x
  298. - 1.0.7-0.1
  299. - set %_sysconfdir to /etc for RedHat6.x/Vine2.x
  300. * Wed Mar 6 2002 Masaki SHINOMIYA <shino@pos.to>
  301. - 1.0.7-0
  302. - new source
  303. - avoid listing %{_libdir}/sane from sane-devel
  304. - add LEVEL2 in doc
  305. * Fri Feb 1 2002 Masaki SHINOMIYA <shino@pos.to>
  306. - 1.0.6-0.3
  307. - allow to build without latex2html
  308. - prereq ldconfig, buildprereq sed, provide sane-backends
  309. * Sun Dec 23 2001 Masaki SHINOMIYA <shino@pos.to>
  310. - 1.0.6-0.2
  311. - dll.conf, epson.conf, network settings
  312. * Tue Dec 18 2001 Masaki SHINOMIYA <shino@pos.to>
  313. - 1.0.6-0.1
  314. - new source
  315. * Mon Dec 17 2001 Masaki SHINOMIYA <shino@pos.to>
  316. - 1.0.5-1.3
  317. - allow to use emacs or xemacs in building
  318. - nosrc
  319. #* Wed Oct 3 2001 Masaki SHINOMIYA <shino@pos.to>
  320. #- 1.0.5-1.2
  321. #- surpress swapping R<-->G colors on EPSON GT-8700/Perfection1640
  322. #- ( information from [vine-users:037559] tyu <tyu@mbd.nifty.com> )
  323. #- omit doc/*.tex etc.
  324. * Tue Sep 18 2001 Masaki SHINOMIYA <shino@pos.to>
  325. - 1.0.5-1.1
  326. - use emacs instead of xemacs in building
  327. * Sat Jul 7 2001 Masaki SHINOMIYA <shino@pos.to>
  328. - 1.0.5-1
  329. * Thu Jun 7 2001 Masaki SHINOMIYA <shino@pos.to>
  330. - 1.0.4 + epson backend ver.20010519
  331. - sane-clients is removed from this package
  332. - scanimage, find-scanner and xerox are left in this package
  333. * Thu May 17 2001 Masaki SHINOMIYA <shino@pos.to>
  334. - 1.0.4 + epson backend ver.20010331
  335. - 'scanimage' is included in the binary'sane-1.0.4-1.i386.rpm'package.
  336. - refined script for gimp plug-in setup
  337. - html documents shal be installed in the directory '/usr/share/sane'
  338. - automatically make device the file /dev/usb/scanner0
  339. * Wed Nov 15 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
  340. - 1.0.3-0vl8
  341. - included missing "sane-config" script for sane
  342. * Tue Oct 17 2000 Jun Nishii <jun@vinelinux.org>
  343. - 1.0.3-0vl7
  344. - merge xscanimage patch
  345. * Mon Oct 16 2000 Jun Nishii <jun@vinelinux.org>
  346. - 1.0.3-0vl6
  347. - build with gimp-1.1.27
  348. * Sun Oct 1 2000 Jun Nishii <jun@vinelinux.org>
  349. - 1.0.3-0vl5
  350. - fixed group
  351. * Sat Sep 30 2000 Jun Nishii <jun@vinelinux.org>
  352. - 1.0.3-0vl4
  353. - added %defattr in clients
  354. * Tue Sep 26 2000 Jun Nishii <jun@vinelinux.org>
  355. - 1.0.3-0vl3
  356. - build with gimp-1.1.26
  357. * Mon Sep 25 2000 Jun Nishii <jun@vinelinux.org>
  358. - 1.0.3-0vl2
  359. - build with gimp-1.1.25
  360. * Thu Sep 21 2000 Jun Nishii <jun@vinelinux.org>
  361. - 1.0.3-0vl1
  362. * Thu Jun 8 2000 Jun Nishii <jun@vinelinux.org>
  363. - 1.0.2-0vl1
  364. * Mon Jan 17 2000 Jun Nishii <jun@vinelinux.org>
  365. - build for Vine Linux 2.0
  366. - added find-scanner, xerox
  367. * Fri Apr 23 1999 Hugo van der Kooij <hvdkooij@caiw.nl>
  368. - Fixed packaging a bit.
  369. * Wed Apr 21 1999 Hugo van der Kooij <hvdkooij@caiw.nl>
  370. - Updated package to 1.01
  371. * Fri Apr 09 1999 Hugo van der Kooij <hvdkooij@caiw.nl>
  372. - Split off the clients
  373. - Fixed a Alpha system anomaly by removing the specific backend.
  374. * Mon Nov 23 1998 Jonathan Miller <jlm@mvhi.com>
  375. [1.00-1]
  376. - upgraded to 1.00 (and made description less space-consuming)
  377. - included the post 1.00 fixed "configure" script available 22 Nov 1998.
  378. * Sat Aug 08 1998 Arne Coucheron <arneco@online.no>
  379. [0.74-3]
  380. - added /etc/sane.d to %dir in file list
  381. * Sat Aug 01 1998 Arne Coucheron <arneco@online.no>
  382. [0.74-2]
  383. - devel Group: reverted back to Development/Libraries
  384. - some changes to the %defattr and %attr usage in file list
  385. * Tue Jul 28 1998 Binaire <binaire@binaire.ml.org>
  386. [0.74-1]
  387. * Fri May 22 1998 Arne Coucheron <arneco@online.no>
  388. [0.73-3]
  389. - added use of %%{name} and %%{version} macros
  390. - added a %postun for running ldconfig after uninstall
  391. - using BuildRoot properly now
  392. - using %defattr and %attr macros in filelist, allows non-root build
  393. this means that RPM 2.5 is required to build this spec file now!
  394. - devel Group: changed to X11/Libraries
  395. - added using RPM_OPT_FLAGS during make
  396. - added striping of programs and libraries
  397. - added Requires: gtk+ >= 0.99.13 to main package
  398. - added Requires: %%{name} = %%{version} to devel package
  399. - added a %clean section for removing the buildroot dir
  400. - simplified the filelist and added %config for sane-style.rc
  401. - moved lib*.so to %files devel and dropped the *.la files
  402. - added -q parameter to %setup
  403. - removed some older changelog entries
  404. - removed the "fix ldconfig brokenness..." stuff
  405. - removed the Packager: line; use /etc/rpmrc if you want your name in
  406. - if GIMP is installed, make symlink from xscanimage to plug-ins dir
  407. - install the find-scanner program from the tools dir
  408. * Mon May 18 1998 Hugo van der Kooij <hvdkooij@caiw.nl>
  409. - Version 0.73 was created: May 13 1998
  410. - gimp (original was build against 0.99.29)
  411. - gtk+ (original was build against 1.0.1)
  412. - dlh (original was build against 0.7d)
  413. - X11 development tree including xpm libraries.
  414. * Wed Apr 22 1998 Hugo van der Kooij <hvdkooij@caiw.nl>
  415. - Binaries are now BuildRoot proof.
  416. * Wed Apr 22 1998 Hugo van der Kooij <hvdkooij@caiw.nl>
  417. - Binaries are not BuildRoot proof. release 3 is done without BuildRoot!
  418. * Tue Apr 21 1998 Hugo van der Kooij <hvdkooij@caiw.nl>
  419. - Temp. fix for some documentations problems with BuildRoot.
  420. * Sat Apr 11 1998 Hugo van der Kooij <hvdkooij@caiw.nl>
  421. - Formal 0.72 now made as RPM! (Build against GTK+ 0.99.10 and GIMP 0.99.24)
  422. - Original package was released: Tue Apr 7 1998