sane-vl.spec 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  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.29
  13. Release: 1%{?_dist_release}%{?with_systemd:.systemd}
  14. Group: Applications/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/54f858b20a364fc35d820df935a86478/sane-backends-%{version}.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: libusb1-devel
  32. BuildRequires: libgphoto2-devel
  33. #BuildPrereq: latex2html
  34. #BuildPrereq: emacs/or/xemacs pLaTeX2e/or/tetex-latex pTeX/or/tetex
  35. %if %{with systemd}
  36. BuildRequires: systemd-devel
  37. BuildRequires: systemd
  38. %{?systemd_requires}
  39. %else
  40. Requires: xinetd
  41. %endif
  42. %{?nosrc:%define src 1}
  43. %{?src:%define _src 1}
  44. %{?!src:%define _src 0}
  45. %description
  46. SANE (Scanner Access Now Easy) is a sane and simple interface
  47. to both local and networked scanners and other image acquisition devices
  48. like digital still and video cameras. SANE currently includes modules for
  49. accessing a range of scanners, including models from Agfa SnapScan, Apple,
  50. Artec, Canon, CoolScan, Epson, HP, Microtek, Mustek, Nikon, Siemens,
  51. Tamarack, UMAX, Connectix, QuickCams and other SANE devices via network.
  52. This package also include a client program 'scanimage','sane-find-scanner',
  53. 'xerox' and etc.
  54. For the latest information on SANE, the SANE standard definition, and
  55. mailing list access, see http://www.mostang.com/sane/
  56. %if %{_src}
  57. You need xemacs or emacs to build this package.
  58. And you need latex2html to build this package if you like html documents.
  59. %endif
  60. %description -l ja
  61. SANE (Scanner Access Now Easy) はローカル/ネットワーク・スキャナや
  62. デジタルカメラ、デジタルビデオカメラなど画像取り込み装置の簡単なイン
  63. ターフェースです。SANE は Agfa SnapScan, Apple, Artec, Canon, CoolScan,
  64. Epson, HP, Microtek, Mustek, Nikon, Siemens, Tamarack, UMAX, Connectix,
  65. QuickCams その他、いろいろなスキャナを使うことができます。
  66. コマンドラインで動くscanimage, sane-find-scanner, xeroxなどもこのパッケージに
  67. 含まれています。
  68. %if %{_src}
  69. このソースパッケージからビルドするにはxemacsまたはemacsが必要です。
  70. またHTMLドキュメントを含めるにはlatex2htmlが必要です。
  71. %endif
  72. %package devel
  73. Summary: SANE (Scanner Access Now Easy) development toolkit
  74. Summary(ja): SANE (Scanner Access Now Easy) 開発ツールキット
  75. Group: Development/Libraries
  76. Requires: %{name} = %{version}
  77. Requires: pkgconfig
  78. Requires: libjpeg-devel
  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. /sbin/ldconfig
  179. udevadm hwdb --update >/dev/null 2>&1 || :
  180. %if %{with systemd}
  181. %systemd_post saned.socket
  182. %else
  183. # network settings
  184. SERVICES=%{_sysconfdir}/services
  185. if [ -x "%__grep" -a -f "$SERVICES" ] ; then
  186. %__grep -q "^sane" $SERVICES || \
  187. echo "sane 6566/tcp # network sccaner deamon" >> $SERVICES
  188. fi
  189. %endif
  190. %if %{with systemd}
  191. %preun
  192. %systemd_preun saned.socket
  193. %endif
  194. %postun
  195. /sbin/ldconfig
  196. udevadm hwdb --update >/dev/null 2>&1 || :
  197. %if %{with systemd}
  198. %systemd_postun_with_restart saned.socket
  199. %endif
  200. %clean
  201. %__rm -rf $RPM_BUILD_ROOT
  202. %files -f sane-backends.lang
  203. %defattr(-,root,root)
  204. %license COPYING LICENSE
  205. %doc pkgdoc/*
  206. %if %{build_html}
  207. %doc doc/html
  208. %endif
  209. %dir %{_sysconfdir}/sane.d
  210. %config %{_sysconfdir}/sane.d/*
  211. %config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
  212. %{_sbindir}/*
  213. %{_bindir}/find-scanner
  214. %{_bindir}/gamma4scanimage
  215. %{_bindir}/sane-find-scanner
  216. %{_bindir}/scanimage
  217. %{_bindir}/umax_pp
  218. %{_bindir}/xerox
  219. %{_libdir}/lib*.so.*
  220. %{_libdir}/lib*.so
  221. %{_libdir}/sane/lib*.so.*
  222. %{_libdir}/sane/lib*.so
  223. %dir %{_libdir}/sane
  224. %{_datadir}/sane
  225. %{_mandir}/man1/*.1*
  226. %{_mandir}/man5/*.5*
  227. %{_mandir}/man7/*.7*
  228. %{_mandir}/man8/*.8*
  229. %{_udevhwdbdir}/20-sane-backends.hwdb
  230. %{_udevrulesdir}/65-sane-backends.rules
  231. %{_udevrulesdir}/66-saned.rules
  232. %if %{with systemd}
  233. %{_unitdir}/saned.socket
  234. %{_unitdir}/saned@.service
  235. %else
  236. %{_sysconfdir}/xinetd.d/saned
  237. %endif
  238. %files devel
  239. %defattr(-,root,root)
  240. %{_bindir}/sane-config
  241. %{_includedir}/sane
  242. %{_libdir}/pkgconfig/sane-backends.pc
  243. %{_libdir}/lib*.a
  244. %{_libdir}/sane/lib*.a
  245. %changelog
  246. * Mon May 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.29-1
  247. - new upstream release.
  248. - dropped Patch0.
  249. - added xinetd support.
  250. - added systemd support (disabled as default).
  251. * Wed May 18 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.25-1
  252. - new upstream release.
  253. - replace BR:libusb with BR:libusb1.
  254. * Mon Feb 09 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.24-2
  255. - rebuild with libgphoto2-2.5.7
  256. * Sun Feb 01 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.24-1
  257. - update to 1.0.24
  258. - update Patch0 (sane-1.0.24-vine.patch)
  259. - remove Patch1 (sane-backends-1.0.21-i18n.patch)
  260. - fix %%post and %%postun (fix BTS:2514)
  261. * Fri Jan 11 2013 IWAI, Masaharu <iwai@alib.jp> 1.0.21-2
  262. - build with libghoto2 2.5.0-1
  263. - stop generating HTML manual: missing man2html(1) in current VineSeed
  264. - add Vendor and Distribution tags
  265. * Sun Jul 25 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.21-1
  266. - new upstream release
  267. - change Patch (from sane-1.0.15-vine.patch to sane-1.0.21-vine.patch)
  268. - move sane-config to devel package
  269. - add Requires: libjpeg-devel, libgphoto2-devel, libexif-devel, libusb-devel (devel package)
  270. - add Patch1(sane-backends-1.0.21-i18n.patch)
  271. * Sun Oct 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0.18-3
  272. - added BuildRequires: libgphoto2-devel instead of ghoto2-devel
  273. * Sat Oct 11 2008 Shu KONNO <owa@bg.wakwak.com> 1.0.18-2
  274. - spec in utf-8
  275. * Mon May 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0.18-1
  276. - applied new versioning policy
  277. - removed lib*.la files from devel package
  278. * Mon Dec 24 2007 Shu KONNO <owa@bg.wakwak.com> 1.0.18-0vl1
  279. - new upstream release
  280. * Sun Jan 09 2005 Satoshi MACHINO <machino@vinelinux.org> 1.0.15-0vl1
  281. - new upstream version(sane-1.0.15)
  282. - fixed spec file
  283. -- cleaned up patches
  284. -- added Requires: libjpeg, libusb
  285. -- added BuildRequires: glibc, libjpeg-devel, libusb-devel
  286. * Fri Oct 25 2002 Tomoya TAKA <taka@vinelinux.org> 1.0.8-0vl1
  287. - new upstream release
  288. - update sane-1.0.8-vine.patch
  289. - add --enable-static option to %%configure
  290. * Mon May 13 2002 Masaki Shinomiya <shino@pos.to>
  291. - 1.0.7-0vl2: sparc.patch, ppc.patch both from Mandrake(4mdk)
  292. - informed by Iohara [VinePlus:01130]
  293. * Thu Apr 4 2002 Masaki Shinomiya <shino@pos.to>
  294. - 1.0.7-0vl1 for Vine Linux-2.x
  295. - 1.0.7-0.1
  296. - set %_sysconfdir to /etc for RedHat6.x/Vine2.x
  297. * Wed Mar 6 2002 Masaki SHINOMIYA <shino@pos.to>
  298. - 1.0.7-0
  299. - new source
  300. - avoid listing %{_libdir}/sane from sane-devel
  301. - add LEVEL2 in doc
  302. * Fri Feb 1 2002 Masaki SHINOMIYA <shino@pos.to>
  303. - 1.0.6-0.3
  304. - allow to build without latex2html
  305. - prereq ldconfig, buildprereq sed, provide sane-backends
  306. * Sun Dec 23 2001 Masaki SHINOMIYA <shino@pos.to>
  307. - 1.0.6-0.2
  308. - dll.conf, epson.conf, network settings
  309. * Tue Dec 18 2001 Masaki SHINOMIYA <shino@pos.to>
  310. - 1.0.6-0.1
  311. - new source
  312. * Mon Dec 17 2001 Masaki SHINOMIYA <shino@pos.to>
  313. - 1.0.5-1.3
  314. - allow to use emacs or xemacs in building
  315. - nosrc
  316. #* Wed Oct 3 2001 Masaki SHINOMIYA <shino@pos.to>
  317. #- 1.0.5-1.2
  318. #- surpress swapping R<-->G colors on EPSON GT-8700/Perfection1640
  319. #- ( information from [vine-users:037559] tyu <tyu@mbd.nifty.com> )
  320. #- omit doc/*.tex etc.
  321. * Tue Sep 18 2001 Masaki SHINOMIYA <shino@pos.to>
  322. - 1.0.5-1.1
  323. - use emacs instead of xemacs in building
  324. * Sat Jul 7 2001 Masaki SHINOMIYA <shino@pos.to>
  325. - 1.0.5-1
  326. * Thu Jun 7 2001 Masaki SHINOMIYA <shino@pos.to>
  327. - 1.0.4 + epson backend ver.20010519
  328. - sane-clients is removed from this package
  329. - scanimage, find-scanner and xerox are left in this package
  330. * Thu May 17 2001 Masaki SHINOMIYA <shino@pos.to>
  331. - 1.0.4 + epson backend ver.20010331
  332. - 'scanimage' is included in the binary'sane-1.0.4-1.i386.rpm'package.
  333. - refined script for gimp plug-in setup
  334. - html documents shal be installed in the directory '/usr/share/sane'
  335. - automatically make device the file /dev/usb/scanner0
  336. * Wed Nov 15 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
  337. - 1.0.3-0vl8
  338. - included missing "sane-config" script for sane
  339. * Tue Oct 17 2000 Jun Nishii <jun@vinelinux.org>
  340. - 1.0.3-0vl7
  341. - merge xscanimage patch
  342. * Mon Oct 16 2000 Jun Nishii <jun@vinelinux.org>
  343. - 1.0.3-0vl6
  344. - build with gimp-1.1.27
  345. * Sun Oct 1 2000 Jun Nishii <jun@vinelinux.org>
  346. - 1.0.3-0vl5
  347. - fixed group
  348. * Sat Sep 30 2000 Jun Nishii <jun@vinelinux.org>
  349. - 1.0.3-0vl4
  350. - added %defattr in clients
  351. * Tue Sep 26 2000 Jun Nishii <jun@vinelinux.org>
  352. - 1.0.3-0vl3
  353. - build with gimp-1.1.26
  354. * Mon Sep 25 2000 Jun Nishii <jun@vinelinux.org>
  355. - 1.0.3-0vl2
  356. - build with gimp-1.1.25
  357. * Thu Sep 21 2000 Jun Nishii <jun@vinelinux.org>
  358. - 1.0.3-0vl1
  359. * Thu Jun 8 2000 Jun Nishii <jun@vinelinux.org>
  360. - 1.0.2-0vl1
  361. * Mon Jan 17 2000 Jun Nishii <jun@vinelinux.org>
  362. - build for Vine Linux 2.0
  363. - added find-scanner, xerox
  364. * Fri Apr 23 1999 Hugo van der Kooij <hvdkooij@caiw.nl>
  365. - Fixed packaging a bit.
  366. * Wed Apr 21 1999 Hugo van der Kooij <hvdkooij@caiw.nl>
  367. - Updated package to 1.01
  368. * Fri Apr 09 1999 Hugo van der Kooij <hvdkooij@caiw.nl>
  369. - Split off the clients
  370. - Fixed a Alpha system anomaly by removing the specific backend.
  371. * Mon Nov 23 1998 Jonathan Miller <jlm@mvhi.com>
  372. [1.00-1]
  373. - upgraded to 1.00 (and made description less space-consuming)
  374. - included the post 1.00 fixed "configure" script available 22 Nov 1998.
  375. * Sat Aug 08 1998 Arne Coucheron <arneco@online.no>
  376. [0.74-3]
  377. - added /etc/sane.d to %dir in file list
  378. * Sat Aug 01 1998 Arne Coucheron <arneco@online.no>
  379. [0.74-2]
  380. - devel Group: reverted back to Development/Libraries
  381. - some changes to the %defattr and %attr usage in file list
  382. * Tue Jul 28 1998 Binaire <binaire@binaire.ml.org>
  383. [0.74-1]
  384. * Fri May 22 1998 Arne Coucheron <arneco@online.no>
  385. [0.73-3]
  386. - added use of %%{name} and %%{version} macros
  387. - added a %postun for running ldconfig after uninstall
  388. - using BuildRoot properly now
  389. - using %defattr and %attr macros in filelist, allows non-root build
  390. this means that RPM 2.5 is required to build this spec file now!
  391. - devel Group: changed to X11/Libraries
  392. - added using RPM_OPT_FLAGS during make
  393. - added striping of programs and libraries
  394. - added Requires: gtk+ >= 0.99.13 to main package
  395. - added Requires: %%{name} = %%{version} to devel package
  396. - added a %clean section for removing the buildroot dir
  397. - simplified the filelist and added %config for sane-style.rc
  398. - moved lib*.so to %files devel and dropped the *.la files
  399. - added -q parameter to %setup
  400. - removed some older changelog entries
  401. - removed the "fix ldconfig brokenness..." stuff
  402. - removed the Packager: line; use /etc/rpmrc if you want your name in
  403. - if GIMP is installed, make symlink from xscanimage to plug-ins dir
  404. - install the find-scanner program from the tools dir
  405. * Mon May 18 1998 Hugo van der Kooij <hvdkooij@caiw.nl>
  406. - Version 0.73 was created: May 13 1998
  407. - gimp (original was build against 0.99.29)
  408. - gtk+ (original was build against 1.0.1)
  409. - dlh (original was build against 0.7d)
  410. - X11 development tree including xpm libraries.
  411. * Wed Apr 22 1998 Hugo van der Kooij <hvdkooij@caiw.nl>
  412. - Binaries are now BuildRoot proof.
  413. * Wed Apr 22 1998 Hugo van der Kooij <hvdkooij@caiw.nl>
  414. - Binaries are not BuildRoot proof. release 3 is done without BuildRoot!
  415. * Tue Apr 21 1998 Hugo van der Kooij <hvdkooij@caiw.nl>
  416. - Temp. fix for some documentations problems with BuildRoot.
  417. * Sat Apr 11 1998 Hugo van der Kooij <hvdkooij@caiw.nl>
  418. - Formal 0.72 now made as RPM! (Build against GTK+ 0.99.10 and GIMP 0.99.24)
  419. - Original package was released: Tue Apr 7 1998