sane-vl.spec 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  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.30
  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/c3dd60c9e054b5dee1e7b01a7edc98b0/sane-backends-1.0.30.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. * Thu Jul 09 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.30-1
  247. - new upstream release.
  248. * Mon May 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.29-1
  249. - new upstream release.
  250. - dropped Patch0.
  251. - added xinetd support.
  252. - added systemd support (disabled as default).
  253. * Wed May 18 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.25-1
  254. - new upstream release.
  255. - replace BR:libusb with BR:libusb1.
  256. * Mon Feb 09 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.24-2
  257. - rebuild with libgphoto2-2.5.7
  258. * Sun Feb 01 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.24-1
  259. - update to 1.0.24
  260. - update Patch0 (sane-1.0.24-vine.patch)
  261. - remove Patch1 (sane-backends-1.0.21-i18n.patch)
  262. - fix %%post and %%postun (fix BTS:2514)
  263. * Fri Jan 11 2013 IWAI, Masaharu <iwai@alib.jp> 1.0.21-2
  264. - build with libghoto2 2.5.0-1
  265. - stop generating HTML manual: missing man2html(1) in current VineSeed
  266. - add Vendor and Distribution tags
  267. * Sun Jul 25 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.21-1
  268. - new upstream release
  269. - change Patch (from sane-1.0.15-vine.patch to sane-1.0.21-vine.patch)
  270. - move sane-config to devel package
  271. - add Requires: libjpeg-devel, libgphoto2-devel, libexif-devel, libusb-devel (devel package)
  272. - add Patch1(sane-backends-1.0.21-i18n.patch)
  273. * Sun Oct 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0.18-3
  274. - added BuildRequires: libgphoto2-devel instead of ghoto2-devel
  275. * Sat Oct 11 2008 Shu KONNO <owa@bg.wakwak.com> 1.0.18-2
  276. - spec in utf-8
  277. * Mon May 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0.18-1
  278. - applied new versioning policy
  279. - removed lib*.la files from devel package
  280. * Mon Dec 24 2007 Shu KONNO <owa@bg.wakwak.com> 1.0.18-0vl1
  281. - new upstream release
  282. * Sun Jan 09 2005 Satoshi MACHINO <machino@vinelinux.org> 1.0.15-0vl1
  283. - new upstream version(sane-1.0.15)
  284. - fixed spec file
  285. -- cleaned up patches
  286. -- added Requires: libjpeg, libusb
  287. -- added BuildRequires: glibc, libjpeg-devel, libusb-devel
  288. * Fri Oct 25 2002 Tomoya TAKA <taka@vinelinux.org> 1.0.8-0vl1
  289. - new upstream release
  290. - update sane-1.0.8-vine.patch
  291. - add --enable-static option to %%configure
  292. * Mon May 13 2002 Masaki Shinomiya <shino@pos.to>
  293. - 1.0.7-0vl2: sparc.patch, ppc.patch both from Mandrake(4mdk)
  294. - informed by Iohara [VinePlus:01130]
  295. * Thu Apr 4 2002 Masaki Shinomiya <shino@pos.to>
  296. - 1.0.7-0vl1 for Vine Linux-2.x
  297. - 1.0.7-0.1
  298. - set %_sysconfdir to /etc for RedHat6.x/Vine2.x
  299. * Wed Mar 6 2002 Masaki SHINOMIYA <shino@pos.to>
  300. - 1.0.7-0
  301. - new source
  302. - avoid listing %{_libdir}/sane from sane-devel
  303. - add LEVEL2 in doc
  304. * Fri Feb 1 2002 Masaki SHINOMIYA <shino@pos.to>
  305. - 1.0.6-0.3
  306. - allow to build without latex2html
  307. - prereq ldconfig, buildprereq sed, provide sane-backends
  308. * Sun Dec 23 2001 Masaki SHINOMIYA <shino@pos.to>
  309. - 1.0.6-0.2
  310. - dll.conf, epson.conf, network settings
  311. * Tue Dec 18 2001 Masaki SHINOMIYA <shino@pos.to>
  312. - 1.0.6-0.1
  313. - new source
  314. * Mon Dec 17 2001 Masaki SHINOMIYA <shino@pos.to>
  315. - 1.0.5-1.3
  316. - allow to use emacs or xemacs in building
  317. - nosrc
  318. #* Wed Oct 3 2001 Masaki SHINOMIYA <shino@pos.to>
  319. #- 1.0.5-1.2
  320. #- surpress swapping R<-->G colors on EPSON GT-8700/Perfection1640
  321. #- ( information from [vine-users:037559] tyu <tyu@mbd.nifty.com> )
  322. #- omit doc/*.tex etc.
  323. * Tue Sep 18 2001 Masaki SHINOMIYA <shino@pos.to>
  324. - 1.0.5-1.1
  325. - use emacs instead of xemacs in building
  326. * Sat Jul 7 2001 Masaki SHINOMIYA <shino@pos.to>
  327. - 1.0.5-1
  328. * Thu Jun 7 2001 Masaki SHINOMIYA <shino@pos.to>
  329. - 1.0.4 + epson backend ver.20010519
  330. - sane-clients is removed from this package
  331. - scanimage, find-scanner and xerox are left in this package
  332. * Thu May 17 2001 Masaki SHINOMIYA <shino@pos.to>
  333. - 1.0.4 + epson backend ver.20010331
  334. - 'scanimage' is included in the binary'sane-1.0.4-1.i386.rpm'package.
  335. - refined script for gimp plug-in setup
  336. - html documents shal be installed in the directory '/usr/share/sane'
  337. - automatically make device the file /dev/usb/scanner0
  338. * Wed Nov 15 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
  339. - 1.0.3-0vl8
  340. - included missing "sane-config" script for sane
  341. * Tue Oct 17 2000 Jun Nishii <jun@vinelinux.org>
  342. - 1.0.3-0vl7
  343. - merge xscanimage patch
  344. * Mon Oct 16 2000 Jun Nishii <jun@vinelinux.org>
  345. - 1.0.3-0vl6
  346. - build with gimp-1.1.27
  347. * Sun Oct 1 2000 Jun Nishii <jun@vinelinux.org>
  348. - 1.0.3-0vl5
  349. - fixed group
  350. * Sat Sep 30 2000 Jun Nishii <jun@vinelinux.org>
  351. - 1.0.3-0vl4
  352. - added %defattr in clients
  353. * Tue Sep 26 2000 Jun Nishii <jun@vinelinux.org>
  354. - 1.0.3-0vl3
  355. - build with gimp-1.1.26
  356. * Mon Sep 25 2000 Jun Nishii <jun@vinelinux.org>
  357. - 1.0.3-0vl2
  358. - build with gimp-1.1.25
  359. * Thu Sep 21 2000 Jun Nishii <jun@vinelinux.org>
  360. - 1.0.3-0vl1
  361. * Thu Jun 8 2000 Jun Nishii <jun@vinelinux.org>
  362. - 1.0.2-0vl1
  363. * Mon Jan 17 2000 Jun Nishii <jun@vinelinux.org>
  364. - build for Vine Linux 2.0
  365. - added find-scanner, xerox
  366. * Fri Apr 23 1999 Hugo van der Kooij <hvdkooij@caiw.nl>
  367. - Fixed packaging a bit.
  368. * Wed Apr 21 1999 Hugo van der Kooij <hvdkooij@caiw.nl>
  369. - Updated package to 1.01
  370. * Fri Apr 09 1999 Hugo van der Kooij <hvdkooij@caiw.nl>
  371. - Split off the clients
  372. - Fixed a Alpha system anomaly by removing the specific backend.
  373. * Mon Nov 23 1998 Jonathan Miller <jlm@mvhi.com>
  374. [1.00-1]
  375. - upgraded to 1.00 (and made description less space-consuming)
  376. - included the post 1.00 fixed "configure" script available 22 Nov 1998.
  377. * Sat Aug 08 1998 Arne Coucheron <arneco@online.no>
  378. [0.74-3]
  379. - added /etc/sane.d to %dir in file list
  380. * Sat Aug 01 1998 Arne Coucheron <arneco@online.no>
  381. [0.74-2]
  382. - devel Group: reverted back to Development/Libraries
  383. - some changes to the %defattr and %attr usage in file list
  384. * Tue Jul 28 1998 Binaire <binaire@binaire.ml.org>
  385. [0.74-1]
  386. * Fri May 22 1998 Arne Coucheron <arneco@online.no>
  387. [0.73-3]
  388. - added use of %%{name} and %%{version} macros
  389. - added a %postun for running ldconfig after uninstall
  390. - using BuildRoot properly now
  391. - using %defattr and %attr macros in filelist, allows non-root build
  392. this means that RPM 2.5 is required to build this spec file now!
  393. - devel Group: changed to X11/Libraries
  394. - added using RPM_OPT_FLAGS during make
  395. - added striping of programs and libraries
  396. - added Requires: gtk+ >= 0.99.13 to main package
  397. - added Requires: %%{name} = %%{version} to devel package
  398. - added a %clean section for removing the buildroot dir
  399. - simplified the filelist and added %config for sane-style.rc
  400. - moved lib*.so to %files devel and dropped the *.la files
  401. - added -q parameter to %setup
  402. - removed some older changelog entries
  403. - removed the "fix ldconfig brokenness..." stuff
  404. - removed the Packager: line; use /etc/rpmrc if you want your name in
  405. - if GIMP is installed, make symlink from xscanimage to plug-ins dir
  406. - install the find-scanner program from the tools dir
  407. * Mon May 18 1998 Hugo van der Kooij <hvdkooij@caiw.nl>
  408. - Version 0.73 was created: May 13 1998
  409. - gimp (original was build against 0.99.29)
  410. - gtk+ (original was build against 1.0.1)
  411. - dlh (original was build against 0.7d)
  412. - X11 development tree including xpm libraries.
  413. * Wed Apr 22 1998 Hugo van der Kooij <hvdkooij@caiw.nl>
  414. - Binaries are now BuildRoot proof.
  415. * Wed Apr 22 1998 Hugo van der Kooij <hvdkooij@caiw.nl>
  416. - Binaries are not BuildRoot proof. release 3 is done without BuildRoot!
  417. * Tue Apr 21 1998 Hugo van der Kooij <hvdkooij@caiw.nl>
  418. - Temp. fix for some documentations problems with BuildRoot.
  419. * Sat Apr 11 1998 Hugo van der Kooij <hvdkooij@caiw.nl>
  420. - Formal 0.72 now made as RPM! (Build against GTK+ 0.99.10 and GIMP 0.99.24)
  421. - Original package was released: Tue Apr 7 1998