diff --git a/.cvsignore b/.cvsignore
index 825bdd0..44da284 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,2 +1,2 @@
-sane-backends-1.0.19.tar.gz
-sane-backends-1.0.19-pkgconfig.patch.bz2
+sane-backends-1.0.20.tar.gz
+sane-backends-1.0.20-autoreconf.patch.bz2
diff --git a/sane-backends-1.0.19-glibc-2.7.patch b/sane-backends-1.0.19-glibc-2.7.patch
deleted file mode 100644
index 61b5363..0000000
--- a/sane-backends-1.0.19-glibc-2.7.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-diff -up sane-backends-1.0.19/backend/mustek_pp.c.glibc-2.7 sane-backends-1.0.19/backend/mustek_pp.c
---- sane-backends-1.0.19/backend/mustek_pp.c.glibc-2.7 2005-04-10 13:53:16.000000000 +0200
-+++ sane-backends-1.0.19/backend/mustek_pp.c 2008-09-03 17:15:12.000000000 +0200
-@@ -1152,7 +1152,7 @@ sane_open (SANE_String_Const devicename,
-
- }
-
-- if ((status = dev->func->open (dev->port, dev->caps, &fd)) != SANE_STATUS_GOOD) {
-+ if ((status = (dev->func->open) (dev->port, dev->caps, &fd)) != SANE_STATUS_GOOD) {
-
- DBG (1, "sane_open: could not open device (%s)\n",
- sane_strstatus (status));
-diff -up sane-backends-1.0.19/backend/pixma_common.c.glibc-2.7 sane-backends-1.0.19/backend/pixma_common.c
---- sane-backends-1.0.19/backend/pixma_common.c.glibc-2.7 2007-04-09 22:41:25.000000000 +0200
-+++ sane-backends-1.0.19/backend/pixma_common.c 2008-09-03 17:20:36.000000000 +0200
-@@ -500,7 +500,7 @@ pixma_open (unsigned devnr, pixma_t ** h
- strncpy (s->id, pixma_get_device_id (devnr), sizeof (s->id) - 1);
- s->ops = s->cfg->ops;
- s->scanning = 0;
-- error = s->ops->open (s);
-+ error = (s->ops->open) (s);
- if (error < 0)
- goto rollback;
- *handle = s;
-diff -up sane-backends-1.0.19/backend/plustek_pp.c.glibc-2.7 sane-backends-1.0.19/backend/plustek_pp.c
---- sane-backends-1.0.19/backend/plustek_pp.c.glibc-2.7 2007-11-18 11:59:18.000000000 +0100
-+++ sane-backends-1.0.19/backend/plustek_pp.c 2008-09-03 17:15:12.000000000 +0200
-@@ -258,7 +258,7 @@ static int drvopen( Plustek_Device *dev
-
- DBG( _DBG_INFO, "drvopen()\n" );
-
-- handle = dev->open((const char*)dev->name, (void *)dev );
-+ handle = (dev->open)((const char*)dev->name, (void *)dev );
-
- tsecs = 0;
-
-diff -up sane-backends-1.0.19/sanei/sanei_scsi.c.glibc-2.7 sane-backends-1.0.19/sanei/sanei_scsi.c
---- sane-backends-1.0.19/sanei/sanei_scsi.c.glibc-2.7 2007-11-16 19:37:07.000000000 +0100
-+++ sane-backends-1.0.19/sanei/sanei_scsi.c 2008-09-03 17:15:12.000000000 +0200
-@@ -5072,7 +5072,7 @@ sanei_scsi_find_devices (const char *fin
- (*plugInInterface)->Release (plugInInterface);
- IOObjectRelease (scsiDevice);
-
-- ioReturnValue = (*scsiDeviceInterface)->open (scsiDeviceInterface);
-+ ioReturnValue = ((*scsiDeviceInterface)->open) (scsiDeviceInterface);
- if (ioReturnValue != kIOReturnSuccess)
- {
- DBG (5, "Error opening SCSI interface (0x%08x)\n", ioReturnValue);
diff --git a/sane-backends-1.0.19-policykit.patch b/sane-backends-1.0.19-policykit.patch
deleted file mode 100644
index 298bfb2..0000000
--- a/sane-backends-1.0.19-policykit.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-diff -up sane-backends-1.0.19/tools/sane-desc.c.policykit sane-backends-1.0.19/tools/sane-desc.c
---- sane-backends-1.0.19/tools/sane-desc.c.policykit 2007-07-29 20:39:54.000000000 +0200
-+++ sane-backends-1.0.19/tools/sane-desc.c 2008-03-26 16:57:49.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;
- }
-@@ -3272,40 +3272,77 @@ print_plist (void)
-
-
- static void
--print_hal (void)
-+print_hal_entries (usbid_type *usbid)
- {
-- int i;
-- usbid_type *usbid = create_usbids_table ();
-- printf ("\n");
-- printf ("\n");
-- printf (" \n");
-- printf (" \n");
- while (usbid)
- {
- manufacturer_model_type * name = usbid->name;
-+ int i = 0;
-
-- i = 0;
- 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;
- }
-+}
-
-+static void
-+print_hal (void)
-+{
-+ usbid_type *usbid_first = create_usbids_table ();
-+
-+ printf ("\n");
-+ printf ("\n");
-+ printf (" \n\n");
-+ printf (" \n");
-+ printf (" \n");
-+ printf (" \n");
-+ printf (" \n");
-+ printf (" \n");
-+ printf (" access_control\n");
-+ printf (" linux.device_file\n");
-+ printf (" scanner\n");
-+ printf (" \n");
-+ printf (" \n");
-+ printf (" \n\n");
-+
-+ printf (" \n");
-+ printf (" \n");
-+ print_hal_entries (usbid_first);
-+ printf (" \n\n");
-+
-+ printf (" \n");
-+ printf (" \n");
-+ printf (" \n");
-+ printf (" \n");
-+ printf (" \n");
-+ printf (" access_control\n");
-+ printf (" linux.device_file\n");
-+ printf (" scanner\n");
-+ printf (" \n");
-+ printf (" \n");
-+ printf (" \n\n");
-+
-+ printf (" \n");
-+ printf (" \n");
-+ print_hal_entries (usbid_first);
-+ printf (" \n\n");
-
-- printf (" \n");
- printf (" \n");
- printf ("\n");
- }
diff --git a/sane-backends-1.0.19-rpath.patch b/sane-backends-1.0.19-rpath.patch
deleted file mode 100644
index 4de39b3..0000000
--- a/sane-backends-1.0.19-rpath.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -up sane-backends-1.0.19/configure.rpath sane-backends-1.0.19/configure
---- sane-backends-1.0.19/configure.rpath 2008-02-11 00:02:31.000000000 +0100
-+++ sane-backends-1.0.19/configure 2009-03-02 14:14:04.967158365 +0100
-@@ -4077,6 +4077,7 @@ else
- esac
-
- fi
-+LINKER_RPATH=
- { echo "$as_me:$LINENO: result: $LINKER_RPATH" >&5
- echo "${ECHO_T}$LINKER_RPATH" >&6; }
-
diff --git a/sane-backends-1.0.19-uninitialized.patch b/sane-backends-1.0.19-uninitialized.patch
deleted file mode 100644
index cce1e2f..0000000
--- a/sane-backends-1.0.19-uninitialized.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-diff -up sane-backends-1.0.19/backend/epjitsu.c.uninitialized sane-backends-1.0.19/backend/epjitsu.c
---- sane-backends-1.0.19/backend/epjitsu.c.uninitialized 2007-12-30 02:31:13.000000000 +0100
-+++ sane-backends-1.0.19/backend/epjitsu.c 2008-02-14 19:31:38.000000000 +0100
-@@ -210,7 +210,6 @@ sane_init (SANE_Int * version_code, SANE
- struct scanner *dev;
- char line[PATH_MAX];
- const char *lp;
-- size_t len;
-
- authorize = authorize; /* get rid of compiler warning */
-
-@@ -233,17 +232,12 @@ sane_init (SANE_Int * version_code, SANE
-
- while (sanei_config_read (line, PATH_MAX, fp)) {
-
-+ lp = line;
-+
- /* ignore comments */
-- if (line[0] == '#')
-+ if (*lp == '#')
- continue;
-
-- /* delete newline characters at end */
-- len = strlen (line);
-- if (line[len - 1] == '\n')
-- line[--len] = '\0';
--
-- lp = sanei_config_skip_whitespace (line);
--
- /* skip empty lines */
- if (*lp == 0)
- continue;
-diff -up sane-backends-1.0.19/backend/fujitsu.c.uninitialized sane-backends-1.0.19/backend/fujitsu.c
---- sane-backends-1.0.19/backend/fujitsu.c.uninitialized 2008-01-23 02:21:21.000000000 +0100
-+++ sane-backends-1.0.19/backend/fujitsu.c 2008-02-14 19:31:38.000000000 +0100
-@@ -480,7 +480,6 @@ find_scanners ()
- struct fujitsu *dev;
- char line[PATH_MAX];
- const char *lp;
-- size_t len;
- FILE *fp;
- int num_devices=0;
- int i=0;
-@@ -498,17 +497,12 @@ find_scanners ()
-
- while (sanei_config_read (line, PATH_MAX, fp)) {
-
-+ lp = line;
-+
- /* ignore comments */
-- if (line[0] == '#')
-+ if (*lp == '#')
- continue;
-
-- /* delete newline characters at end */
-- len = strlen (line);
-- if (line[len - 1] == '\n')
-- line[--len] = '\0';
--
-- lp = sanei_config_skip_whitespace (line);
--
- /* skip empty lines */
- if (*lp == 0)
- continue;
-diff -up sane-backends-1.0.19/backend/cardscan.c.uninitialized sane-backends-1.0.19/backend/cardscan.c
---- sane-backends-1.0.19/backend/cardscan.c.uninitialized 2007-10-26 16:56:37.000000000 +0200
-+++ sane-backends-1.0.19/backend/cardscan.c 2008-02-14 19:31:38.000000000 +0100
-@@ -320,7 +320,6 @@ sane_get_devices (const SANE_Device ***
- struct scanner *dev;
- char line[PATH_MAX];
- const char *lp;
-- size_t len;
- FILE *fp;
- int num_devices=0;
- int i=0;
-@@ -337,17 +336,12 @@ sane_get_devices (const SANE_Device ***
-
- while (sanei_config_read (line, PATH_MAX, fp)) {
-
-+ lp = line;
-+
- /* ignore comments */
-- if (line[0] == '#')
-+ if (*lp == '#')
- continue;
-
-- /* delete newline characters at end */
-- len = strlen (line);
-- if (line[len - 1] == '\n')
-- line[--len] = '\0';
--
-- lp = sanei_config_skip_whitespace (line);
--
- /* skip empty lines */
- if (*lp == 0)
- continue;
diff --git a/sane-backends-1.0.20-hal.patch b/sane-backends-1.0.20-hal.patch
new file mode 100644
index 0000000..0ce11f3
--- /dev/null
+++ b/sane-backends-1.0.20-hal.patch
@@ -0,0 +1,51 @@
+commit d83247c03d05bd386bd62ba4aee5f0f6725a9937
+Author: Nils Philippsen
+Date: Tue Jun 16 17:03:12 2009 +0200
+
+ patch: hal
+
+ Squashed commit of the following:
+
+ commit a50c619ddbb869612e99a9457b1f39492f34b141
+ Author: Nils Philippsen
+ Date: Tue Jun 16 15:21:59 2009 +0200
+
+ adapt HAL fdi files for Fedora
+
+diff --git a/tools/Makefile.am b/tools/Makefile.am
+index bd6dd9d..bb26fcb 100644
+--- a/tools/Makefile.am
++++ b/tools/Makefile.am
+@@ -79,7 +79,7 @@ udev/libsane.rules: $(wildcard ${top_srcdir}/doc/descriptions/*.desc) $(wildcard
+ -d 0 > $@
+
+ hal/libsane.fdi: $(wildcard ${top_srcdir}/doc/descriptions/*.desc) $(wildcard ${top_srcdir}/doc/descriptions-external/*.desc) sane-desc
+- @./sane-desc -m hal -s ${top_srcdir}/doc/descriptions:${top_srcdir}/doc/descriptions-external \
++ @./sane-desc -m hal-new -s ${top_srcdir}/doc/descriptions:${top_srcdir}/doc/descriptions-external \
+ -d 0 > $@
+
+ sane-backends.pc: $(top_builddir)/config.status
+diff --git a/tools/sane-desc.c b/tools/sane-desc.c
+index 600ab03..db46806 100644
+--- a/tools/sane-desc.c
++++ b/tools/sane-desc.c
+@@ -3667,7 +3667,6 @@ print_hal (int new)
+ printf (" -->\n");
+ printf (" \n", usbid->usb_product_id);
+ printf (" scanner\n");
+- printf (" proprietary\n");
+ printf (" \n");
+
+ usbid = usbid->next;
+@@ -3676,6 +3675,11 @@ print_hal (int new)
+ if (in_match)
+ printf (" \n");
+
++ printf ("\n \n");
++ printf (" \n");
++ printf (" hal-usb-scanner-add\n");
++ printf (" \n");
++
+ printf (" \n");
+
+ printf (" \n");
diff --git a/sane-backends-1.0.20-man-utf8.patch b/sane-backends-1.0.20-man-utf8.patch
new file mode 100644
index 0000000..eae5b32
--- /dev/null
+++ b/sane-backends-1.0.20-man-utf8.patch
@@ -0,0 +1,50 @@
+commit ee76c5d6d430c6e6849142ca5afede5461b1ae50
+Author: Nils Philippsen
+Date: Tue Jun 16 17:03:38 2009 +0200
+
+ patch: man-utf8
+
+ Squashed commit of the following:
+
+ commit 6f8033d184f19fd93b00373fa9a325b3ccaafe57
+ Author: Nils Philippsen
+ Date: Tue Jun 16 16:30:38 2009 +0200
+
+ recode to UTF-8
+
+diff --git a/doc/sane-hpljm1005.man b/doc/sane-hpljm1005.man
+index af6588f..cef2f8d 100644
+--- a/doc/sane-hpljm1005.man
++++ b/doc/sane-hpljm1005.man
+@@ -34,4 +34,4 @@ support dynamic loading).
+ .BR sane\-usb (5),
+
+ .SH AUTHOR
+-Philippe R�tornaz
++Philippe Rétornaz
+diff --git a/doc/sane-lexmark.man b/doc/sane-lexmark.man
+index e44270c..83d45c4 100644
+--- a/doc/sane-lexmark.man
++++ b/doc/sane-lexmark.man
+@@ -138,7 +138,7 @@ sane\-scsi(5), scanimage(1), xscanimage(1), xsane(1), sane(7)
+ The backend was originaly written by Fred Odendaal.
+ .I http://ca.geocities.com/freshshelf@rogers.com/
+ .TP
+-The new version is currently developped by St�phane Voltz.
++The new version is currently developped by Stéphane Voltz.
+ .I http://stef.dev.free.fr/sane/lexmark
+ .SH "CREDITS"
+ .TP
+diff --git a/doc/sane-rts8891.man b/doc/sane-rts8891.man
+index 6173a24..cffdc72 100644
+--- a/doc/sane-rts8891.man
++++ b/doc/sane-rts8891.man
+@@ -149,7 +149,7 @@ sane\-scsi(5), scanimage(1), xscanimage(1), xsane(1), sane(7)
+
+ .SH "AUTHOR"
+ .TP
+-This backend has been developped by St�phane Voltz.
++This backend has been developped by Stéphane Voltz.
+ .I http://stef.dev.free.fr/sane/rts8891
+ .SH "CREDITS"
+ .TP
diff --git a/sane-backends-1.0.20-open-macro.patch b/sane-backends-1.0.20-open-macro.patch
new file mode 100644
index 0000000..197c042
--- /dev/null
+++ b/sane-backends-1.0.20-open-macro.patch
@@ -0,0 +1,66 @@
+commit 7987b0332e6b660ac7992176daeede40cab98390
+Author: Nils Philippsen
+Date: Tue Jun 16 17:02:49 2009 +0200
+
+ patch: open-macro
+
+ Squashed commit of the following:
+
+ commit ab8fe801c4f82017988cb44cb79d82d286aa0de4
+ Author: Nils Philippsen
+ Date: Tue Jun 9 17:57:45 2009 +0200
+
+ don't inadvertently use glibc open() macro
+
+diff --git a/backend/mustek_pp.c b/backend/mustek_pp.c
+index 8c3f06a..7e9d094 100644
+--- a/backend/mustek_pp.c
++++ b/backend/mustek_pp.c
+@@ -1152,7 +1152,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle)
+
+ }
+
+- if ((status = dev->func->open (dev->port, dev->caps, &fd)) != SANE_STATUS_GOOD) {
++ if ((status = (dev->func->open) (dev->port, dev->caps, &fd)) != SANE_STATUS_GOOD) {
+
+ DBG (1, "sane_open: could not open device (%s)\n",
+ sane_strstatus (status));
+diff --git a/backend/pixma_common.c b/backend/pixma_common.c
+index 2bcb3c1..c5e1e96 100644
+--- a/backend/pixma_common.c
++++ b/backend/pixma_common.c
+@@ -511,7 +511,7 @@ pixma_open (unsigned devnr, pixma_t ** handle)
+ strncpy (s->id, pixma_get_device_id (devnr), sizeof (s->id) - 1);
+ s->ops = s->cfg->ops;
+ s->scanning = 0;
+- error = s->ops->open (s);
++ error = (s->ops->open) (s);
+ if (error < 0)
+ goto rollback;
+ error = pixma_deactivate (s->io);
+diff --git a/backend/plustek_pp.c b/backend/plustek_pp.c
+index 13d1443..629e238 100644
+--- a/backend/plustek_pp.c
++++ b/backend/plustek_pp.c
+@@ -258,7 +258,7 @@ static int drvopen( Plustek_Device *dev )
+
+ DBG( _DBG_INFO, "drvopen()\n" );
+
+- handle = dev->open((const char*)dev->name, (void *)dev );
++ handle = (dev->open)((const char*)dev->name, (void *)dev );
+
+ tsecs = 0;
+
+diff --git a/sanei/sanei_scsi.c b/sanei/sanei_scsi.c
+index 69d5859..a594aba 100644
+--- a/sanei/sanei_scsi.c
++++ b/sanei/sanei_scsi.c
+@@ -5328,7 +5328,7 @@ sanei_scsi_find_devices (const char *findvendor, const char *findmodel,
+ (*plugInInterface)->Release (plugInInterface);
+ IOObjectRelease (scsiDevice);
+
+- ioReturnValue = (*scsiDeviceInterface)->open (scsiDeviceInterface);
++ ioReturnValue = ((*scsiDeviceInterface)->open) (scsiDeviceInterface);
+ if (ioReturnValue != kIOReturnSuccess)
+ {
+ DBG (5, "Error opening SCSI interface (0x%08x)\n", ioReturnValue);
diff --git a/sane-backends-1.0.20-pkgconfig.patch b/sane-backends-1.0.20-pkgconfig.patch
new file mode 100644
index 0000000..3a70748
--- /dev/null
+++ b/sane-backends-1.0.20-pkgconfig.patch
@@ -0,0 +1,160 @@
+commit c230f04bf3590fbfcd4aaa529e9f10eb0478379c
+Author: Nils Philippsen
+Date: Tue Jun 16 17:02:26 2009 +0200
+
+ patch: pkgconfig
+
+ Squashed commit of the following:
+
+ commit 7787640dd567b93dd0a458fd5fb662bb7b85ff36
+ Author: Nils Philippsen
+ Date: Fri Jun 5 12:55:39 2009 +0200
+
+ use pkg-config in sane-config
+
+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..bd6dd9d 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,6 +30,12 @@ noinst_SCRIPTS = $(HOTPLUG)
+ BUILT_SOURCES = $(HOTPLUG_DIR)
+ CLEANFILES = $(bin_SCRIPTS) $(dist_noinst_SCRIPTS)
+
++pkgconfig_PROGRAMS = sane-backends.pc
++sane_backends_pc_SOURCES = sane-backends.pc.in
++.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
+
+@@ -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..9e5a2fc 100644
+--- a/tools/sane-config.in
++++ b/tools/sane-config.in
+@@ -32,6 +32,12 @@ srcdir="@srcdir@"
+ top_srcdir="@top_srcdir@"
+ cflags=
+
++pkgconfig_package=sane-backends
++use_pkgconfig=0
++if test -x "@bindir@/pkg-config" -a "@bindir@/pkg-config" --exists "$pkgconfig_package"
++ use_pkgconfig=1
++fi
++
+ usage ()
+ {
+ echo "Usage: " 1>&2
+@@ -85,26 +91,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}
diff --git a/sane-backends-1.0.20-rpath.patch b/sane-backends-1.0.20-rpath.patch
new file mode 100644
index 0000000..ba3cd73
--- /dev/null
+++ b/sane-backends-1.0.20-rpath.patch
@@ -0,0 +1,65 @@
+commit e0de6eaee11254667eb6abb6e2ccb7768bd2de4f
+Author: Nils Philippsen
+Date: Tue Jun 16 16:59:43 2009 +0200
+
+ patch: rpath
+
+ Squashed commit of the following:
+
+ commit be2982b2d1ae4d889b4cecec289336b4b03579aa
+ Author: Nils Philippsen
+ 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..c6f5800 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -383,19 +383,31 @@ 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@:>@])]
++ [],
++ [enable_readline=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/sane-backends.spec b/sane-backends.spec
index 4e1328c..384d777 100644
--- a/sane-backends.spec
+++ b/sane-backends.spec
@@ -1,7 +1,7 @@
Summary: Scanner access software
Name: sane-backends
-Version: 1.0.19
-Release: 15%{?dist}
+Version: 1.0.20
+Release: 1%{?dist}
# lib/ is LGPLv2+, backends are GPLv2+ with exceptions
# Tools are GPLv2+, docs are public domain
# see LICENSE for details
@@ -10,11 +10,12 @@ Group: System Environment/Libraries
Source0: ftp://ftp.sane-project.org/pub/sane/%{name}-%{version}/%{name}-%{version}.tar.gz
Source1: sane.png
Source2: hal-usb-scanner-add
-Patch0: sane-backends-1.0.19-rpath.patch
-Patch1: sane-backends-1.0.19-pkgconfig.patch.bz2
-Patch2: sane-backends-1.0.19-glibc-2.7.patch
-Patch3: sane-backends-1.0.19-policykit.patch
-Patch4: sane-backends-1.0.19-uninitialized.patch
+Patch0: sane-backends-1.0.20-rpath.patch
+Patch1: sane-backends-1.0.20-pkgconfig.patch
+Patch2: sane-backends-1.0.20-open-macro.patch
+Patch3: sane-backends-1.0.20-hal.patch
+Patch4: sane-backends-1.0.20-man-utf8.patch
+Patch5: sane-backends-1.0.20-autoreconf.patch.bz2
URL: http://www.sane-project.org
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%__id_u -n)
BuildRequires: tetex-latex
@@ -44,8 +45,8 @@ Requires: libjpeg-devel
Requires: libtiff-devel
Requires: pkgconfig
Requires: gphoto2-devel
-Requires: sane-backends-libs-%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
-Requires: sane-backends-libs-gphoto2-%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires: sane-backends-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires: sane-backends-libs-gphoto2%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%description devel
This package contains static libraries and header files for writing Scanner
@@ -58,7 +59,6 @@ Requires: sane-backends = %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes: sane-backends <= 1.0.17-12
Obsoletes: sane-backends-docs <= 1.0.17-12
Provides: sane-backends-docs = %{?epoch:%{epoch}:}%{version}-%{release}
-Provides: sane-backends-libs-%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
%description libs
This package contains the SANE libraries which are needed by applications that
@@ -67,8 +67,7 @@ want to access scanners.
%package libs-gphoto2
Summary: SANE libraries for gphoto2
Group: System Environment/Libraries
-Provides: sane-backends-libs-gphoto2-%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
-Requires: sane-backends-libs-%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires: sane-backends-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%description libs-gphoto2
This package contains the SANE libraries which are needed by applications that
@@ -79,14 +78,10 @@ want to access digital cameras.
%patch0 -p1 -b .rpath
%patch1 -p1 -b .pkgconfig
-%patch2 -p1 -b .glibc-2.7
-%patch3 -p1 -b .policykit
-%patch4 -p1 -b .uninitialized
-
-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_"
- mv "doc/sane-$i.man_" "doc/sane-$i.man"
-done
+%patch2 -p1 -b .open-macro
+%patch3 -p1 -b .hal
+%patch4 -p1 -b .man-utf8
+%patch5 -p1 -b .autoreconf
%build
%configure \
@@ -106,8 +101,8 @@ 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}/%{_datadir}/hal/fdi/policy/10osvendor
-install -m 0644 tools/hal/libsane.fdi %{buildroot}/%{_datadir}/hal/fdi/policy/10osvendor/19-libsane.fdi
+mkdir -p %{buildroot}/%{_datadir}/hal/fdi/policy/20thirdparty
+install -m 0644 tools/hal/libsane.fdi %{buildroot}/%{_datadir}/hal/fdi/policy/20thirdparty/19-libsane.fdi
mkdir -p %{buildroot}/%{_libexecdir}
install -m 0755 %{SOURCE2} %{buildroot}/%{_libexecdir}/hal-usb-scanner-add
@@ -124,7 +119,7 @@ rm -rf %{buildroot}
%defattr(-,root,root)
%dir /etc/sane.d
%config(noreplace) /etc/sane.d/*
-%{_datadir}/hal/fdi/policy/10osvendor/*.fdi
+%{_datadir}/hal/fdi/policy/20thirdparty/*.fdi
%{_libexecdir}/hal-usb-scanner-add
%{_mandir}/*/*
%{_datadir}/pixmaps/sane.png
@@ -153,10 +148,18 @@ rm -rf %{buildroot}
%{_mandir}/man1/sane-config.1*
%{_includedir}/sane
%{_libdir}/libsane*.so
-%dir %{_libdir}/pkgconfig
%{_libdir}/pkgconfig/sane-backends.pc
%changelog
+* Tue Jun 16 2009 Nils Philippsen - 1.0.20-1
+- version 1.0.20
+- rebase/remove patches
+- use %%_isa for arch-specific requirements
+- place HAL fdi files in the correct place (#457645)
+
+* Sun Jun 14 2009 Michael Schwendt - 1.0.19-16
+- Don't claim ownership of %%_libdir/pkgconfig/ (#499659)
+
* Mon Mar 02 2009 Nils Philippsen - 1.0.19-15
- let sane-backends-devel require libjpeg-devel, libtiff-devel
- update rpath patch (no longer touch sane-config.in as that is replaced
diff --git a/sources b/sources
index 9afa818..fe60176 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-8c0936272dcfd4e98c51512699f1c06f sane-backends-1.0.19.tar.gz
-f54cb9be1016ede98c2a4eee6720d13f sane-backends-1.0.19-pkgconfig.patch.bz2
+a0cfdfdebca2feb4f2ba5d3418b15a42 sane-backends-1.0.20.tar.gz
+cd71d7e8a2ea0c1a8d51901317f50d39 sane-backends-1.0.20-autoreconf.patch.bz2