rpms/libfprint/devel fprint-add-udev-rules.patch, NONE, 1.1 libfprint.spec, 1.15, 1.16

Matthew Garrett mjg59 at fedoraproject.org
Tue Jun 9 17:59:58 UTC 2009


Author: mjg59

Update of /cvs/pkgs/rpms/libfprint/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv2616

Modified Files:
	libfprint.spec 
Added Files:
	fprint-add-udev-rules.patch 
Log Message:
* Tue Jun 09 2009 Matthew Garrett <mjg at redhat.com> 0.1.0-7.pre1
- fprint-add-udev-rules.patch - build udev rules for autosuspend
- move hal fdi into the main package rather than -devel


fprint-add-udev-rules.patch:

--- NEW FILE fprint-add-udev-rules.patch ---
--- libfprint-0.1.0-pre1/libfprint/fprint-list-udev-rules.c	1970-01-01 01:00:00.000000000 +0100
+++ libfprint-0.1.0-pre1.bak/libfprint/fprint-list-udev-rules.c	2009-06-09 18:30:20.000000000 +0100
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2009 Red Hat <mjg at redhat.com> 
+ * Copyright (C) 2008 Bastien Nocera <hadess at hadess.net>
+ * Copyright (C) 2008 Timo Hoenig <thoenig at suse.de>, <thoenig at nouse.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <config.h>
+#include <stdio.h>
+
+#include "fp_internal.h"
+
+static const struct usb_id whitelist_id_table[] = {
+    { .vendor = 0x08ff, .product = 0x2810 },
+    { 0, 0, 0, },
+};
+
+static const struct usb_id blacklist_id_table[] = {
+    { 0, 0, 0 },
+};
+
+struct fp_driver whitelist = {
+    .id_table = whitelist_id_table,
+};
+
+static void print_driver (struct fp_driver *driver)
+{
+    int i, j, blacklist;
+
+    for (i = 0; driver->id_table[i].vendor != 0; i++) {
+	blacklist = 0;
+	for (j = 0; blacklist_id_table[j].vendor != 0; j++) {
+	    if (driver->id_table[i].vendor == blacklist_id_table[j].vendor &&
+		driver->id_table[j].product == blacklist_id_table[j].product) {
+		blacklist = 1;
+	    }
+	}
+	if (blacklist)
+	    continue;
+
+	printf ("SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"%04x\", ATTRS{idProduct}==\"%04x\", ATTR{power/level}=\"auto\"\n", driver->id_table[i].vendor, driver->id_table[i].product);
+    }
+}
+
+int main (int argc, char **argv)
+{
+    struct fp_driver **list;
+    guint i;
+
+    list = fprint_get_drivers ();
+
+    for (i = 0; list[i] != NULL; i++) {
+	print_driver (list[i]);
+    }
+
+    print_driver (&whitelist);
+
+    return 0;
+}
--- libfprint-0.1.0-pre1/libfprint/Makefile.am	2008-11-18 17:18:21.000000000 +0000
+++ libfprint-0.1.0-pre1.bak/libfprint/Makefile.am	2009-06-09 18:32:10.000000000 +0100
@@ -1,6 +1,6 @@
 lib_LTLIBRARIES = libfprint.la
-noinst_PROGRAMS = fprint-list-hal-info
-MOSTLYCLEANFILES = $(hal_fdi_DATA)
+noinst_PROGRAMS = fprint-list-hal-info fprint-list-udev-rules
+MOSTLYCLEANFILES = $(hal_fdi_DATA) $(udev_rules_DATA)
 
 UPEKTS_SRC = drivers/upekts.c
 UPEKTC_SRC = drivers/upektc.c
@@ -66,6 +66,15 @@
 $(hal_fdi_DATA): fprint-list-hal-info
 	$(builddir)/fprint-list-hal-info > $@
 
+fprint_list_udev_rules_SOURCES = fprint-list-udev-rules.c
+fprint_list_udev_rules_CFLAGS = -fvisibility=hidden -I$(srcdir)/nbis/include $(LIBUSB_CFLAGS) $(GLIB_CFLAGS) $(IMAGEMAGICK_CFLAGS) $(CRYPTO_CFLAGS) $(AM_CFLAGS)
+fprint_list_udev_rules_LDADD = $(builddir)/libfprint.la
+
+udev_rules_DATA = 60-fprint-autosuspend.rules
+udev_rulesdir = $(sysconfdir)/udev/rules.d/
+
+$(udev_rules_DATA): fprint-list-udev-rules
+	$(builddir)/fprint-list-udev-rules > $@
 
 if ENABLE_UPEKTS
 DRIVER_SRC += $(UPEKTS_SRC)


Index: libfprint.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libfprint/devel/libfprint.spec,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -p -r1.15 -r1.16
--- libfprint.spec	21 Apr 2009 13:38:57 -0000	1.15
+++ libfprint.spec	9 Jun 2009 17:59:28 -0000	1.16
@@ -1,6 +1,6 @@
 Name:           libfprint
 Version:        0.1.0
-Release:        6.pre1%{?dist}.1
+Release:        7.pre1%{?dist}
 Summary:        Tool kit for fingerprint scanner
 
 Group:          System Environment/Libraries
@@ -9,6 +9,7 @@ URL:            http://www.reactivated.n
 Source0:        http://downloads.sourceforge.net/fprint/%{name}-0.1.0-pre1.tar.bz2
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Patch0:         0002-Fix-fp_get_pollfds.patch
+Patch1:		fprint-add-udev-rules.patch
 ExcludeArch:    s390 s390x
 
 # FIXME remove the ImageMagick dependency when we either have the
@@ -35,8 +36,10 @@ developing applications that use %{name}
 %prep
 %setup -q -n %{name}-0.1.0-pre1
 %patch0 -p1
+%patch1 -p1
 
 %build
+autoreconf -f -i
 %configure --disable-static 
 make %{?_smp_mflags}
 pushd doc
@@ -62,6 +65,8 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(-,root,root,-)
 %doc COPYING INSTALL NEWS TODO THANKS AUTHORS
 %{_libdir}/*.so.*
+%{_datadir}/hal/fdi/information/20thirdparty/10-fingerprint-reader-fprint.fdi
+%{_sysconfdir}/udev/rules.d/60-fprint-autosuspend.rules
 
 %files devel
 %defattr(-,root,root,-)
@@ -69,9 +74,12 @@ rm -rf $RPM_BUILD_ROOT
 %{_includedir}/*
 %{_libdir}/*.so
 %{_libdir}/pkgconfig/%{name}.pc
-%{_datadir}/hal/fdi/information/20thirdparty/10-fingerprint-reader-fprint.fdi
 
 %changelog
+* Tue Jun 09 2009 Matthew Garrett <mjg at redhat.com> 0.1.0-7.pre1
+- fprint-add-udev-rules.patch - build udev rules for autosuspend
+- move hal fdi into the main package rather than -devel
+
 * Tue Apr 21 2009 Karsten Hopp <karsten at redhat.com> 0.1.0-6.pre1.1
 - Excludearch s390 s390x, we don't have USB devices there and this package
   doesn't build without USB support




More information about the fedora-extras-commits mailing list