%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.30 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: https://gitlab.com/sane-project/backends/uploads/c3dd60c9e054b5dee1e7b01a7edc98b0/sane-backends-1.0.30.tar.gz Source1: saned.xinetd Source2: saned.socket Source3: saned@.service.in Source5: 66-saned.rules Source10: sane-hierarchy.png %{?nosrc:NoSource: 0} #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 %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} %description SANE (Scanner Access Now Easy) is a sane and simple interface to both local and networked scanners and other image acquisition devices like digital still and video cameras. SANE currently includes modules for accessing a range of scanners, including models from Agfa SnapScan, Apple, Artec, Canon, CoolScan, Epson, HP, Microtek, Mustek, Nikon, Siemens, Tamarack, UMAX, Connectix, QuickCams and other SANE devices via network. This package also include a client program 'scanimage','sane-find-scanner', 'xerox' and etc. For the latest information on SANE, the SANE standard definition, and mailing list access, see http://www.mostang.com/sane/ %if %{_src} You need xemacs or emacs to build this package. And you need latex2html to build this package if you like html documents. %endif %description -l ja SANE (Scanner Access Now Easy) はローカル/ネットワーク・スキャナや デジタルカメラ、デジタルビデオカメラなど画像取り込み装置の簡単なイン ターフェースです。SANE は Agfa SnapScan, Apple, Artec, Canon, CoolScan, Epson, HP, Microtek, Mustek, Nikon, Siemens, Tamarack, UMAX, Connectix, QuickCams その他、いろいろなスキャナを使うことができます。 コマンドラインで動くscanimage, sane-find-scanner, xeroxなどもこのパッケージに 含まれています。 %if %{_src} このソースパッケージからビルドするにはxemacsまたはemacsが必要です。 またHTMLドキュメントを含めるにはlatex2htmlが必要です。 %endif %package devel Summary: SANE (Scanner Access Now Easy) development toolkit Summary(ja): SANE (Scanner Access Now Easy) 開発ツールキット Group: Development/Libraries Requires: %{name} = %{version} Requires: pkgconfig Requires: libjpeg-devel Requires: libgphoto2-devel Requires: libexif-devel Requires: libusb1-devel %description devel Static libraries and header files for writing SANE modules. %description devel -l ja SANE のモジュールを書くための、ヘッダファイルと静的ライブラリ です。 %debug_package %prep %setup -q -n sane-backends-%{version} %build %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 ( cd backend cat dll.conf | %__sed "s/^\([^#]\)/#\1/" > dll.conf~ %__mv -f dll.conf~ dll.conf echo "#usb /dev/usb/scanner0" >> epson.conf ) %if %{build_html} ( cd doc %__make html %__mv sane html cd html %__cp -f %{SOURCE10} img1.png %__cat node10.html | \ %__sed 's/WIDTH="5.." HEIGHT="2"/WIDTH="500" HEIGHT="246"/' \ > node10.html~ %__mv -f node10.html~ node10.html %__rm -f WARNINGS ) [ -d doc/html ] || %__mkdir doc/html %endif %install %__rm -rf $RPM_BUILD_ROOT %{__make} install DESTDIR=${RPM_BUILD_ROOT} 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 %__mkdir_p $RPM_BUILD_ROOT%{_datadir}/%{name} %if %{build_html} %__cp doc/*.html doc/*.png doc/*.jpg $RPM_BUILD_ROOT%{_datadir}/%{name} ##%__mv doc/*.html doc/*.png doc/*.jpg doc/html %endif pushd $RPM_BUILD_ROOT%{_bindir} %__ln_s sane-find-scanner find-scanner popd # Create ld.so.conf.d entry mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d 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 %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 %endif %if %{with systemd} %preun %systemd_preun saned.socket %endif %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 -f sane-backends.lang %defattr(-,root,root) %license COPYING LICENSE %doc pkgdoc/* %if %{build_html} %doc doc/html %endif %dir %{_sysconfdir}/sane.d %config %{_sysconfdir}/sane.d/* %config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf %{_sbindir}/* %{_bindir}/find-scanner %{_bindir}/gamma4scanimage %{_bindir}/sane-find-scanner %{_bindir}/scanimage %{_bindir}/umax_pp %{_bindir}/xerox %{_libdir}/lib*.so.* %{_libdir}/lib*.so %{_libdir}/sane/lib*.so.* %{_libdir}/sane/lib*.so %dir %{_libdir}/sane %{_datadir}/sane %{_mandir}/man1/*.1* %{_mandir}/man5/*.5* %{_mandir}/man7/*.7* %{_mandir}/man8/*.8* %{_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) %{_bindir}/sane-config %{_includedir}/sane %{_libdir}/pkgconfig/sane-backends.pc %{_libdir}/lib*.a %{_libdir}/sane/lib*.a %changelog * Thu Jul 09 2020 Tomohiro "Tomo-p" KATO 1.0.30-1 - new upstream release. * Mon May 04 2020 Tomohiro "Tomo-p" KATO 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 1.0.25-1 - new upstream release. - replace BR:libusb with BR:libusb1. * Mon Feb 09 2015 Yoji TOYODA 1.0.24-2 - rebuild with libgphoto2-2.5.7 * Sun Feb 01 2015 Yoji TOYODA 1.0.24-1 - update to 1.0.24 - update Patch0 (sane-1.0.24-vine.patch) - remove Patch1 (sane-backends-1.0.21-i18n.patch) - fix %%post and %%postun (fix BTS:2514) * Fri Jan 11 2013 IWAI, Masaharu 1.0.21-2 - build with libghoto2 2.5.0-1 - stop generating HTML manual: missing man2html(1) in current VineSeed - add Vendor and Distribution tags * Sun Jul 25 2010 Yoji TOYODA 1.0.21-1 - new upstream release - change Patch (from sane-1.0.15-vine.patch to sane-1.0.21-vine.patch) - move sane-config to devel package - add Requires: libjpeg-devel, libgphoto2-devel, libexif-devel, libusb-devel (devel package) - add Patch1(sane-backends-1.0.21-i18n.patch) * Sun Oct 12 2008 Ryoichi INAGAKI 1.0.18-3 - added BuildRequires: libgphoto2-devel instead of ghoto2-devel * Sat Oct 11 2008 Shu KONNO 1.0.18-2 - spec in utf-8 * Mon May 12 2008 Ryoichi INAGAKI 1.0.18-1 - applied new versioning policy - removed lib*.la files from devel package * Mon Dec 24 2007 Shu KONNO 1.0.18-0vl1 - new upstream release * Sun Jan 09 2005 Satoshi MACHINO 1.0.15-0vl1 - new upstream version(sane-1.0.15) - fixed spec file -- cleaned up patches -- added Requires: libjpeg, libusb -- added BuildRequires: glibc, libjpeg-devel, libusb-devel * Fri Oct 25 2002 Tomoya TAKA 1.0.8-0vl1 - new upstream release - update sane-1.0.8-vine.patch - add --enable-static option to %%configure * Mon May 13 2002 Masaki Shinomiya - 1.0.7-0vl2: sparc.patch, ppc.patch both from Mandrake(4mdk) - informed by Iohara [VinePlus:01130] * Thu Apr 4 2002 Masaki Shinomiya - 1.0.7-0vl1 for Vine Linux-2.x - 1.0.7-0.1 - set %_sysconfdir to /etc for RedHat6.x/Vine2.x * Wed Mar 6 2002 Masaki SHINOMIYA - 1.0.7-0 - new source - avoid listing %{_libdir}/sane from sane-devel - add LEVEL2 in doc * Fri Feb 1 2002 Masaki SHINOMIYA - 1.0.6-0.3 - allow to build without latex2html - prereq ldconfig, buildprereq sed, provide sane-backends * Sun Dec 23 2001 Masaki SHINOMIYA - 1.0.6-0.2 - dll.conf, epson.conf, network settings * Tue Dec 18 2001 Masaki SHINOMIYA - 1.0.6-0.1 - new source * Mon Dec 17 2001 Masaki SHINOMIYA - 1.0.5-1.3 - allow to use emacs or xemacs in building - nosrc #* Wed Oct 3 2001 Masaki SHINOMIYA #- 1.0.5-1.2 #- surpress swapping R<-->G colors on EPSON GT-8700/Perfection1640 #- ( information from [vine-users:037559] tyu ) #- omit doc/*.tex etc. * Tue Sep 18 2001 Masaki SHINOMIYA - 1.0.5-1.1 - use emacs instead of xemacs in building * Sat Jul 7 2001 Masaki SHINOMIYA - 1.0.5-1 * Thu Jun 7 2001 Masaki SHINOMIYA - 1.0.4 + epson backend ver.20010519 - sane-clients is removed from this package - scanimage, find-scanner and xerox are left in this package * Thu May 17 2001 Masaki SHINOMIYA - 1.0.4 + epson backend ver.20010331 - 'scanimage' is included in the binary'sane-1.0.4-1.i386.rpm'package. - refined script for gimp plug-in setup - html documents shal be installed in the directory '/usr/share/sane' - automatically make device the file /dev/usb/scanner0 * Wed Nov 15 2000 MATSUBAYASHI 'Shaolin' Kohji - 1.0.3-0vl8 - included missing "sane-config" script for sane * Tue Oct 17 2000 Jun Nishii - 1.0.3-0vl7 - merge xscanimage patch * Mon Oct 16 2000 Jun Nishii - 1.0.3-0vl6 - build with gimp-1.1.27 * Sun Oct 1 2000 Jun Nishii - 1.0.3-0vl5 - fixed group * Sat Sep 30 2000 Jun Nishii - 1.0.3-0vl4 - added %defattr in clients * Tue Sep 26 2000 Jun Nishii - 1.0.3-0vl3 - build with gimp-1.1.26 * Mon Sep 25 2000 Jun Nishii - 1.0.3-0vl2 - build with gimp-1.1.25 * Thu Sep 21 2000 Jun Nishii - 1.0.3-0vl1 * Thu Jun 8 2000 Jun Nishii - 1.0.2-0vl1 * Mon Jan 17 2000 Jun Nishii - build for Vine Linux 2.0 - added find-scanner, xerox * Fri Apr 23 1999 Hugo van der Kooij - Fixed packaging a bit. * Wed Apr 21 1999 Hugo van der Kooij - Updated package to 1.01 * Fri Apr 09 1999 Hugo van der Kooij - Split off the clients - Fixed a Alpha system anomaly by removing the specific backend. * Mon Nov 23 1998 Jonathan Miller [1.00-1] - upgraded to 1.00 (and made description less space-consuming) - included the post 1.00 fixed "configure" script available 22 Nov 1998. * Sat Aug 08 1998 Arne Coucheron [0.74-3] - added /etc/sane.d to %dir in file list * Sat Aug 01 1998 Arne Coucheron [0.74-2] - devel Group: reverted back to Development/Libraries - some changes to the %defattr and %attr usage in file list * Tue Jul 28 1998 Binaire [0.74-1] * Fri May 22 1998 Arne Coucheron [0.73-3] - added use of %%{name} and %%{version} macros - added a %postun for running ldconfig after uninstall - using BuildRoot properly now - using %defattr and %attr macros in filelist, allows non-root build this means that RPM 2.5 is required to build this spec file now! - devel Group: changed to X11/Libraries - added using RPM_OPT_FLAGS during make - added striping of programs and libraries - added Requires: gtk+ >= 0.99.13 to main package - added Requires: %%{name} = %%{version} to devel package - added a %clean section for removing the buildroot dir - simplified the filelist and added %config for sane-style.rc - moved lib*.so to %files devel and dropped the *.la files - added -q parameter to %setup - removed some older changelog entries - removed the "fix ldconfig brokenness..." stuff - removed the Packager: line; use /etc/rpmrc if you want your name in - if GIMP is installed, make symlink from xscanimage to plug-ins dir - install the find-scanner program from the tools dir * Mon May 18 1998 Hugo van der Kooij - Version 0.73 was created: May 13 1998 - gimp (original was build against 0.99.29) - gtk+ (original was build against 1.0.1) - dlh (original was build against 0.7d) - X11 development tree including xpm libraries. * Wed Apr 22 1998 Hugo van der Kooij - Binaries are now BuildRoot proof. * Wed Apr 22 1998 Hugo van der Kooij - Binaries are not BuildRoot proof. release 3 is done without BuildRoot! * Tue Apr 21 1998 Hugo van der Kooij - Temp. fix for some documentations problems with BuildRoot. * Sat Apr 11 1998 Hugo van der Kooij - Formal 0.72 now made as RPM! (Build against GTK+ 0.99.10 and GIMP 0.99.24) - Original package was released: Tue Apr 7 1998