]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
sane: New package.
authorSchantl Stefan <Stevee@ipfire.org>
Fri, 26 Feb 2010 20:15:51 +0000 (21:15 +0100)
committerSchantl Stefan <Stevee@ipfire.org>
Fri, 26 Feb 2010 20:15:51 +0000 (21:15 +0100)
pkgs/core/sane/patches/sane-1.0.20-lockdir.patch [new file with mode: 0644]
pkgs/core/sane/patches/sane-1.0.20-pkgconfig.patch [new file with mode: 0644]
pkgs/core/sane/patches/sane-1.0.20-rpath.patch [new file with mode: 0644]
pkgs/core/sane/patches/sane-1.0.20-udev.patch [new file with mode: 0644]
pkgs/core/sane/sane.nm [new file with mode: 0644]

diff --git a/pkgs/core/sane/patches/sane-1.0.20-lockdir.patch b/pkgs/core/sane/patches/sane-1.0.20-lockdir.patch
new file mode 100644 (file)
index 0000000..8839976
--- /dev/null
@@ -0,0 +1,30 @@
+commit 1e12605eac293b12809ca2933622acc54515c237
+Author: Nils Philippsen <nils@redhat.com>
+Date:   Mon Dec 28 17:00:25 2009 +0100
+
+    patch: lockdir
+    
+    Squashed commit of the following:
+    
+    commit 7d26ebc2c0c0c8a8e3254834a700951b49648eeb
+    Author: Nils Philippsen <nils@redhat.com>
+    Date:   Mon Dec 28 16:58:36 2009 +0100
+    
+        improve install-lockpath target
+    
+        make robust against problems with setting group on sane lock dir
+
+diff --git a/backend/Makefile.am b/backend/Makefile.am
+index 5165423..3c22cd4 100644
+--- a/backend/Makefile.am
++++ b/backend/Makefile.am
+@@ -137,7 +137,8 @@ install-firmware-path:
+         done
+ install-lockpath:
+-      $(mkinstalldirs) -m 775 -g $(LOCKPATH_GROUP) $(DESTDIR)$(locksanedir)
++      $(mkinstalldirs) -m 775 -g $(LOCKPATH_GROUP) $(DESTDIR)$(locksanedir) || \
++              $(mkinstalldirs) -m 775 $(DESTDIR)$(locksanedir)
+ uninstall-hook:
+       rm -rf $(DESTDIR)$(libdir)/sane $(DESTDIR)$(configdir) $(DESTDIR)$(locksanedir)
diff --git a/pkgs/core/sane/patches/sane-1.0.20-pkgconfig.patch b/pkgs/core/sane/patches/sane-1.0.20-pkgconfig.patch
new file mode 100644 (file)
index 0000000..d69ace9
--- /dev/null
@@ -0,0 +1,211 @@
+From ce4539752ed502cb1a5e10fa47890f42db964472 Mon Sep 17 00:00:00 2001
+From: Nils Philippsen <nils@redhat.com>
+Date: Fri, 26 Feb 2010 18:20:41 +0100
+Subject: [PATCH] patch: pkgconfig
+
+Squashed commit of the following:
+
+commit 1f0e85c705a42c7e6ccd938eaad69f531c63f63d
+Author: Nils Philippsen <nils@redhat.com>
+Date:   Fri Feb 26 17:51:14 2010 +0100
+
+    pkgconfig file is data
+
+commit 52ef5f47ccc0128c78ab3ad38ac7b7918dd7ac88
+Author: Nils Philippsen <nils@redhat.com>
+Date:   Wed Jun 17 13:09:51 2009 +0200
+
+    make sane-config multilib-aware on Linux
+
+commit 7787640dd567b93dd0a458fd5fb662bb7b85ff36
+Author: Nils Philippsen <nils@redhat.com>
+Date:   Fri Jun 5 12:55:39 2009 +0200
+
+    use pkg-config in sane-config
+---
+ configure.in              |    3 ++
+ tools/Makefile.am         |   14 +++++++++-
+ tools/sane-backends.pc.in |   14 ++++++++++
+ tools/sane-config.in      |   64 +++++++++++++++++++++++++++++++++++----------
+ 4 files changed, 80 insertions(+), 15 deletions(-)
+ create mode 100644 tools/sane-backends.pc.in
+
+diff --git a/configure.in b/configure.in
+index 126edbf..7199c44 100644
+--- a/configure.in
++++ b/configure.in
+@@ -161,6 +161,8 @@ AC_CHECK_HEADER(resmgr.h,[
+               rsm_open_device,[
+                       AC_DEFINE(HAVE_RESMGR,1,[define if you have the resmgr library])
+                       LIBS="$LIBS -lresmgr"
++            RESMGR_LIB="-lresmgr"
++            AC_SUBST(RESMGR_LIB)
+               ]
+       )
+ ])
+@@ -673,6 +675,7 @@ AC_CONFIG_FILES([Makefile lib/Makefile sanei/Makefile frontend/Makefile \
+   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/tools/Makefile.am b/tools/Makefile.am
+index 0932e45..b7fa670 100644
+--- a/tools/Makefile.am
++++ b/tools/Makefile.am
+@@ -7,6 +7,10 @@
+ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_builddir)/include \
+  -I$(top_srcdir)/include
++SUFFIXES = .pc.in .pc
++
++pkgconfigdir = ${libdir}/pkgconfig
++
+ bin_PROGRAMS = sane-find-scanner gamma4scanimage
+ noinst_PROGRAMS = sane-desc umax_pp
+@@ -26,8 +30,14 @@ noinst_SCRIPTS = $(HOTPLUG)
+ BUILT_SOURCES = $(HOTPLUG_DIR)
+ CLEANFILES = $(bin_SCRIPTS) $(dist_noinst_SCRIPTS)
++pkgconfig_DATA = sane-backends.pc
++
++.pc.in.pc:
++      cd $(top_builddir) \
++              && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
++
+ EXTRA_DIST = check-po.awk libtool-get-dll-ext mustek600iin-off.c \
+-           RenSaneDlls.cmd README xerox
++           RenSaneDlls.cmd README xerox sane-backends.pc.in
+ sane_find_scanner_SOURCES = sane-find-scanner.c check-usb-chip.c \
+                           ../backend/sane_strstatus.c
+@@ -72,5 +82,7 @@ hal/libsane.fdi: $(wildcard ${top_srcdir}/doc/descriptions/*.desc) $(wildcard ${
+       @./sane-desc -m hal -s ${top_srcdir}/doc/descriptions:${top_srcdir}/doc/descriptions-external \
+          -d 0 > $@
++sane-backends.pc:     $(top_builddir)/config.status
++
+ clean-local:
+       rm -f $(HOTPLUG)
+diff --git a/tools/sane-backends.pc.in b/tools/sane-backends.pc.in
+new file mode 100644
+index 0000000..fb64e3b
+--- /dev/null
++++ b/tools/sane-backends.pc.in
+@@ -0,0 +1,14 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++pc_libs=@RESMGR_LIB@ @DL_LIBS@ @IEEE1284_LIBS@ @PTHREAD_LIBS@ @JPEG_LIBS@ @USB_LIBS@
++pc_reqs=libusb
++
++Name: SANE Backends
++Description: Backends for SANE, the universal scanner interface
++Version: @VERSION@
++Requires: ${pc_reqs}
++Libs: -L${libdir} -lsane ${pc_libs}
++Cflags:
+diff --git a/tools/sane-config.in b/tools/sane-config.in
+index 85add1a..c0450d4 100644
+--- a/tools/sane-config.in
++++ b/tools/sane-config.in
+@@ -18,7 +18,7 @@ pkglibdir="@pkglibdir@"
+ includedir="@includedir@"
+ mandir="@mandir@"
+ infodir="@infodir@"
+-libdir="@libdir@"
++#libdir=
+ localstatedir="@localstatedir@"
+ sysconfdir="@sysconfdir@"
+ datarootdir="@datarootdir@"
+@@ -32,6 +32,30 @@ srcdir="@srcdir@"
+ top_srcdir="@top_srcdir@"
+ cflags=
++pkgconfig_package=sane-backends
++use_pkgconfig=0
++if test -x "@bindir@/pkg-config" && "@bindir@/pkg-config" --exists "$pkgconfig_package"; then
++    use_pkgconfig=1
++else
++    libdir=
++    if kernel="`uname -s 2>/dev/null`"; then
++        case "$kernel" in
++            Linux)
++            if hw="`uname -i 2>/dev/null`"; then
++                case "$hw" in
++                    *64)
++                    libdir="@exec_prefix@/lib64"
++                    ;;
++                esac
++            fi
++            ;;
++        esac
++    fi
++    if test "x$libdir" = "x"; then
++        libdir="@exec_prefix@/lib"
++    fi
++fi
++
+ usage ()
+ {
+   echo "Usage: "  1>&2
+@@ -85,26 +109,38 @@ if test $# -gt 0; then
+       ;;
+     --ldflags)
+-      if test -z "$LINKER_RPATH"; then
+-        echo "-L${libdir}"
++      if test "x$use_pkgconfig" = "x0"; then
++        if test -z "$LINKER_RPATH"; then
++          echo "-L${libdir}"
++        else
++          echo "-L${libdir} ${LINKER_RPATH}${libdir}"
++        fi
+       else
+-        echo "-L${libdir} ${LINKER_RPATH}${libdir}"
++        pkg-config --libs-only-L "$pkgconfig_package"
+       fi
+       ;;
+     --libs)
+-      echo "-lsane ${LIBS}"
++      if test "x$use_pkgconfig" = "x0"; then
++        echo "-lsane ${LIBS}"
++      else
++        pkg-config --libs "$pkgconfig_package"
++      fi
+       ;;
+     --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"
++      if test "x$use_pkgconfig" = "x0"; then
++        unique_cflags=
++        if test "${includedir}" != "/usr/include"; then
++          unique_cflags="${unique_cflags} -I${includedir}"
+         fi
+-      done
+-      echo ${unique_cflags}
++        for i in $cflags; do
++          if test "${i}" != "-I${includedir}"; then
++            unique_cflags="${unique_cflags} $i"
++          fi
++        done
++        echo ${unique_cflags}
++      else
++        pkg-config --cflags "$pkgconfig_package"
++      fi
+       ;;
+     --prefix)
+       echo ${prefix}
+-- 
+1.6.6.1
+
diff --git a/pkgs/core/sane/patches/sane-1.0.20-rpath.patch b/pkgs/core/sane/patches/sane-1.0.20-rpath.patch
new file mode 100644 (file)
index 0000000..3e564f9
--- /dev/null
@@ -0,0 +1,69 @@
+commit fe1456e2431a3b8bd27aadc5bbc6998ebc8cd00c
+Author: Nils Philippsen <nils@redhat.com>
+Date:   Mon Aug 31 16:38:23 2009 +0200
+
+    patch: rpath
+    
+    Squashed commit of the following:
+    
+    commit c37206c9fa724e19f6929d8a77e5399ca6b87f1f
+    Author: Nils Philippsen <nils@redhat.com>
+    Date:   Mon Aug 31 16:34:42 2009 +0200
+    
+        fix --enable-rpath
+    
+    commit be2982b2d1ae4d889b4cecec289336b4b03579aa
+    Author: Nils Philippsen <nils@redhat.com>
+    Date:   Tue Jun 2 16:12:23 2009 +0200
+    
+        add --enable-rpath to configure.in
+    
+        make using runtime library search path configurable
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 6413b60..b2bb065 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -383,19 +383,29 @@ dnl
+ AC_DEFUN([SANE_LINKER_RPATH],
+ [dnl AC_REQUIRE([AC_SUBST])dnl This line resulted in an empty AC_SUBST() !!
+-  AC_CACHE_CHECK([linker parameter to set runtime link path], my_cv_LINKER_RPATH,
+-    [my_cv_LINKER_RPATH=
+-    case "$host_os" in
+-    linux* | freebsd* | netbsd* | openbsd* | irix*)
+-      # I believe this only works with GNU ld [pere 2001-04-16]
+-      my_cv_LINKER_RPATH="-Wl,-rpath,"
+-      ;;
+-    solaris*)
+-      my_cv_LINKER_RPATH="-R "
+-      ;;
+-    esac
+-    ])
+-    LINKER_RPATH="$my_cv_LINKER_RPATH"
++  AC_MSG_CHECKING([whether runtime link path should be used])
++  AC_ARG_ENABLE([rpath],
++    [AS_HELP_STRING([--enable-rpath],
++      [use runtime library search path @<:@default=yes@:>@])])
++
++  LINKER_RPATH=
++  AS_IF([test "x$enable_rpath" != xno],
++  AC_MSG_RESULT([yes])
++    [AC_CACHE_CHECK([linker parameter to set runtime link path], my_cv_LINKER_RPATH,
++      [my_cv_LINKER_RPATH=
++      case "$host_os" in
++      linux* | freebsd* | netbsd* | openbsd* | irix*)
++        # I believe this only works with GNU ld [pere 2001-04-16]
++        my_cv_LINKER_RPATH="-Wl,-rpath,"
++        ;;
++      solaris*)
++        my_cv_LINKER_RPATH="-R "
++        ;;
++      esac
++      ])
++      LINKER_RPATH="$my_cv_LINKER_RPATH"],
++    [AC_MSG_RESULT([no])
++      LINKER_RPATH=])
+   AC_SUBST(LINKER_RPATH)dnl
+ ])
diff --git a/pkgs/core/sane/patches/sane-1.0.20-udev.patch b/pkgs/core/sane/patches/sane-1.0.20-udev.patch
new file mode 100644 (file)
index 0000000..da38a52
--- /dev/null
@@ -0,0 +1,75 @@
+commit 9ba88134bd6d296ccbcf253c6ade3e646dc286b9
+Author: Nils Philippsen <nils@redhat.com>
+Date:   Thu Oct 22 17:05:30 2009 +0200
+
+    patch: udev
+    
+    Squashed commit of the following:
+    
+    commit a7541ac649bea3f352a249dfc569f3bc18b5a968
+    Author: Nils Philippsen <nils@redhat.com>
+    Date:   Thu Oct 22 17:02:52 2009 +0200
+    
+        don't set owner, group or mode
+    
+        setting owner, group or mode may interfere with setting ACLs
+    
+    commit e385558cf214d263af93147995f1f8b729d2dabe
+    Author: Nils Philippsen <nils@redhat.com>
+    Date:   Thu Oct 22 14:19:53 2009 +0200
+    
+        fix device file ownership and mode
+    
+    commit fe874d6f9873598e8bcd9201508bc2c89365e821
+    Author: Nils Philippsen <nils@redhat.com>
+    Date:   Thu Oct 22 11:16:16 2009 +0200
+    
+        adapt generated udev rules for Fedora
+
+diff --git a/tools/sane-desc.c b/tools/sane-desc.c
+index c317700..2a410b2 100644
+--- a/tools/sane-desc.c
++++ b/tools/sane-desc.c
+@@ -56,9 +56,9 @@
+ #define COLOR_NEW          "\"#F00000\""
+ #define COLOR_UNKNOWN      "\"#000000\""
+-#define DEVMODE  "0664"
++#define DEVMODE  "0644"
+ #define DEVOWNER "root"
+-#define DEVGROUP "scanner"
++#define DEVGROUP "root"
+ #ifndef PATH_MAX
+ # define PATH_MAX 1024
+@@ -3475,8 +3475,8 @@ print_udev (void)
+           }
+       }
+       printf ("\n");
+-      printf ("ATTR{idVendor}==\"%s\", ATTR{idProduct}==\"%s\", MODE=\"%s\", GROUP=\"%s\", ENV{libsane_matched}=\"yes\"\n",
+-            usbid->usb_vendor_id + 2,  usbid->usb_product_id + 2, DEVMODE, DEVGROUP);
++      printf ("ATTR{idVendor}==\"%s\", ATTR{idProduct}==\"%s\", ENV{libsane_matched}=\"yes\"\n",
++            usbid->usb_vendor_id + 2,  usbid->usb_product_id + 2);
+       usbid = usbid->next;
+     }
+@@ -3488,7 +3488,7 @@ print_udev (void)
+   printf ("SUBSYSTEMS!=\"scsi\", GOTO=\"libsane_scsi_rules_end\"\n\n");
+   printf ("LABEL=\"libsane_scsi_rules_begin\"\n");
+   printf ("# Generic: SCSI device type 6 indicates a scanner\n");
+-  printf ("KERNEL==\"sg[0-9]*\", NAME=\"%%k\", ATTRS{type}==\"6\", MODE=\"%s\", GROUP=\"%s\"\n", DEVMODE, DEVGROUP);
++  printf ("KERNEL==\"sg[0-9]*\", ATTRS{type}==\"6\", ENV{libsane_matched}=\"yes\"\n");
+   printf ("# Some scanners advertise themselves as SCSI device type 3\n");
+   while (scsiid)
+@@ -3521,8 +3521,8 @@ print_udev (void)
+           }
+         }
+       printf ("\n");
+-      printf ("KERNEL==\"sg[0-9]*\", NAME=\"%%k\", ATTRS{type}==\"3\", ATTRS{vendor}==\"%s\", ATTRS{model}==\"%s\", MODE=\"%s\", GROUP=\"%s\"\n",
+-            scsiid->scsi_vendor_id, scsiid->scsi_product_id, DEVMODE, DEVGROUP);
++      printf ("KERNEL==\"sg[0-9]*\", ATTRS{type}==\"3\", ATTRS{vendor}==\"%s\", ATTRS{model}==\"%s\", ENV{libsane_matched}=\"yes\"\n",
++            scsiid->scsi_vendor_id, scsiid->scsi_product_id);
+       scsiid = scsiid->next;
+     }
+   printf ("LABEL=\"libsane_scsi_rules_end\"\n\n");
diff --git a/pkgs/core/sane/sane.nm b/pkgs/core/sane/sane.nm
new file mode 100644 (file)
index 0000000..2b7ee58
--- /dev/null
@@ -0,0 +1,57 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt                 #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include $(PKGROOT)/Include
+
+PKG_NAME       = sane
+PKG_VER        = 1.0.20
+PKG_REL        = 0
+
+PKG_MAINTAINER =
+PKG_GROUP      = Application/Imaging
+PKG_URL        = ftp://ftp2.sane-project.org/pub/sane/
+PKG_LICENSE    = GPLv2+
+PKG_SUMMARY    = SANE - Scanner Access Now Easy.
+
+PKG_DEPS      += libjpeg libtiff libusb
+
+define PKG_DESCRIPTION
+       sane-backends - includes: backends (scanner drivers), \
+       command-line-frontend (scanimage), network scanning daemon \
+       (saned) and SANE-API documentation. 
+endef
+
+PKG_TARBALL    = $(PKG_NAME)-backends-$(PKG_VER).tar.gz
+
+DIR_APP = /usr/src/$(PKG_NAME)-backends-$(PKG_VER)
+
+CONFIGURE_OPTIONS += \
+       --sysconfdir=/etc \
+       --enable-parport-directio
+define STAGE_INSTALL_CMDS
+       chmod 4755 $(BUILDROOT)/usr/bin/scanimage
+       install -v -m 644 $(DIR_APP)/include/sane/* $(BUILDROOT)/usr/include/sane
+       rm -vf $(BUILDROOT)/usr/share/doc/sane-1.0.20/README.solaris
+endef