Merge pull request #1 from import/sane:rosa2014.1

Backports master to personal update version 1.0.25
This commit is contained in:
djam 2017-11-17 14:57:19 +03:00
commit 34986bbf88
8 changed files with 157 additions and 11002 deletions

View file

@ -2,6 +2,6 @@ sources:
iscan-2.29.3-3-free.tar.bz2: f15e0b0c518ebdf1774e14bf2fbe26066c23b7b2
primaxscan-1.1.beta1.tar.gz: 374e2790fd6b3879835e10969dbe28aebe3025b7
sane-backend-geniusvp2_1.0.16.1.tar.gz: 4af825c231c8c048f8145af26b8fda3b66cb8be8
sane-backends-1.0.24.tar.gz: c10bcb30a1b092b2c2fe5a86d6a5efc29123ccf9
sane-driver-0.2.tar.gz: 59fbb163d4c9eba89d6fa6c4f9dc5229fae2dbdf
sane_hp_rts88xx-0.18.tar.gz: 02ed0f305fe100ff234e9250cdc618eba4b19a16
sane-backends-1.0.25.tar.gz: 05824922d91571e1fc2f5cdd270745783d593754

File diff suppressed because it is too large Load diff

View file

@ -1,60 +0,0 @@
--- backend/avision.c.str 2009-04-06 14:51:43.000000000 +0200
+++ backend/avision.c 2009-04-06 14:52:28.000000000 +0200
@@ -1138,7 +1138,7 @@
{
size_t i;
- DBG (dbg_level, info);
+ DBG (dbg_level, "%s", info);
for (i = 0; i < count; ++ i) {
DBG (dbg_level, " [%lu] %1d%1d%1d%1d%1d%1d%1d%1db %3oo %3dd %2xx\n",
(u_long) i,
@@ -1154,7 +1154,7 @@
int address = 0;
char text [16*3+1];
- DBG (dbg_level, info);
+ DBG (dbg_level, "%s", info);
while (count) {
char* t = text;
int i = 0;
--- backend/niash.c.str 2009-04-06 14:55:27.000000000 +0200
+++ backend/niash.c 2009-04-06 14:55:47.000000000 +0200
@@ -1112,7 +1112,7 @@
if ((SANE_GAMMA_SIZE / 16) && (i % (SANE_GAMMA_SIZE / 16)) == 0)
{
strcat (szTable, "\n");
- DBG (DBG_MSG, szTable);
+ DBG (DBG_MSG, "%s", szTable);
strcpy (szTable, "");
}
/* test for number print */
@@ -1125,7 +1125,7 @@
if (strlen (szTable))
{
strcat (szTable, "\n");
- DBG (DBG_MSG, szTable);
+ DBG (DBG_MSG, "%s", szTable);
}
break;
--- frontend/scanimage.c.str 2009-04-06 14:57:54.000000000 +0200
+++ frontend/scanimage.c 2009-04-06 14:58:16.000000000 +0200
@@ -1790,7 +1790,7 @@
printf (start, int_arg);
break;
case 0:
- printf (start);
+ printf ("%s", start);
break;
}
*percent = cc;
@@ -1804,7 +1804,7 @@
}
}
if (*start)
- printf (start);
+ printf ("%s", start);
}
}
if (i == 0 && ch != 'f')

View file

@ -1,47 +0,0 @@
From 305535e303032814b65bf6d889a95f00f08a9071 Mon Sep 17 00:00:00 2001
From: Nils Philippsen <nils@redhat.com>
Date: Wed, 5 May 2010 12:49:02 +0200
Subject: [PATCH] patch: epson-expression800
Squashed commit of the following:
commit 3b501d7499357438a1fbd63fefb2f977ae3051f5
Author: Nils Philippsen <nils@redhat.com>
Date: Wed May 5 12:14:23 2010 +0200
Improve Epson Expression 800
Epson Expression 800 models announce themselves as "processor", not
"scanner".
---
doc/descriptions/epson.desc | 1 +
doc/descriptions/epson2.desc | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/doc/descriptions/epson.desc b/doc/descriptions/epson.desc
index a22325c..55a0136 100644
--- a/doc/descriptions/epson.desc
+++ b/doc/descriptions/epson.desc
@@ -174,6 +174,7 @@
:model "Expression 800"
:interface "SCSI"
:status :complete
+:scsi "EPSON" "Expression800" "processor"
:model "Expression 1600"
:interface "SCSI USB IEEE-1394"
diff --git a/doc/descriptions/epson2.desc b/doc/descriptions/epson2.desc
index 9a14f4f..56cabcd 100644
--- a/doc/descriptions/epson2.desc
+++ b/doc/descriptions/epson2.desc
@@ -241,6 +241,7 @@
:model "Expression 800" ; command spec
:interface "SCSI"
:status :complete
+:scsi "EPSON" "Expression800" "processor"
:comment "overseas version of the GT-9600"
:model "Expression 836XL" ; command spec
--
1.6.6.1

View file

@ -1,22 +0,0 @@
--- backend/Makefile.am.link 2010-12-04 18:15:16.000000000 +0000
+++ backend/Makefile.am 2010-12-04 18:16:13.000000000 +0000
@@ -1089,7 +1089,7 @@
nodist_libsane_la_SOURCES = dll-s.c
libsane_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dll
libsane_la_LDFLAGS = $(DIST_LIBS_LDFLAGS)
-libsane_la_LIBADD = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo $(DL_LIBS) $(LIBV4L_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(TIFF_LIBS) $(JPEG_LIBS) $(GPHOTO2_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(AVAHI_LIBS) $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS)
+libsane_la_LIBADD = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo $(DL_LIBS) $(IEEE1284_LIBS) $(USB_LIBS)
# WARNING: Automake is getting this wrong so have to do it ourselves.
libsane_la_DEPENDENCIES = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo @SANEI_SANEI_JPEG_LO@
--- tools/sane-config.in.orig 2010-12-04 19:18:07.000000000 +0000
+++ tools/sane-config.in 2010-12-04 19:19:22.000000000 +0000
@@ -13,7 +13,7 @@
exec_prefix="@exec_prefix@"
LDFLAGS="@LDFLAGS@ @GPHOTO2_LDFLAGS@"
-LIBS="@LIBS@ @DL_LIBS@ @LIBV4L_LIBS@ @MATH_LIB@ @TIFF_LIBS@ @JPEG_LIBS@ @GPHOTO2_LIBS@ @SOCKET_LIBS@ @AVAHI_LIBS@ @USB_LIBS@ @SCSI_LIBS@ @RESMGR_LIBS@"
+LIBS="@DL_LIBS@ @USB_LIBS@ @IEEE1284_LIBS@"
pkgincludedir="@pkgincludedir@"
pkglibdir="@pkglibdir@"
includedir="@includedir@"

View file

@ -1,51 +0,0 @@
Index: configure
===================================================================
--- configure
+++ configure 2011-03-17 11:50:22.929227833 +0100
@@ -16877,7 +16877,7 @@
pixma plustek plustek_pp qcam ricoh rts8891 s9036 \
sceptre sharp sm3600 sm3840 snapscan sp15c st400 \
stv680 tamarack teco1 teco2 teco3 test u12 umax
- umax_pp umax1220u v4l xerox_mfp p5"
+ umax_pp umax1220u v4l xerox_mfp p5 primascan"
# If user specifies backends manually then cause configure
# to fail if its detected it can't be compiled. If we
Index: backend/Makefile.am
===================================================================
--- backend/Makefile.am
+++ backend/Makefile.am 2011-03-17 11:52:09.793227833 +0100
@@ -191,7 +191,7 @@
libtamarack.la libtest.la libteco1.la \
libteco2.la libteco3.la libu12.la libumax.la \
libumax1220u.la libumax_pp.la libv4l.la \
- libxerox_mfp.la
+ libxerox_mfp.la libprimascan.la
# Each stand alone backend thats possible to be built should be listed
# here. There are the libraries that are installed under $(libdir)/sane.
@@ -224,7 +224,7 @@
libsane-tamarack.la libsane-test.la libsane-teco1.la \
libsane-teco2.la libsane-teco3.la libsane-u12.la libsane-umax.la \
libsane-umax1220u.la libsane-umax_pp.la libsane-v4l.la \
- libsane-xerox_mfp.la
+ libsane-xerox_mfp.la libsane-primascan.la
EXTRA_LTLIBRARIES = $(be_convenience_libs) $(be_dlopen_libs)
@@ -1064,6 +1064,15 @@
libsane_xerox_mfp_la_LIBADD = $(COMMON_LIBS) libxerox_mfp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_tcp.lo $(MATH_LIB) $(SOCKET_LIBS) $(USB_LIBS) $(RESMGR_LIBS)
EXTRA_DIST += xerox_mfp.conf.in
+libprimascan_la_SOURCES = primascan.c primascan.h
+libprimascan_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=primascan
+
+nodist_libsane_primascan_la_SOURCES = primascan-s.c
+libsane_primascan_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=primascan
+libsane_primascan_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS)
+libsane_primascan_la_LIBADD = $(COMMON_LIBS) libprimascan.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS)
+
+
libdll_la_SOURCES = dll.c
BUILT_SOURCES = dll-preload.h
CLEANFILES += dll-preload.h

View file

@ -1,22 +0,0 @@
Index: frontend/scanimage.c
===================================================================
--- frontend/scanimage.c
+++ frontend/scanimage.c 2011-03-17 12:17:35.350469332 +0100
@@ -1891,7 +1891,7 @@
printf (start, int_arg);
break;
case 0:
- printf (start);
+ printf ("%s", start);
break;
}
*percent = cc;
@@ -1905,7 +1905,7 @@
}
}
if (*start)
- printf (start);
+ printf ("%s", start);
}
}
if (i == 0 && ch != 'f')

337
sane.spec
View file

@ -1,5 +1,5 @@
%define iscanversion 2.29.3
%define beta %nil
%define major 1
%define libname %mklibname %{name} %{major}
%define devname %mklibname %{name} %{major} -d
@ -11,11 +11,7 @@
# All sane backends have SONAME libsane.so.1. We do not want
# sane-backends-iscan to provide libsane.so.1, so filter these out.
%if %{_use_internal_dependency_generator}
%define __noautoprovfiles %{_libdir}/sane
%else
%define _exclude_files_from_autoprov %{_libdir}/%{name}/
%endif
%define __libtoolize /bin/true
@ -27,14 +23,14 @@
Summary: SANE - local and remote scanner access
Name: sane
Version: 1.0.24
Release: 5
Version: 1.0.25
Release: 3
# lib/ is LGPLv2+, backends are GPLv2+ with exceptions
# Tools are GPLv2+, docs are public domain
License: GPLv2+ and GPLv2+ with exceptions and Public Domain
Group: Graphics
Url: http://www.sane-project.org/
Source0: http://alioth.debian.org/frs/download.php/file/3958/sane-backends-1.0.24.tar.gz
Source0: http://alioth.debian.org/frs/download.php/file/3958/sane-backends-%{version}.tar.gz
Source3: http://downloads.sourceforge.net/project/px-backend/primaxscan-source/1.1.beta1/primaxscan-1.1.beta1.tar.gz
Source5: saned-xinetd
Source9: http://downloads.sourceforge.net/project/hp44x0backend/hp44x0backend/sane_hp_rts88xx-0.18/sane_hp_rts88xx-0.18.tar.gz
@ -48,54 +44,46 @@ Source12: http://www.geocities.com/trsh0101/SANE/primascan.c
Source13: iscan-%{iscanversion}-3-free.tar.bz2
Source14: http://downloads.sourceforge.net/project/geniusvp2/sane-backend-geniusvp2/1.0.16.1/sane-backend-geniusvp2_1.0.16.1.tar.gz
Source15: sane.rpmlintrc
Patch0: sane-backends-1.0.19-fix-str-fmt.patch
Patch1: sane-backends-1.0.18-plustek-s12.patch
Patch23: iscan-2.29.3-fix-link.patch
Patch24: sane-backends-1.0.21-link.patch
Patch26: iscan-2.20.1-no_non-free_please.diff
Patch27: iscan-2.28.1-linkage_fix.patch
Patch0: sane-backends-1.0.18-plustek-s12.patch
# (fc) 1.0.19-12mdv fix group for device
Patch28: sane-backends-1.0.20-group.patch
# (fc) 1.0.20-1mdv primascan build support
Patch29: sane-backends-1.0.21-primascan.patch
Patch1: sane-backends-1.0.20-group.patch
# (fc) list Brother MFC-260C, DCP130C as supported (Mdv bug # 52951)
Patch30: sane-backends-1.0.22-brother2list.patch
Patch31: sane-backends-1.0.20-strformat.patch
Patch32: sane-backends-1.0.22-fix-str-fmt.patch
Patch33: sane-backends-1.0.23-have-pthread.patch
Patch2: sane-backends-1.0.22-brother2list.patch
Patch3: sane-backends-1.0.20-strformat.patch
Patch4: sane-backends-1.0.23-have-pthread.patch
# Debian patches
# new build system breaks build when using pthreads.
Patch101: 01_missing_pthreads.dpatch
Patch10: 01_missing_pthreads.dpatch
# add back SANE_CAP_ALWAYS_SETTABLE which was mistakenly
# removed from SANE 1.0.20
Patch106: 06_cap_always_settable.dpatch
# Update es translation and add new gl translation, courtesy of
# Miguel Bouzada <mbouzada@gmail.com>.
Patch109: 09_po_update_es_add_gl.dpatch
Patch11: 06_cap_always_settable.dpatch
# Use fedora's patch to remove rpath
# Patch to the dll backend to look for pieces of dll.conf inside the
# /etc/sane.d/dll.d/ directory. This is a facility for packages providing
# external backends (like libsane-extras, hpoj and hplip).
Patch113: 22_dll_backend_conf.dpatch
Patch115: 24_sane-desc.c_debian_mods.dpatch
Patch12: 22_dll_backend_conf.dpatch
Patch13: 24_sane-desc.c_debian_mods.dpatch
# Fedora patches
Patch202: sane-backends-1.0.20-open-macro.patch
Patch203: sane-backends-1.0.23-udev.patch
Patch204: sane-backends-1.0.21-epson-expression800.patch
Patch20: sane-backends-1.0.20-open-macro.patch
Patch21: sane-backends-1.0.23-udev.patch
Patch30: iscan-2.29.3-fix-link.patch
Patch31: iscan-2.20.1-no_non-free_please.diff
Patch32: iscan-2.28.1-linkage_fix.patch
BuildRequires: gettext
BuildRequires: gettext-devel
BuildRequires: ieee1284-devel
BuildRequires: libtool-devel
BuildRequires: jpeg-devel
BuildRequires: tiff-devel
BuildRequires: libtool-devel
BuildRequires: pkgconfig(gtk+-2.0)
BuildRequires: pkgconfig(libusb)
BuildRequires: pkgconfig(libtiff-4)
%if %{with gphoto2}
BuildRequires: pkgconfig(libgphoto2)
%endif
BuildRequires: pkgconfig(libusb)
%if %{with v4l}
BuildRequires: pkgconfig(libv4l1)
%endif
@ -116,136 +104,192 @@ mailing list access, see http://www.mostang.com/sane/
This package does not enable network scanning by default; if you wish
to enable it, install the saned package.
#----------------------------------------------------------------------------
%package -n %{libname}
Group: System/Kernel and hardware
License: LGPLv2
Summary: SANE - local and remote scanner access. This package contains the sane library
Summary: Shared libraries for SANE
License: LGPLv2.1+
Group: System/Libraries
%description -n %{libname}
This package contains the shared libraries for %{name}.
%files -n %{libname}
%{_libdir}/libsane.so.%{major}*
%dir %{_libdir}/sane
%{_libdir}/sane/*.so.%{major}*
%if %{with epkowa}
%exclude %{_libdir}/sane/libsane-epkowa.so.%{major}*
%endif
#----------------------------------------------------------------------------
%package -n %{devname}
Summary: Development files for SANE
License: LGPLv2.1+
Group: Development/C
License: LGPL
Summary: SANE - local and remote scanner access
Requires: %{libname} = %{version}-%{release}
Provides: sane-devel = %{version}-%{release}
Requires: %{libname} = %{EVRD}
Provides: sane-devel = %{EVRD}
%description -n %{devname}
This package contains the headers and development libraries necessary
to develop applications using SANE.
%files -n %{devname}
%{_bindir}/sane-config
%{_libdir}/libsane.so
%{_libdir}/sane/*.so
%{_includedir}/sane
%{_libdir}/pkgconfig/sane-backends.pc
%if %{with epkowa}
%exclude %{_libdir}/sane/libsane-epkowa.so
%endif
#----------------------------------------------------------------------------
%package backends
Group: System/Kernel and hardware
License: LGPLv2
Summary: SANE - local and remote scanner access
Provides: %{name} = %{version}-%{release}
License: LGPLv2.1+
Group: System/Kernel and hardware
Provides: %{name} = %{EVRD}
%if %{with epkowa}
Suggests: iscan
%endif
Suggests: sane-firmware
Requires(pre,postun): rpm-helper
%description backends
This package contains the backends for different scanners.
%files backends -f sane-backends.lang
%doc %{_docdir}/sane-backends-%{version}
%{_bindir}/sane-find-scanner
%{_bindir}/scanimage
%{_bindir}/gamma4scanimage
%if %{with primax}
%{_bindir}/primax_scan
%endif
%{_bindir}/umax_pp
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_mandir}/man7/*
%dir %{_sysconfdir}/sane.d
%config(noreplace) %{_sysconfdir}/sane.d/*
%{_udevrulesdir}/*-libsane.rules
%attr(1777,root,root) %dir /var/lib/lock/sane
%if %{with epkowa}
# iscan files
%exclude %{_sysconfdir}/sane.d/epkowa.conf
%exclude %{_mandir}/man5/sane-epkowa.5*
%endif
%pre backends
%_pre_groupadd scanner
%postun backends
%_postun_groupdel scanner
#----------------------------------------------------------------------------
%if %{with epkowa}
%package backends-iscan
Group: System/Kernel and hardware
License: LGPLv2
Summary: SANE - local and remote scanner access
License: LGPLv2.1+
Group: System/Kernel and hardware
Provides: iscan = %{iscanversion}
%description backends-iscan
This package contains the iscan backend, in order to not conflict with
manufacturer-supplied packages.
%files backends-iscan
%{_libdir}/sane/libsane-epkowa.so.%{major}*
%{_libdir}/sane/libsane-epkowa.so
%{_sysconfdir}/sane.d/epkowa.conf
%{_mandir}/man5/sane-epkowa.5*
%{_mandir}/man8/iscan-registry.*
%endif
#----------------------------------------------------------------------------
%package backends-doc
Summary: Documentation for SANE backends
Group: System/Kernel and hardware
Group: Documentation
%description backends-doc
This package contains the SANE backend documentation for different
scanners.
%files backends-doc
%doc %{_docdir}/sane-backends-doc-%{version}
#----------------------------------------------------------------------------
%package -n saned
Group: System/Kernel and hardware
License: LGPLv2
Summary: SANE - local and remote scanner access
Provides: %{name} = %{version}-%{release}
Provides: saned = %{version}-%{release}
Requires: sane-backends >= %{version}-%{release}
Requires: xinetd
License: LGPLv2.1+
Group: System/Kernel and hardware
Provides: saned = %{EVRD}
Requires: sane-backends >= %{EVRD}
Requires(post,postun): xinetd
Requires(preun,post): rpm-helper
%description -n saned
This package contains saned, a daemon that allows remote clients to
access image acquisition devices available on the local host.
%files -n saned
%{_sbindir}/*
%{_mandir}/man8/saned*
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/xinetd.d/saned
%post -n saned
systemctl restart xinetd
%pre -n saned
# Add saned to group scanner, cdwriter and usb for scanner access.
/usr/sbin/useradd -r -M -s /bin/false -c "system user for saned" saned -G cdwriter,usb,scanner || :
%preun -n saned
systemctl restart xinetd
%postun -n saned
systemctl restart xinetd
#----------------------------------------------------------------------------
%prep
%setup -qn sane-backends-%{version}%{beta}
%setup -qn sane-backends-%{version}
%patch1 -p1 -b .plusteks12
###%patch24 -p0 -b .link
%patch28 -p1 -b .group
%patch30 -p1 -b .brother2list
%patch31 -p1 -b .strformat
%patch32 -p0
%patch33 -p1 -b .pthread
%patch0 -p1 -b .plusteks12
%patch1 -p1 -b .group
%patch2 -p1 -b .brother2list
%patch3 -p1 -b .strformat
%patch4 -p1 -b .pthread
%patch101 -p1
%patch106 -p1
#%patch109 -p1
%patch113 -p1
%patch115 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
# Fedora patches
%patch202 -p1 -b .open-macro
%patch203 -p1 -b .udev
%patch204 -p1 -b .epson-expression800
# "geniusvp2" backend
#setup -q -T -D -a 14 -n sane-backends-%{version}
# "hp3500" backend
# Patch does not match on file unsupported.desc (change should not affect
# the backend itself), so we force it in
#bzcat %{PATCH20} | patch -p0 -b --suffix .hp3500 -f || :
# Fix parallel build (Gwenole)
#for a in `find . -name Makefile.in -print`; do \
# perl -p -i -e 's/^(\s*TARGETS\s+=\s+)(\S+)(\s+)(\$\(\S+_LTOBJS\))/$1$4$3$2/' $a; \
#done
# Patch for the HP ScanJet 44x0C scanners ("hp_rts88xx" backend)
#%setup -q -T -D -a 9 -n sane-backends-%{version}%{beta}
#cd sane_hp_rts88xx/sane_hp_rts88xx
#./patch-sane.sh $RPM_BUILD_DIR/sane-backends-%{version}%{beta}
#cd ../..
#patch21 -p1 -b .hp_rts88xx-0.18-fix_link
#echo 'hp_rts88xx' >> backend/dll.conf.in
%patch20 -p1 -b .open-macro
%patch21 -p1 -b .udev
# Primax parallel port scanners
%if %{with primax}
%setup -q -T -D -a 3 -n sane-backends-%{version}%{beta}
%setup -q -T -D -a 3 -n sane-backends-%{version}
%endif
# "primascan" backend
# (commented out in dll.conf, as it claims to support every USB scanner)
######%patch29 -p0 -b .primascan
cat %{SOURCE11} > backend/primascan.h
cat %{SOURCE12} > backend/primascan.c
##perl -p -i -e 's:(BACKENDS=\"):$1primascan :' configure.in
# <mrl> avoid autoconf by applying change to configure too.
##perl -p -i -e 's:(BACKENDS=\"):$1primascan :' configure
##perl -p -i -e 's:(DISTFILES\s*=\s*):$1primascan.h primascan.c :' backend/Makefile.in
echo '#primascan' >> backend/dll.conf.in
# Scanners in some Brother MF devices
#setup -q -T -D -a 10 -n sane-backends-%{version}%{beta}
# Epson Avasys driver for Epson scanners
%if %{with epkowa}
%setup -q -T -D -a 13 -n sane-backends-%{version}%{beta}
%setup -q -T -D -a 13 -n sane-backends-%{version}
%endif
# lib64 fixes (avoid patch)
@ -258,9 +302,9 @@ perl -p -i -e 's:for \(retries = 20; retries; retries--\):for (retries = 5; retr
%if %{with epkowa}
pushd iscan-%{iscanversion}
%patch23 -p0 -b .iscan-2.10.0-1_fix_link
%patch26 -p0 -b .no_non-free_please
%patch27 -p2 -b .linkage_fix
%patch30 -p0 -b .iscan-2.10.0-1_fix_link
%patch31 -p0 -b .no_non-free_please
%patch32 -p2 -b .linkage_fix
popd
%endif
@ -315,8 +359,6 @@ cd ..
# Create missing lock dir
install -d %{buildroot}/var/lib/lock/sane
#mv %{buildroot}/%{_sbindir}/saned %{buildroot}/%{_sbindir}/in.saned
#install -m 755 tools/sane-find-scanner %{buildroot}/%{_bindir}
perl -pi -e "s/installed.*/installed=yes/g" %{buildroot}%{_libdir}/libsane.la
/sbin/ldconfig -n %{buildroot}%{_libdir} %{buildroot}%{_libdir}/sane
@ -325,10 +367,8 @@ perl -pi -e "s/installed.*/installed=yes/g" %{buildroot}%{_libdir}/libsane.la
# the appropriate scanner is not present
perl -p -i -e 's/^(\s*geniusvp2)/\#$1/g' %{buildroot}%{_sysconfdir}/sane.d/dll.conf
# Comment out entry for the "epson" backend in /etc/sane.d/dll.conf as
# we have also Epson's "epkowa" backend which supports the same
# scanners
perl -p -i -e 's/^(\s*epson)/\#$1/g' %{buildroot}%{_sysconfdir}/sane.d/dll.conf
# Enable stocks driver by default
sed -i 's/^#epson/epson/g' %{buildroot}%{_sysconfdir}/sane.d/dll.conf
# Remove "hpoj" line from /etc/sane.d/dll.con
perl -p -i -e 's/HP\s+OfficeJet/HPLIP/g' %{buildroot}%{_sysconfdir}/sane.d/dll.conf
@ -353,7 +393,6 @@ EOF
install -d %{buildroot}%{_docdir}/sane-backends-%{version}/
install -d %{buildroot}%{_docdir}/sane-backends-doc-%{version}/
pushd %{buildroot}/usr/doc/sane-%{version}
#pushd %{buildroot}/usr/doc/sane-1.0.18-cvs
mv `find -mindepth 1 -type d` *.html *.txt %{buildroot}%{_docdir}/sane-backends-doc-%{version}/
mv README README.linux %{buildroot}%{_docdir}/sane-backends-%{version}/
rm -f README.*
@ -401,81 +440,3 @@ perl -p -i -e 's/(\#.{500}).*$/$1 .../' %{buildroot}/lib/udev/rules.d/60-libsane
sed -i '/^%dir/d' sane-backends.lang
%post -n saned
%_post_service saned
%pre -n saned
# Add saned to group scanner, cdwriter and usb for scanner access.
/usr/sbin/useradd -r -M -s /bin/false -c "system user for saned" saned -G cdwriter,usb,scanner || :
#%_pre_useradd saned /etc/sane.d /bin/false
%preun -n saned
%_preun_service saned
%postun -n saned
%_postun_userdel saned
%pre backends
%_pre_groupadd scanner
%postun backends
%_postun_groupdel scanner
%files backends -f sane-backends.lang
%doc %{_docdir}/sane-backends-%{version}
%{_bindir}/sane-find-scanner
%{_bindir}/scanimage
%{_bindir}/gamma4scanimage
%if %{with primax}
%{_bindir}/primax_scan
%endif
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_mandir}/man7/*
%dir %{_sysconfdir}/sane.d
#config(noreplace) %{_sysconfdir}/sane.d/*[^saned]
%config(noreplace) %{_sysconfdir}/sane.d/*
/lib/udev/rules.d/*-libsane.rules
%attr(1777,root,root) %dir /var/lib/lock/sane
%if %{with epkowa}
# iscan files
%exclude %{_sysconfdir}/sane.d/epkowa.conf
%exclude %{_mandir}/man5/sane-epkowa.5*
%endif
%if %{with epkowa}
%files backends-iscan
%{_libdir}/sane/libsane-epkowa.*
%{_sysconfdir}/sane.d/epkowa.conf
%{_mandir}/man5/sane-epkowa.5*
%{_mandir}/man8/iscan-registry.*
%endif
%files backends-doc
%doc %{_docdir}/sane-backends-doc-%{version}
%files -n %{libname}
%{_libdir}/*.so.*
%dir %{_libdir}/sane
%{_libdir}/sane/*.so.*
%if %{with epkowa}
%exclude %{_libdir}/sane/libsane-epkowa.*
%endif
%files -n %{devname}
%{_bindir}/sane-config
%{_libdir}/*.so
%{_libdir}/sane/*.so
%{_includedir}/sane
%{_libdir}/pkgconfig/sane-backends.pc
%if %{with epkowa}
%exclude %{_libdir}/sane/libsane-epkowa*
%endif
%files -n saned
%{_sbindir}/*
%{_mandir}/man8/saned*
#config(noreplace) %{_sysconfdir}/sane.d/saned.conf
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/xinetd.d/saned