diff --git a/hal-usb-scanner-add b/hal-usb-scanner-add new file mode 100755 index 0000000..f1297b4 --- /dev/null +++ b/hal-usb-scanner-add @@ -0,0 +1,6 @@ +#!/bin/bash + +# Disable USB autosuspend for scanners +if [ -n "${HAL_PROP_LINUX_SYSFS_PATH}" -a -e "${HAL_PROP_LINUX_SYSFS_PATH}/power/level" ]; then + echo on > "${HAL_PROP_LINUX_SYSFS_PATH}/power/level" +fi diff --git a/sane-backends-1.0.12-badcode.patch b/sane-backends-1.0.12-badcode.patch deleted file mode 100644 index c1d27bb..0000000 --- a/sane-backends-1.0.12-badcode.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- sane-backends-1.0.12/backend/canon-sane.c.badcode 2003-10-08 09:42:22.000000000 +0100 -+++ sane-backends-1.0.12/backend/canon-sane.c 2003-10-08 09:42:51.000000000 +0100 -@@ -1919,8 +1919,8 @@ - for (p = buf; p < buf + nread; p++) - { - b = *p; -- *p++ = *(p + 1); -- *p = b; -+ *p = *(p + 1); -+ *++p = b; - } - } - *len = nread; diff --git a/sane-backends-1.0.17-pkgconfig.patch b/sane-backends-1.0.17-pkgconfig.patch deleted file mode 100644 index e01a5aa..0000000 --- a/sane-backends-1.0.17-pkgconfig.patch +++ /dev/null @@ -1,284 +0,0 @@ ---- sane-backends-1.0.17/tools/sane-config.in.pkgconfig 2006-05-17 08:33:04.000000000 +0200 -+++ sane-backends-1.0.17/tools/sane-config.in 2006-05-17 08:33:04.000000000 +0200 -@@ -7,30 +7,10 @@ - PACKAGE="@PACKAGE@" - scriptname="sane-config" - --LINKER_RPATH="" - - prefix="@prefix@" - exec_prefix="@exec_prefix@" - --LIBS="@LIBS@ @DL_LIB@" --pkgincludedir="@pkgincludedir@" --pkglibdir="@pkglibdir@" --includedir="@includedir@" --mandir="@mandir@" --infodir="@infodir@" --libdir="@libdir@" --localstatedir="@localstatedir@" --sysconfdir="@sysconfdir@" --datadir="@datadir@" --libexecdir="@libexecdir@" --sbindir="@sbindir@" --bindir="@bindir@" --#${prefix} --#exec_prefix_set=no --srcdir="@srcdir@" --top_srcdir="@top_srcdir@" --cflags= -- - usage () - { - echo "Usage: " 1>&2 -@@ -83,27 +63,13 @@ - exit 1 - ;; - --ldflags) -- -- if test -z "$LINKER_RPATH"; then -- echo "-L${libdir} @GPHOTO2_LDFLAGS@" -- else -- echo "-L${libdir} @GPHOTO2_LDFLAGS@ ${LINKER_RPATH}${libdir}" -- fi -+ pkg-config --libs-only-L sane-backends - ;; - --libs) -- echo "-lsane ${LIBS}" -+ pkg-config --libs sane-backends - ;; - --cflags) -- unique_cflags= -- if test "${includedir}" != "/usr/include"; then -- unique_cflags="${unique_cflags} -I${includedir}" -- fi -- for i in $cflags; do -- if test "${i}" != "-I${includedir}"; then -- unique_cflags="${unique_cflags} $i" -- fi -- done -- echo ${unique_cflags} -+ pkg-config --cflags sane-backends - ;; - --prefix) - echo ${prefix} ---- /dev/null 2006-05-17 07:23:35.099833750 +0200 -+++ sane-backends-1.0.17/tools/sane-backends.pc.in 2006-05-17 08:33:04.000000000 +0200 -@@ -0,0 +1,14 @@ -+prefix=@prefix@ -+exec_prefix=@exec_prefix@ -+libdir=@libdir@ -+includedir=@includedir@ -+ -+pc_libs=@RESMGR_LIBS@ @DL_LIB@ @IEEE1284_LIBS@ @PTHREAD_LIBS@ @JPEG_LIBS@ @PC_LIBS@ -+pc_reqs=@PC_REQS@ -+ -+Name: SANE Backends -+Description: Backends for SANE, the universal scanner interface -+Version: @VERSION@ -+Requires: ${pc_reqs} -+Libs: -L${libdir} -lsane ${pc_libs} -+Cflags: ---- sane-backends-1.0.17/tools/Makefile.in.pkgconfig 2005-10-29 16:41:09.000000000 +0200 -+++ sane-backends-1.0.17/tools/Makefile.in 2006-05-17 09:29:12.000000000 +0200 -@@ -25,6 +25,7 @@ - includedir = @includedir@ - oldincludedir = /usr/include - configdir = ${sysconfdir}/sane.d -+pkgconfigdir = ${libdir}/pkgconfig - - MKDIR = $(top_srcdir)/mkinstalldirs - INSTALL = @INSTALL@ -@@ -65,7 +66,8 @@ - - DISTFILES = Makefile.in RenSaneDlls.cmd README libtool-get-dll-ext \ - mustek600iin-off.c sane-config.in sane-desc.c check-usb-chip.c \ -- sane-find-scanner.c umax_pp.c xerox gamma4scanimage.c check-po.awk -+ sane-find-scanner.c umax_pp.c xerox gamma4scanimage.c check-po.awk \ -+ sane-backends.pc.in - - SUBDIRS = hotplug hotplug-ng udev - -@@ -79,18 +81,24 @@ - - all: $(DESTINATIONS) - --install: sane-config sane-find-scanner gamma4scanimage -+install: sane-config sane-backends.pc sane-find-scanner gamma4scanimage -+ $(MKDIR) $(DESTDIR)$(bindir) $(DESTDIR)$(pkgconfigdir) -+ $(INSTALL_DATA) sane-backends.pc $(DESTDIR)$(pkgconfigdir)/sane-backends.pc - $(INSTALL_SCRIPT) sane-config $(DESTDIR)$(bindir)/sane-config - $(INSTALL_PROGRAM) sane-find-scanner $(DESTDIR)$(bindir)/sane-find-scanner - $(INSTALL_PROGRAM) gamma4scanimage $(DESTDIR)$(bindir)/gamma4scanimage - - uninstall: -- rm -f $(bindir)/sane-config $(bindir)/sane-find-scanner $(bindir)/gamma4scanimage -+ rm -f $(bindir)/sane-config $(bindir)/sane-find-scanner $(bindir)/gamma4scanimage $(pkgconfigdir)/sane-backends.pc - - sane-config: sane-config.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -+sane-backends.pc: sane-backends.pc.in $(top_builddir)/config.status -+ cd $(top_builddir) \ -+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status -+ - sane-find-scanner: sane-find-scanner.o check-usb-chip.o ../backend/sane_strstatus.lo \ - ../sanei/sanei_scsi.lo ../sanei/sanei_usb.lo ../sanei/sanei_init_debug.lo \ - ../sanei/sanei_config.lo ---- sane-backends-1.0.17/ChangeLog.pkgconfig 2005-12-18 15:41:09.000000000 +0100 -+++ sane-backends-1.0.17/ChangeLog 2006-05-17 08:33:04.000000000 +0200 -@@ -0,0 +1,7 @@ -+2006-05-16 Nils Philippsen -+ -+ * acinclude.m4 configure.in tools/sane-config.in -+ tools/sane-backends.pc.in tools/Makefile.in: add pkg-config support, -+ re-write sane-config to use pkg-config to avoid multilib problems with -+ conflicting sane-config scripts -+ ---- sane-backends-1.0.17/acinclude.m4.pkgconfig 2006-05-17 09:30:36.000000000 +0200 -+++ sane-backends-1.0.17/acinclude.m4 2006-05-17 08:33:05.000000000 +0200 -@@ -194,6 +194,7 @@ - # Checks for ieee1284 library, needed for canon_pp backend. - AC_DEFUN([SANE_CHECK_IEEE1284], - [ -+ AC_SUBST(IEEE1284_LIBS) - AC_CHECK_HEADER(ieee1284.h, [ - AC_CACHE_CHECK([for libieee1284 >= 0.1.5], sane_cv_use_libieee1284, [ - AC_TRY_COMPILE([#include ], [ -@@ -206,6 +207,7 @@ - ],) - if test "$sane_cv_use_libieee1284" = "yes" ; then - AC_DEFINE(HAVE_LIBIEEE1284,1,[Define to 1 if you have the `ieee1284' library (-lcam).]) -+ AC_SUBST(IEEE1284_LIBS, "-lieee1284") - fi - ]) - -@@ -213,6 +215,7 @@ - # Checks for pthread support - AC_DEFUN([SANE_CHECK_PTHREAD], - [ -+ AC_SUBST(PTHREAD_LIBS) - - case "${host_os}" in - darwin*) # currently only enabled on MacOS X -@@ -246,6 +249,7 @@ - [Define if pthreads should be used instead of forked processes.]) - fi - if test "$have_pthread" = "yes" ; then -+ AC_SUBST(PTHREAD_LIBS, "-lpthread") - CPPFLAGS="${CPPFLAGS} -D_REENTRANT" - fi - AC_MSG_CHECKING([whether to enable pthread support]) -@@ -259,6 +263,7 @@ - # GPHOTO2 backends. - AC_DEFUN([SANE_CHECK_JPEG], - [ -+ AC_SUBST(JPEG_LIBS) - AC_CHECK_LIB(jpeg,jpeg_start_decompress, - [ - AC_CHECK_HEADER(jconfig.h, -@@ -271,7 +276,7 @@ - sane_correct_jpeg_lib_version_found - #endif - ],[sane_cv_use_libjpeg="yes"; LIBS="${LIBS} -ljpeg"; -- AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) -+ AC_SUBST(JPEG_LIBS, "-ljpeg") AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) - ],) - ],) - ]) -@@ -415,6 +420,7 @@ - # Checks for gphoto2 libs, needed by gphoto2 backend - AC_DEFUN([SANE_CHECK_GPHOTO2], - [ -+ AC_SUBST(PC_REQS) - AC_ARG_WITH(gphoto2, - AC_HELP_STRING([--with-gphoto2], - [include the gphoto2 backend @<:@default=yes@:>@]), -@@ -444,6 +450,7 @@ - LDFLAGS="$LDFLAGS $GPHOTO2_LDFLAGS" - - AC_SUBST(GPHOTO2_LDFLAGS) -+ AC_SUBST(PC_REQS, "libgphoto2 $PC_REQS") - - saved_LIBS="${LIBS}" - LIBS="${LIBS} ${GPHOTO2_LIBS}" ---- sane-backends-1.0.17/configure.in.pkgconfig 2005-12-18 14:15:15.000000000 +0100 -+++ sane-backends-1.0.17/configure.in 2006-05-17 08:33:04.000000000 +0200 -@@ -52,6 +52,7 @@ - AC_PROG_MAKE_SET - AC_PROG_CPP - AC_PROG_GCC_TRADITIONAL -+PKG_PROG_PKG_CONFIG - AC_PATH_PROG(SANE_CONFIG_PATH, sane-config, no) - AC_PATH_PROG(MSGFMT, msgfmt$EXEEXT, no) - AC_PATH_PROG(XGETTEXT, xgettext$EXEEXT, no) -@@ -93,6 +94,8 @@ - dnl *********************************************************************** - SANE_CHECK_DLL_LIB - dnl Checks for Backend libraries. -+_pc_libs_save="$LIBS" -+LIBS="" - AC_CHECK_LIB(m,sqrt) - AC_CHECK_LIB(scsi, scsireq_enter) # FreeBSD needs this - AC_CHECK_LIB(cam, cam_open_device) # FreeBSD 3+ needs this -@@ -103,6 +106,8 @@ - AC_SEARCH_LIBS(socket, socket) - AC_SEARCH_LIBS(syslog, syslog be) # OS/2 needs -lsyslog, BeOS needs -lbe - fi -+AC_SUBST(PC_LIBS, "$LIBS") -+LIBS="$LIBS $_pc_libs_save" - SANE_CHECK_JPEG - SANE_CHECK_IEEE1284 - SANE_CHECK_PTHREAD -@@ -130,19 +135,23 @@ - - SANE_CHECK_MISSING_HEADERS - -+AC_SUBST(RESMGR_LIBS) - AC_CHECK_HEADER(resmgr.h,[ - AC_CHECK_LIB( - resmgr, - rsm_open_device,[ - AC_DEFINE(HAVE_RESMGR,1,[define if you have the resmgr library]) - LIBS="$LIBS -lresmgr" -+ AC_SUBST(RESMGR_LIBS, "-lresmgr") - ] - ) - ]) - -+AC_SUBST(USBCALLS_LIBS) - AC_CHECK_HEADER(usbcalls.h,[ - AC_DEFINE(HAVE_USBCALLS,1,[define if you have the usbcalls library]) - LIBS="$LIBS -lusbcalls" -+ AC_SUBST(USBCALLS_LIBS, "-lusbcalls") - ],,[ - #include - #include ]) -@@ -259,6 +268,7 @@ - fi - - dnl libusb on enabled by default (if found) -+AC_SUBST(PC_REQS) - USE_LIBUSB=yes - AC_ARG_ENABLE(libusb, - AC_HELP_STRING([--disable-libusb], -@@ -274,6 +284,10 @@ - AC_CHECK_LIB(usb, usb_interrupt_read) - if test "${ac_cv_lib_usb_usb_interrupt_read}" = "yes" ; then - HAVE_LIBUSB="yes" -+ PKG_CHECK_MODULES(LIBUSB, libusb) -+ if test "${LIBUSB_LIBS}"; then -+ AC_SUBST(PC_REQS, "libusb $PC_REQS") -+ fi - fi - fi - -@@ -518,6 +532,7 @@ - japi/Makefile backend/Makefile include/Makefile doc/Makefile \ - po/Makefile testsuite/Makefile tools/Makefile doc/doxygen-sanei.conf]) - AC_CONFIG_FILES([tools/sane-config], [chmod a+x tools/sane-config]) -+AC_CONFIG_FILES([tools/sane-backends.pc]) - AC_OUTPUT - - dnl *********************************************************************** diff --git a/sane-backends-1.0.18-epson-cx5000.patch b/sane-backends-1.0.18-epson-cx5000.patch deleted file mode 100644 index 0b4610b..0000000 --- a/sane-backends-1.0.18-epson-cx5000.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- sane-backends-1.0.18/doc/descriptions/epson.desc.epson-cx5000 2006-06-22 20:21:08.000000000 +0200 -+++ sane-backends-1.0.18/doc/descriptions/epson.desc 2007-08-15 08:43:19.000000000 +0200 -@@ -207,6 +207,11 @@ - :usbid "0x04b8" "0x0819" - :status :good - -+:model "CX-5000" -+:interface "USB" -+:usbid "0x04b8" "0x082b" -+:status :good -+ - :model "CX-5200" - :interface "USB" - :usbid "0x04b8" "0x0801" ---- sane-backends-1.0.18/backend/epson_usb.c.epson-cx5000 2006-06-11 22:24:19.000000000 +0200 -+++ sane-backends-1.0.18/backend/epson_usb.c 2007-08-15 08:46:01.000000000 +0200 -@@ -39,6 +39,7 @@ SANE_Word sanei_epson_usb_product_ids[] - 0x815, /* LP-A500 / AcuLaser CX11 */ - 0x819, /* CX4800 */ - 0x820, /* CX4200 */ -+ 0x82b, /* CX5000 */ - 0 /* last entry - this is used for devices that are specified - in the config file as "usb " */ - }; diff --git a/sane-backends-1.0.18-logical_vs_binary.patch b/sane-backends-1.0.18-logical_vs_binary.patch deleted file mode 100644 index 85254a2..0000000 --- a/sane-backends-1.0.18-logical_vs_binary.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- sane-backends-1.0.18/backend/canon.c.logical_vs_binary 2006-06-19 23:07:52.000000000 +0200 -+++ sane-backends-1.0.18/backend/canon.c 2007-04-24 09:08:56.000000000 +0200 -@@ -246,12 +246,12 @@ - TPU_STAT_INACTIVE : TPU_STAT_NONE; - if (dev->tpu.Status == SANE_TRUE) /* TPU available */ - { -- dev->tpu.Status = (tbuf[2 + 4 + 5] && 0x04) ? -+ dev->tpu.Status = (tbuf[2 + 4 + 5] & 0x04) ? - TPU_STAT_INACTIVE : TPU_STAT_ACTIVE; - } -- dev->tpu.ControlMode = tbuf[3 + 4 + 5] && 0x03; -+ dev->tpu.ControlMode = tbuf[3 + 4 + 5] & 0x03; - dev->tpu.Transparency = tbuf[4 + 4 + 5] * 256 + tbuf[5 + 4 + 5]; -- dev->tpu.PosNeg = tbuf[6 + 4 + 5] && 0x01; -+ dev->tpu.PosNeg = tbuf[6 + 4 + 5] & 0x01; - dev->tpu.FilmType = tbuf[7 + 4 + 5]; - - DBG (11, "TPU Status: %d\n", dev->tpu.Status); diff --git a/sane-backends-1.0.18-udev-098.patch b/sane-backends-1.0.18-udev-098.patch deleted file mode 100644 index 88c184e..0000000 --- a/sane-backends-1.0.18-udev-098.patch +++ /dev/null @@ -1,83 +0,0 @@ ---- sane-backends-1.0.18/tools/sane-desc.c.udev-098 2007-08-07 14:56:03.000000000 +0200 -+++ sane-backends-1.0.18/tools/sane-desc.c 2007-08-08 12:45:27.000000000 +0200 -@@ -3153,14 +3153,14 @@ print_udev_header (void) - ("#\n" - "# udev rules file for supported USB devices\n" - "#\n" -- "# To add a USB device, add a rule to the list below between the SUBSYSTEM...\n" -- "# and LABEL... lines.\n" -+ "# To add support for a USB device, add rules to the \"usb\" and \"usb_device\"\n" -+ "# lists below between their respective \"# BEGIN ...\" and \"# END ...\" lines.\n" - "#\n" - "# To run a script when your device is plugged in, add RUN=\"/path/to/script\"\n" -- "# to the appropriate rule.\n"); -+ "# to the appropriate rules.\n"); - printf - ("#\n" -- "# The following list already contains a lot of scanners. If your scanner\n" -+ "# The following lists already contains a lot of scanners. If your scanner\n" - "# isn't mentioned there, add it as explained above and mail the entry to\n" - "# the sane-devel mailing list (sane-devel@lists.alioth.debian.org).\n" - "#\n"); -@@ -3169,11 +3169,44 @@ print_udev_header (void) - static void - print_udev (void) - { -- usbid_type *usbid = create_usbids_table (); -+ usbid_type *usbid_first = create_usbids_table (); -+ usbid_type *usbid = usbid_first; - - print_udev_header (); -+ - printf ("\nACTION!=\"add\", GOTO=\"libsane_rules_end\"\n"); -- printf ("SUBSYSTEM!=\"usb_device\", GOTO=\"libsane_rules_end\"\n\n"); -+ printf ("\nATTR{dev}!=\"?*\", GOTO=\"libsane_rules_end\"\n"); -+ printf ("SUBSYSTEM==\"usb\", GOTO=\"libsane_usb_rules\"\n"); -+ printf ("SUBSYSTEM==\"usb_device\", GOTO=\"libsane_usb_device_rules\"\n\n"); -+ printf ("GOTO=\"libsane_rules_end\"\n\n"); -+ -+ /* SUBSYSTEM=="usb" -> ATTR{} */ -+ printf ("LABEL=\"libsane_usb_rules\"\n\n"); -+ printf ("# BEGIN scanner rules for SUBSYSTEM==\"usb\"\n"); -+ while (usbid) -+ { -+ manufacturer_model_type * name = usbid->name; -+ -+ printf ("# "); -+ while (name) -+ { -+ if (name != usbid->name) -+ printf (" | "); -+ printf ("%s", name->name); -+ name = name->next; -+ } -+ printf ("\n"); -+ printf ("ATTR{idVendor}==\"%s\", ATTR{idProduct}==\"%s\", SYMLINK+=\"scanner-%%k\"\n", -+ usbid->usb_vendor_id + 2, usbid->usb_product_id + 2); -+ usbid = usbid->next; -+ } -+ printf ("# END scanner rules for SUBSYSTEM==\"usb\"\n"); -+ printf ("GOTO=\"libsane_rules_end\"\n\n"); -+ -+ /* SUBSYSTEM=="usb_device" -> ATTRS{} */ -+ printf ("LABEL=\"libsane_usb_device_rules\"\n\n"); -+ printf ("# BEGIN scanner rules for SUBSYSTEM==\"usb_device\"\n"); -+ usbid = usbid_first; - while (usbid) - { - manufacturer_model_type * name = usbid->name; -@@ -3187,10 +3220,13 @@ print_udev (void) - name = name->next; - } - printf ("\n"); -- printf ("SYSFS{idVendor}==\"%s\", SYSFS{idProduct}==\"%s\", SYMLINK+=\"scanner-%%k\"\n", -+ printf ("ATTRS{idVendor}==\"%s\", ATTRS{idProduct}==\"%s\", SYMLINK+=\"scanner-%%k\"\n", - usbid->usb_vendor_id + 2, usbid->usb_product_id + 2); - usbid = usbid->next; - } -+ printf ("# END scanner rules for SUBSYSTEM==\"usb_device\"\n"); -+ printf ("GOTO=\"libsane_rules_end\"\n"); -+ - printf ("\nLABEL=\"libsane_rules_end\"\n"); - } - diff --git a/sane-backends-1.0.18-udev-symlink.patch b/sane-backends-1.0.18-udev-symlink.patch deleted file mode 100644 index ccd5d21..0000000 --- a/sane-backends-1.0.18-udev-symlink.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- sane-backends-1.0.18/tools/sane-desc.c.udev-symlink 2006-05-31 18:31:56.000000000 +0200 -+++ sane-backends-1.0.18/tools/sane-desc.c 2007-07-22 23:22:21.000000000 +0200 -@@ -3187,7 +3187,7 @@ print_udev (void) - name = name->next; - } - printf ("\n"); -- printf ("SYSFS{idVendor}==\"%s\", SYSFS{idProduct}==\"%s\", MODE=\"660\", GROUP=\"scanner\"\n", -+ printf ("SYSFS{idVendor}==\"%s\", SYSFS{idProduct}==\"%s\", SYMLINK+=\"scanner-%%k\"\n", - usbid->usb_vendor_id + 2, usbid->usb_product_id + 2); - usbid = usbid->next; - } diff --git a/sane-backends-1.0.18-usb_reset.patch b/sane-backends-1.0.18-usb_reset.patch deleted file mode 100644 index 343abd6..0000000 --- a/sane-backends-1.0.18-usb_reset.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- sane-backends-1.0.18/sanei/sanei_usb.c.usb_reset 2006-05-26 21:38:46.000000000 +0200 -+++ sane-backends-1.0.18/sanei/sanei_usb.c 2007-06-15 15:16:50.000000000 +0200 -@@ -1255,6 +1255,9 @@ sanei_usb_close (SANE_Int dn) - usb_resetep (devices[dn].libusb_handle, devices[dn].bulk_out_ep); - usb_resetep (devices[dn].libusb_handle, devices[dn].iso_in_ep); - #endif -+ /* Hack to work around hanging USB hardware */ -+ usb_reset (devices[dn].libusb_handle); -+ - usb_release_interface (devices[dn].libusb_handle, - devices[dn].interface_nr); - usb_close (devices[dn].libusb_handle); diff --git a/sane-backends-1.0.19-pkgconfig.patch b/sane-backends-1.0.19-pkgconfig.patch new file mode 100644 index 0000000..6fbfac3 --- /dev/null +++ b/sane-backends-1.0.19-pkgconfig.patch @@ -0,0 +1,291 @@ +diff -U0 sane-backends-20080206/ChangeLog.pkgconfig sane-backends-20080206/ChangeLog +--- sane-backends-20080206/ChangeLog.pkgconfig 2008-02-04 02:20:01.000000000 +0100 ++++ sane-backends-20080206/ChangeLog 2008-02-06 11:49:41.000000000 +0100 +@@ -0,0 +1,7 @@ ++2006-05-16 Nils Philippsen ++ ++ * acinclude.m4 configure.in tools/sane-config.in ++ tools/sane-backends.pc.in tools/Makefile.in: add pkg-config support, ++ re-write sane-config to use pkg-config to avoid multilib problems with ++ conflicting sane-config scripts ++ +diff -up sane-backends-20080206/acinclude.m4.pkgconfig sane-backends-20080206/acinclude.m4 +--- sane-backends-20080206/acinclude.m4.pkgconfig 2007-11-10 08:12:54.000000000 +0100 ++++ sane-backends-20080206/acinclude.m4 2008-02-06 11:49:41.000000000 +0100 +@@ -194,6 +194,7 @@ unset param + # Checks for ieee1284 library, needed for canon_pp backend. + AC_DEFUN([SANE_CHECK_IEEE1284], + [ ++ AC_SUBST(IEEE1284_LIBS) + AC_CHECK_HEADER(ieee1284.h, [ + AC_CACHE_CHECK([for libieee1284 >= 0.1.5], sane_cv_use_libieee1284, [ + AC_TRY_COMPILE([#include ], [ +@@ -206,6 +207,7 @@ AC_DEFUN([SANE_CHECK_IEEE1284], + ],) + if test "$sane_cv_use_libieee1284" = "yes" ; then + AC_DEFINE(HAVE_LIBIEEE1284,1,[Define to 1 if you have the `ieee1284' library (-lcam).]) ++ AC_SUBST(IEEE1284_LIBS, "-lieee1284") + fi + ]) + +@@ -213,6 +215,7 @@ AC_DEFUN([SANE_CHECK_IEEE1284], + # Checks for pthread support + AC_DEFUN([SANE_CHECK_PTHREAD], + [ ++ AC_SUBST(PTHREAD_LIBS) + + case "${host_os}" in + darwin*) # currently only enabled on MacOS X +@@ -246,6 +249,7 @@ AC_DEFUN([SANE_CHECK_PTHREAD], + [Define if pthreads should be used instead of forked processes.]) + fi + if test "$have_pthread" = "yes" ; then ++ AC_SUBST(PTHREAD_LIBS, "-lpthread") + CPPFLAGS="${CPPFLAGS} -D_REENTRANT" + fi + AC_MSG_CHECKING([whether to enable pthread support]) +@@ -259,6 +263,7 @@ AC_DEFUN([SANE_CHECK_PTHREAD], + # GPHOTO2 and dell1600n_net backends. + AC_DEFUN([SANE_CHECK_JPEG], + [ ++ AC_SUBST(JPEG_LIBS) + AC_CHECK_LIB(jpeg,jpeg_start_decompress, + [ + AC_CHECK_HEADER(jconfig.h, +@@ -271,7 +276,7 @@ AC_DEFUN([SANE_CHECK_JPEG], + sane_correct_jpeg_lib_version_found + #endif + ],[sane_cv_use_libjpeg="yes"; LIBS="${LIBS} -ljpeg"; +- AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) ++ AC_SUBST(JPEG_LIBS, "-ljpeg") AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) + ],) + ],) + ]) +@@ -425,6 +430,7 @@ AC_CHECK_TYPE(u_long, unsigned long) + # Checks for gphoto2 libs, needed by gphoto2 backend + AC_DEFUN([SANE_CHECK_GPHOTO2], + [ ++ AC_SUBST(PC_REQS) + AC_ARG_WITH(gphoto2, + AC_HELP_STRING([--with-gphoto2], + [include the gphoto2 backend @<:@default=yes@:>@]), +@@ -454,6 +460,7 @@ AC_DEFUN([SANE_CHECK_GPHOTO2], + LDFLAGS="$LDFLAGS $GPHOTO2_LDFLAGS" + + AC_SUBST(GPHOTO2_LDFLAGS) ++ AC_SUBST(PC_REQS, "libgphoto2 $PC_REQS") + + saved_LIBS="${LIBS}" + LIBS="${LIBS} ${GPHOTO2_LIBS}" +diff -up /dev/null sane-backends-20080206/tools/sane-backends.pc.in +--- /dev/null 2008-02-01 17:10:39.395027948 +0100 ++++ sane-backends-20080206/tools/sane-backends.pc.in 2008-02-06 11:49:41.000000000 +0100 +@@ -0,0 +1,14 @@ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++libdir=@libdir@ ++includedir=@includedir@ ++ ++pc_libs=@RESMGR_LIBS@ @DL_LIB@ @IEEE1284_LIBS@ @PTHREAD_LIBS@ @JPEG_LIBS@ @PC_LIBS@ ++pc_reqs=@PC_REQS@ ++ ++Name: SANE Backends ++Description: Backends for SANE, the universal scanner interface ++Version: @VERSION@ ++Requires: ${pc_reqs} ++Libs: -L${libdir} -lsane ${pc_libs} ++Cflags: +diff -up sane-backends-20080206/tools/sane-config.in.pkgconfig sane-backends-20080206/tools/sane-config.in +--- sane-backends-20080206/tools/sane-config.in.pkgconfig 2008-02-06 11:49:41.000000000 +0100 ++++ sane-backends-20080206/tools/sane-config.in 2008-02-06 11:52:03.000000000 +0100 +@@ -7,31 +7,9 @@ + PACKAGE="@PACKAGE@" + scriptname="sane-config" + +-LINKER_RPATH="" +- + prefix="@prefix@" + exec_prefix="@exec_prefix@" + +-LIBS="@LIBS@ @DL_LIB@" +-pkgincludedir="@pkgincludedir@" +-pkglibdir="@pkglibdir@" +-includedir="@includedir@" +-mandir="@mandir@" +-infodir="@infodir@" +-libdir="@libdir@" +-localstatedir="@localstatedir@" +-sysconfdir="@sysconfdir@" +-datarootdir="@datarootdir@" +-datadir="@datadir@" +-libexecdir="@libexecdir@" +-sbindir="@sbindir@" +-bindir="@bindir@" +-#${prefix} +-#exec_prefix_set=no +-srcdir="@srcdir@" +-top_srcdir="@top_srcdir@" +-cflags= +- + usage () + { + echo "Usage: " 1>&2 +@@ -84,27 +62,13 @@ if test $# -gt 0; then + exit 1 + ;; + --ldflags) +- +- if test -z "$LINKER_RPATH"; then +- echo "-L${libdir} @GPHOTO2_LDFLAGS@" +- else +- echo "-L${libdir} @GPHOTO2_LDFLAGS@ ${LINKER_RPATH}${libdir}" +- fi ++ pkg-config --libs-only-L sane-backends + ;; + --libs) +- echo "-lsane ${LIBS}" ++ pkg-config --libs sane-backends + ;; + --cflags) +- unique_cflags= +- if test "${includedir}" != "/usr/include"; then +- unique_cflags="${unique_cflags} -I${includedir}" +- fi +- for i in $cflags; do +- if test "${i}" != "-I${includedir}"; then +- unique_cflags="${unique_cflags} $i" +- fi +- done +- echo ${unique_cflags} ++ pkg-config --cflags sane-backends + ;; + --prefix) + echo ${prefix} +diff -up sane-backends-20080206/tools/Makefile.in.pkgconfig sane-backends-20080206/tools/Makefile.in +--- sane-backends-20080206/tools/Makefile.in.pkgconfig 2008-02-03 07:59:36.000000000 +0100 ++++ sane-backends-20080206/tools/Makefile.in 2008-02-06 11:49:41.000000000 +0100 +@@ -26,6 +26,7 @@ mandir = @mandir@ + includedir = @includedir@ + oldincludedir = /usr/include + configdir = ${sysconfdir}/sane.d ++pkgconfigdir = ${libdir}/pkgconfig + + MKDIR = $(top_srcdir)/mkinstalldirs + INSTALL = @INSTALL@ +@@ -74,7 +75,8 @@ LIBLIB = ../lib/liblib.a + + DISTFILES = Makefile.in RenSaneDlls.cmd README libtool-get-dll-ext \ + mustek600iin-off.c sane-config.in sane-desc.c check-usb-chip.c \ +- sane-find-scanner.c umax_pp.c xerox gamma4scanimage.c check-po.awk ++ sane-find-scanner.c umax_pp.c xerox gamma4scanimage.c check-po.awk \ ++ sane-backends.pc.in + + SUBDIRS = hotplug hotplug-ng udev hal + +@@ -88,18 +90,24 @@ SUBDIRS = hotplug hotplug-ng udev hal + + all: $(DESTINATIONS) + +-install: sane-config sane-find-scanner gamma4scanimage ++install: sane-config sane-backends.pc sane-find-scanner gamma4scanimage ++ $(MKDIR) $(DESTDIR)$(bindir) $(DESTDIR)$(pkgconfigdir) ++ $(INSTALL_DATA) sane-backends.pc $(DESTDIR)$(pkgconfigdir)/sane-backends.pc + $(INSTALL_SCRIPT) sane-config $(DESTDIR)$(bindir)/sane-config + $(INSTALL_PROGRAM) sane-find-scanner $(DESTDIR)$(bindir)/sane-find-scanner + $(INSTALL_PROGRAM) gamma4scanimage $(DESTDIR)$(bindir)/gamma4scanimage + + uninstall: +- rm -f $(bindir)/sane-config $(bindir)/sane-find-scanner $(bindir)/gamma4scanimage ++ rm -f $(bindir)/sane-config $(bindir)/sane-find-scanner $(bindir)/gamma4scanimage $(pkgconfigdir)/sane-backends.pc + + sane-config: sane-config.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + ++sane-backends.pc: sane-backends.pc.in $(top_builddir)/config.status ++ cd $(top_builddir) \ ++ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status ++ + sane-find-scanner: sane-find-scanner.o check-usb-chip.o ../backend/sane_strstatus.lo \ + ../sanei/sanei_scsi.lo ../sanei/sanei_usb.lo ../sanei/sanei_init_debug.lo \ + ../sanei/sanei_config.lo +diff -up sane-backends-20080206/configure.in.pkgconfig sane-backends-20080206/configure.in +--- sane-backends-20080206/configure.in.pkgconfig 2008-02-02 13:20:45.000000000 +0100 ++++ sane-backends-20080206/configure.in 2008-02-06 11:49:41.000000000 +0100 +@@ -52,6 +52,7 @@ AC_PROG_INSTALL + AC_PROG_MAKE_SET + AC_PROG_CPP + AC_PROG_GCC_TRADITIONAL ++PKG_PROG_PKG_CONFIG + AC_PATH_PROG(SANE_CONFIG_PATH, sane-config, no) + AC_PATH_PROG(MSGFMT, msgfmt$EXEEXT, no) + AC_PATH_PROG(XGETTEXT, xgettext$EXEEXT, no) +@@ -99,6 +100,8 @@ dnl Checks for libraries + dnl *********************************************************************** + SANE_CHECK_DLL_LIB + dnl Checks for Backend libraries. ++_pc_libs_save="$LIBS" ++LIBS="" + AC_CHECK_LIB(m,sqrt) + AC_CHECK_LIB(scsi, scsireq_enter) # FreeBSD needs this + AC_CHECK_LIB(cam, cam_open_device) # FreeBSD 3+ needs this +@@ -109,6 +112,8 @@ if test "`uname`" != "IRIX" -a "`uname`" + AC_SEARCH_LIBS(socket, socket) + AC_SEARCH_LIBS(syslog, syslog be) # OS/2 needs -lsyslog, BeOS needs -lbe + fi ++AC_SUBST(PC_LIBS, "$LIBS") ++LIBS="$LIBS $_pc_libs_save" + SANE_CHECK_JPEG + SANE_CHECK_TIFF + SANE_CHECK_IEEE1284 +@@ -139,19 +144,23 @@ AC_CHECK_HEADERS([io/cam/cam.h],,,[#incl + + SANE_CHECK_MISSING_HEADERS + ++AC_SUBST(RESMGR_LIBS) + AC_CHECK_HEADER(resmgr.h,[ + AC_CHECK_LIB( + resmgr, + rsm_open_device,[ + AC_DEFINE(HAVE_RESMGR,1,[define if you have the resmgr library]) + LIBS="$LIBS -lresmgr" ++ AC_SUBST(RESMGR_LIBS, "-lresmgr") + ] + ) + ]) + ++AC_SUBST(USBCALLS_LIBS) + AC_CHECK_HEADER(usbcalls.h,[ + AC_DEFINE(HAVE_USBCALLS,1,[define if you have the usbcalls library]) + LIBS="$LIBS -lusbcalls" ++ AC_SUBST(USBCALLS_LIBS, "-lusbcalls") + ],,[ + #include + #include ]) +@@ -279,6 +288,7 @@ if test -c /dev/urandom ; then + fi + + dnl libusb on enabled by default (if found) ++AC_SUBST(PC_REQS) + USE_LIBUSB=yes + AC_ARG_ENABLE(libusb, + AC_HELP_STRING([--disable-libusb], +@@ -294,6 +304,10 @@ if test "${ac_cv_header_usb_h}" = "yes" + AC_CHECK_LIB(usb, usb_interrupt_read) + if test "${ac_cv_lib_usb_usb_interrupt_read}" = "yes" ; then + HAVE_LIBUSB="yes" ++ PKG_CHECK_MODULES(LIBUSB, libusb) ++ if test "${LIBUSB_LIBS}"; then ++ AC_SUBST(PC_REQS, "libusb $PC_REQS") ++ fi + fi + fi + +@@ -560,6 +574,7 @@ AC_CONFIG_FILES([Makefile lib/Makefile s + japi/Makefile backend/Makefile include/Makefile doc/Makefile \ + po/Makefile testsuite/Makefile tools/Makefile doc/doxygen-sanei.conf]) + AC_CONFIG_FILES([tools/sane-config], [chmod a+x tools/sane-config]) ++AC_CONFIG_FILES([tools/sane-backends.pc]) + AC_OUTPUT + + dnl *********************************************************************** diff --git a/sane-backends-1.0.19-policykit.patch b/sane-backends-1.0.19-policykit.patch new file mode 100644 index 0000000..092f262 --- /dev/null +++ b/sane-backends-1.0.19-policykit.patch @@ -0,0 +1,38 @@ +diff -up sane-backends-20080206/tools/sane-desc.c.policykit sane-backends-20080206/tools/sane-desc.c +--- sane-backends-20080206/tools/sane-desc.c.policykit 2007-07-29 20:39:54.000000000 +0200 ++++ sane-backends-20080206/tools/sane-desc.c 2008-02-07 10:41:07.000000000 +0100 +@@ -3226,7 +3226,7 @@ print_udev (void) + } + } + printf ("\n"); +- printf ("SYSFS{idVendor}==\"%s\", SYSFS{idProduct}==\"%s\", MODE=\"0664\", GROUP=\"scanner\", ENV{libsane_matched}=\"yes\"\n", ++ printf ("SYSFS{idVendor}==\"%s\", SYSFS{idProduct}==\"%s\", MODE=\"0664\", ENV{libsane_matched}=\"yes\"\n", + usbid->usb_vendor_id + 2, usbid->usb_product_id + 2); + usbid = usbid->next; + } +@@ -3279,7 +3279,7 @@ print_hal (void) + printf ("\n"); + printf ("\n"); + printf (" \n"); +- printf (" \n"); ++ printf (" \n"); + while (usbid) + { + manufacturer_model_type * name = usbid->name; +@@ -3295,10 +3295,12 @@ print_hal (void) + i++; + } + printf (" -->\n"); +- printf (" \n", usbid->usb_vendor_id); +- printf (" \n", usbid->usb_product_id); +- printf (" scanner\n"); +- printf (" proprietary\n"); ++ printf (" \n", usbid->usb_vendor_id); ++ printf (" \n", usbid->usb_product_id); ++ printf (" access_control\n"); ++ printf (" linux.device_file\n"); ++ printf (" scanner\n"); ++ printf (" hal-usb-scanner-add\n"); + printf (" \n"); + printf (" \n"); + usbid = usbid->next; diff --git a/sane-backends-multilib.patch b/sane-backends-multilib.patch deleted file mode 100644 index 98c2677..0000000 --- a/sane-backends-multilib.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- sane-backends-1.0.14/doc/Makefile.in.multilib 2004-10-10 09:29:29.277170282 +0100 -+++ sane-backends-1.0.14/doc/Makefile.in 2004-10-10 09:30:33.036979143 +0100 -@@ -111,7 +111,7 @@ - @sed -e 's|@DATADIR@|$(datadir)|g' \ - -e 's|@CONFIGDIR@|$(configdir)|g' \ - -e 's|@DOCDIR@|$(docdir)|g' \ -- -e 's|@LIBDIR@|$(libdir)/sane|g' \ -+ -e 's|@LIBDIR@|/usr/lib*/sane|g' \ - -e 's|@BINDIR@|$(bindir)|g' \ - -e 's|@SBINDIR@|$(sbindir)|g' \ - -e 's|@PACKAGEVERSION@|$(package_version)|g' $^ >$@ diff --git a/sane-backends.spec b/sane-backends.spec index 0713fc1..b3d3b74 100644 --- a/sane-backends.spec +++ b/sane-backends.spec @@ -19,30 +19,24 @@ %bcond_without docs_split %endif -%if 0%{?fedora} >= 7 || 0%{?rhel} >= 6 -%bcond_without udev_098 -%else -%bcond_with udev_098 -%endif - Summary: Scanner access software Name: sane-backends -Version: 1.0.18 -Release: 21%{?dist} +Version: 1.0.19 +%define cvsver 20080206 +Release: 0.1.cvs%{cvsver}%{?dist} License: GPL (programs), relaxed LGPL (libraries), and public domain (docs) Group: System Environment/Libraries +%if 0%{?cvsver:1} +Source0: sane-%{cvsver}.tar.gz +%else Source0: ftp://ftp.sane-project.org/pub/sane/%{name}-%{version}/%{name}-%{version}.tar.gz +%endif Source1: sane.png -Patch1: sane-backends-1.0.18-rpath.patch -Patch2: sane-backends-1.0.12-badcode.patch -Patch3: sane-backends-multilib.patch -Patch4: sane-backends-1.0.17-pkgconfig.patch -Patch5: sane-backends-1.0.18-logical_vs_binary.patch -Patch6: sane-backends-1.0.18-usb_reset.patch -Patch7: sane-backends-1.0.18-udev-symlink.patch -Patch8: sane-backends-1.0.18-udev-098.patch -Patch9: sane-backends-1.0.18-glibc-2.7.patch -Patch10: sane-backends-1.0.18-epson-cx5000.patch +Source2: hal-usb-scanner-add +Patch0: sane-backends-1.0.18-rpath.patch +Patch1: sane-backends-1.0.19-pkgconfig.patch +Patch2: sane-backends-1.0.18-glibc-2.7.patch +Patch3: sane-backends-1.0.19-policykit.patch URL: http://www.sane-project.org BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%__id_u -n) BuildRequires: tetex-latex @@ -57,11 +51,7 @@ BuildRequires: gettext BuildRequires: gphoto2-devel %endif Requires: pam >= 0.78-2 -%if %{with udev_098} -Requires: udev >= 098 -%else -Requires: udev -%endif +Requires: hal >= 0.4.0 ExcludeArch: s390 s390x %description @@ -124,22 +114,12 @@ want to access digital cameras. %endif %prep -%setup -q - -%patch1 -p1 -b .rpath -%patch2 -p1 -b .badcode -%patch3 -p1 -b .multilib -%patch4 -p1 -b .pkgconfig -%patch5 -p1 -b .logical_vs_binary -%patch6 -p1 -b .usb_reset -%patch7 -p1 -b .udev-symlink - -%if %{with udev_098} -%patch8 -p1 -b .udev-098 -%endif +%setup -q %{?cvsver:-n sane-backends-%{cvsver}} -%patch9 -p1 -b .glibc-2.7 -%patch10 -p1 -b .epson-cx5000 +%patch0 -p1 -b .rpath +%patch1 -p1 -b .pkgconfig +%patch2 -p1 -b .glibc-2.7 +%patch3 -p1 -b .policykit for i in agfafocus avision coolscan2 umax_pp; do iconv -f iso-8859-1 -t utf-8 < "doc/sane-$i.man" > "doc/sane-$i.man_" @@ -149,12 +129,9 @@ done # We patched configure.in, so regenerate configure. sed '/^# libtool\.m4/,$d' < acinclude.m4 > acinclude.m4.new mv -f acinclude.m4{.new,} -libtoolize --force --copy -aclocal -autoconf +autoreconf --install --force %build -%{expand:%%define optflags %{optflags} -DGIMP_ENABLE_COMPAT_CRUFT=1} %configure \ %if %{with gphoto2_support} --with-gphoto2=%{_prefix}\ @@ -162,7 +139,7 @@ autoconf --without-gphoto2 \ %endif --with-docdir=%{_docdir}/%{name}-%{version} -make +make %{?_smp_mflags} %install @@ -176,8 +153,10 @@ rm -f %{buildroot}%{_mandir}/man1/gamma4scanimage.1* rm -f %{buildroot}%{_libdir}/sane/*.a %{buildroot}%{_libdir}/*.a rm -f %{buildroot}%{_libdir}/libsane*.la %{buildroot}%{_libdir}/sane/*.la -mkdir -p %{buildroot}/%{_sysconfdir}/udev/rules.d/ -install -m 0644 tools/udev/libsane.rules %{buildroot}/%{_sysconfdir}/udev/rules.d/60-libsane.rules +mkdir -p %{buildroot}/%{_datadir}/hal/fdi/policy/10osvendor +install -m 0644 tools/hal/libsane.fdi %{buildroot}/%{_datadir}/hal/fdi/policy/10osvendor/60-libsane.fdi +mkdir -p %{buildroot}/%{_libexecdir} +install -m 0755 %{SOURCE2} %{buildroot}/%{_libexecdir}/hal-usb-scanner-add %find_lang %name @@ -197,7 +176,8 @@ rm -rf %{buildroot} %defattr(-,root,root) %dir /etc/sane.d %config(noreplace) /etc/sane.d/* -%{_sysconfdir}/udev/rules.d/* +%{_datadir}/hal/fdi/policy/10osvendor/*.fdi +%{_libexecdir}/hal-usb-scanner-add %{_mandir}/*/* %{_datadir}/pixmaps/sane.png @@ -260,6 +240,13 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/sane-backends.pc %changelog +* Wed Feb 06 2008 Nils Philippsen - 1.0.19-0.1.cvs20080206 +- cvs snapshot 20080206 +- handle access control through hal/PolicyKit instead of udev (#405211) +- drop obsolete badcode, logical_vs_binary, epson-cx5000, multilib, usb_reset, + udev-symlink, udev-098 patches +- update pkgconfig patch + * Wed Jan 30 2008 Nils Philippsen - 1.0.18-21 - don't require libsane-hpaio (#430834) - use %%bcond_without/with macros