diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2011-02-22 11:55:59 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2011-02-22 11:55:59 +0000 |
commit | 775c51a8b3bc64eea593e746e7f2405a95e24f69 (patch) | |
tree | 04d8087817fd4eaf5617406f6903faaff0796547 /sys-apps | |
parent | Use correct slot dependencies for gtk+ and gtkmm. (diff) | |
download | historical-775c51a8b3bc64eea593e746e7f2405a95e24f69.tar.gz historical-775c51a8b3bc64eea593e746e7f2405a95e24f69.tar.bz2 historical-775c51a8b3bc64eea593e746e7f2405a95e24f69.zip |
Add patch from upstream and me to avoid a feature regression with libusb.
Package-Manager: portage-2.2.0_alpha24/cvs/Linux x86_64
Diffstat (limited to 'sys-apps')
-rw-r--r-- | sys-apps/pcsc-lite/ChangeLog | 9 | ||||
-rw-r--r-- | sys-apps/pcsc-lite/Manifest | 12 | ||||
-rw-r--r-- | sys-apps/pcsc-lite/files/pcsc-lite-1.6.6-libusb-multiinterface.patch | 174 | ||||
-rw-r--r-- | sys-apps/pcsc-lite/pcsc-lite-1.6.6-r1.ebuild | 84 |
4 files changed, 273 insertions, 6 deletions
diff --git a/sys-apps/pcsc-lite/ChangeLog b/sys-apps/pcsc-lite/ChangeLog index 96ac454a198b..f846187d9b6f 100644 --- a/sys-apps/pcsc-lite/ChangeLog +++ b/sys-apps/pcsc-lite/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-apps/pcsc-lite # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/pcsc-lite/ChangeLog,v 1.103 2011/01/10 18:51:08 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/pcsc-lite/ChangeLog,v 1.104 2011/02/22 11:55:59 flameeyes Exp $ + +*pcsc-lite-1.6.6-r1 (22 Feb 2011) + + 22 Feb 2011; Diego E. Pettenò <flameeyes@gentoo.org> + +pcsc-lite-1.6.6-r1.ebuild, + +files/pcsc-lite-1.6.6-libusb-multiinterface.patch: + Add patch from upstream and me to avoid a feature regression with libusb. 10 Jan 2011; Diego E. Pettenò <flameeyes@gentoo.org> -pcsc-lite-1.6.1.ebuild, -files/pcscd-confd, -files/pcscd-init, diff --git a/sys-apps/pcsc-lite/Manifest b/sys-apps/pcsc-lite/Manifest index b17156b790f8..b878037364f4 100644 --- a/sys-apps/pcsc-lite/Manifest +++ b/sys-apps/pcsc-lite/Manifest @@ -2,15 +2,17 @@ Hash: SHA1 AUX 99-pcscd-hotplug.rules 483 RMD160 7c15ea902e65354e1e0c65a8ab8099ca84b89591 SHA1 9fc47a6edc71671680417ecbaf1de2150f9d614a SHA256 85b0927bd4311a5aeabcadcfa69b6096befb593216579bfbb295985a5bead3d7 +AUX pcsc-lite-1.6.6-libusb-multiinterface.patch 5695 RMD160 1288a024c0de8c10255a0a6c3cf7888af051901d SHA1 50626d9ff7d3da98f28550b8e40d5717e892ada6 SHA256 3f4abf29661f12e8ecd6fcb8e3b4bd804d0b6958e8f4dfaaa15fef3f4717402e AUX pcscd-init.3 740 RMD160 48ca6cfcc0ca05d1f21237e5dd475ccb9b52f426 SHA1 a168b781aad5a887fd6d7077d58333022e97f41f SHA256 7c15616a1221c31d89317f29faeea4682a6d9284a6a9ce97f00ab8ee0a2a58d7 DIST pcsc-lite-1.6.6.tar.bz2 480232 RMD160 e4041b846d34cf94069b6ed71e1892af34d92acd SHA1 bdd4b2f87955e2719be9b4f5da253904c721fdec SHA256 7a94c27ae687619435b29ad63e0561aca20413333187b4301c75d1a1547ceea8 +EBUILD pcsc-lite-1.6.6-r1.ebuild 2591 RMD160 5e0548e5c7fc55cdf1d29f54768b7217f6ef45d4 SHA1 6c73a288d76f7b6fdb6e4e5f2240fa47520060a5 SHA256 b9aad0bef3860a84602227745b5afa646ffc649d58f8f1ff94c34ac89c2bfd5e EBUILD pcsc-lite-1.6.6.ebuild 2198 RMD160 d77a94bec7387ec502cb5da4c26ed2d29113a026 SHA1 3763765ab10ca429d3b82d0218a3c83fdeae58e2 SHA256 40f9f89bd92d44843f9bf041fcfe0a31aa57db92d64b58b88345290ea1b0b937 -MISC ChangeLog 14265 RMD160 fe34cf4e397b2c19a1ad6cefcb9f7158068a1dd2 SHA1 dfc0f3e83590252982bbd23cc7bed564bef7af2a SHA256 30120de8c7d0475f68bac36217f44a6eff0bf57e354f29c36c5c46b323f21ec7 +MISC ChangeLog 14517 RMD160 8e17978c9afaf8e0a331caabf8bb655390795800 SHA1 287f28cdcb69ee6f0803b1871cad59aeee10cc3c SHA256 9bdd586b7d0431f5d43d62218b4d87b66d72fad80666925ec9dc6d88e3f49568 MISC metadata.xml 244 RMD160 9a9367ba3a24404b82d10ffe6493dbe43dfcb718 SHA1 b609f191e50f68af8331dfd824a8d72d48fd3ac0 SHA256 b93928eec206138ccf14d2c0dd1ebd2bbbf1cda0b8b69f540eb7f17e729cb5bf -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.16 (GNU/Linux) +Version: GnuPG v2.0.17 (GNU/Linux) -iEYEARECAAYFAk0rVQMACgkQAiZjviIA2XhY3wCdFmMMyH0cP7tQeO4sZ9PXVbG2 -cScAn11FWL5n1fwl+Isj3XFr8WnpnnAh -=vmQa +iEYEARECAAYFAk1jpIcACgkQAiZjviIA2XgDdgCfZgad4vDLzITHX9TBcfd1M6L/ +lXkAn0loEaoIWkNmTQZ95LNsvvDNlc/3 +=360J -----END PGP SIGNATURE----- diff --git a/sys-apps/pcsc-lite/files/pcsc-lite-1.6.6-libusb-multiinterface.patch b/sys-apps/pcsc-lite/files/pcsc-lite-1.6.6-libusb-multiinterface.patch new file mode 100644 index 000000000000..70fce453ca98 --- /dev/null +++ b/sys-apps/pcsc-lite/files/pcsc-lite-1.6.6-libusb-multiinterface.patch @@ -0,0 +1,174 @@ +From 5b274f9da45174a444f9e1fe8917862680ea0c2c Mon Sep 17 00:00:00 2001 +From: rousseau <rousseau@0ce88b0d-b2fd-0310-8134-9614164e65ea> +Date: Mon, 21 Feb 2011 15:05:38 +0000 +Subject: [PATCH] If a device has more than one CCID interface the "libhal:" naming scheme + (with the interface number included) is used instead of "libusb:". +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The new mechanism allows to use multi-interfaces devices like the +Gemalto ProxDU also with hotplug_libusb. libhal is deprecated and may +not be available everywhere. + +Thanks to Diego Elio Pettenò for the patch (for Gentoo) + + +git-svn-id: svn://svn.debian.org/pcsclite/trunk/PCSC@5621 0ce88b0d-b2fd-0310-8134-9614164e65ea +--- + src/hotplug_libusb.c | 88 ++++++++++++++++++++++++++++++++++---------------- + 1 files changed, 60 insertions(+), 28 deletions(-) + +diff --git a/src/hotplug_libusb.c b/src/hotplug_libusb.c +index f7625ba..772d9e0 100644 +--- a/src/hotplug_libusb.c ++++ b/src/hotplug_libusb.c +@@ -47,8 +47,8 @@ + #undef DEBUG_HOTPLUG + #define ADD_SERIAL_NUMBER + +-/* format is "%d:%d", bus_number, device_address */ +-#define BUS_DEVICE_STRSIZE 10+1+10+1 ++/* format is "%d:%d:%d", bus_number, device_address, interface */ ++#define BUS_DEVICE_STRSIZE 10+1+10+1+10+1 + + #define READER_ABSENT 0 + #define READER_PRESENT 1 +@@ -98,7 +98,8 @@ static struct _readerTracker + + static LONG HPAddHotPluggable(struct libusb_device *dev, + struct libusb_device_descriptor desc, +- const char bus_device[], struct _driverTracker *driver); ++ const char bus_device[], int interface, ++ struct _driverTracker *driver); + static LONG HPRemoveHotPluggable(int reader_index); + + static LONG HPReadBundleValues(void) +@@ -276,6 +277,7 @@ static void HPRescanUsbBus(void) + while ((dev = devs[cnt++]) != NULL) + { + struct libusb_device_descriptor desc; ++ struct libusb_config_descriptor *config_desc; + uint8_t bus_number = libusb_get_bus_number(dev); + uint8_t device_address = libusb_get_device_address(dev); + +@@ -287,6 +289,14 @@ static void HPRescanUsbBus(void) + continue; + } + ++ r = libusb_get_active_config_descriptor(dev, &config_desc); ++ if (r < 0) ++ { ++ Log3(PCSC_LOG_ERROR, "failed to get device config for %d/%d", ++ bus_number, device_address); ++ continue; ++ } ++ + /* check if the device is supported by one driver */ + for (i=0; i<driverSize; i++) + { +@@ -294,38 +304,53 @@ static void HPRescanUsbBus(void) + desc.idVendor == driverTracker[i].manuID && + desc.idProduct == driverTracker[i].productID) + { +- int newreader; ++ int interface; + +- /* A known device has been found */ +- snprintf(bus_device, BUS_DEVICE_STRSIZE, "%d:%d", +- bus_number, device_address); +- bus_device[BUS_DEVICE_STRSIZE - 1] = '\0'; + #ifdef DEBUG_HOTPLUG +- Log2(PCSC_LOG_DEBUG, "Found matching USB device: %s", +- bus_device); ++ Log3(PCSC_LOG_DEBUG, "Found matching USB device: %d:%d", ++ bus_number, device_address); + #endif +- newreader = TRUE; + +- /* Check if the reader is a new one */ +- for (j=0; j<PCSCLITE_MAX_READERS_CONTEXTS; j++) ++ for (interface = 0; interface < config_desc->bNumInterfaces; ++ interface++) + { +- if (strncmp(readerTracker[j].bus_device, +- bus_device, BUS_DEVICE_STRSIZE) == 0) ++ int newreader; ++ ++ /* A known device has been found */ ++ snprintf(bus_device, BUS_DEVICE_STRSIZE, "%d:%d:%d", ++ bus_number, device_address, interface); ++ bus_device[BUS_DEVICE_STRSIZE - 1] = '\0'; ++ newreader = TRUE; ++ ++ /* Check if the reader is a new one */ ++ for (j=0; j<PCSCLITE_MAX_READERS_CONTEXTS; j++) + { +- /* The reader is already known */ +- readerTracker[j].status = READER_PRESENT; +- newreader = FALSE; ++ if (strncmp(readerTracker[j].bus_device, ++ bus_device, BUS_DEVICE_STRSIZE) == 0) ++ { ++ /* The reader is already known */ ++ readerTracker[j].status = READER_PRESENT; ++ newreader = FALSE; + #ifdef DEBUG_HOTPLUG +- Log2(PCSC_LOG_DEBUG, "Refresh USB device: %s", +- bus_device); ++ Log2(PCSC_LOG_DEBUG, "Refresh USB device: %s", ++ bus_device); + #endif +- break; ++ break; ++ } + } +- } + +- /* New reader found */ +- if (newreader) +- HPAddHotPluggable(dev, desc, bus_device, &driverTracker[i]); ++ /* New reader found */ ++ if (newreader) ++ { ++ printf("POUET %d\n", config_desc->bNumInterfaces); ++ if (config_desc->bNumInterfaces > 1) ++ HPAddHotPluggable(dev, desc, bus_device, ++ interface, &driverTracker[i]); ++ else ++ HPAddHotPluggable(dev, desc, bus_device, ++ -1, &driverTracker[i]); ++ } ++ } + } + } + } +@@ -470,15 +495,22 @@ LONG HPStopHotPluggables(void) + + static LONG HPAddHotPluggable(struct libusb_device *dev, + struct libusb_device_descriptor desc, +- const char bus_device[], struct _driverTracker *driver) ++ const char bus_device[], int interface, ++ struct _driverTracker *driver) + { + int i; + char deviceName[MAX_DEVICENAME]; + + Log2(PCSC_LOG_INFO, "Adding USB device: %s", bus_device); + +- snprintf(deviceName, sizeof(deviceName), "usb:%04x/%04x:libusb-1.0:%s", +- desc.idVendor, desc.idProduct, bus_device); ++ if (interface >= 0) ++ snprintf(deviceName, sizeof(deviceName), "usb:%04x/%04x:libhal:/org/freedesktop/Hal/devices/usb_device_%04x_%04x_serialnotneeded_if%d", ++ desc.idVendor, desc.idProduct, desc.idVendor, desc.idProduct, ++ interface); ++ else ++ snprintf(deviceName, sizeof(deviceName), "usb:%04x/%04x:libusb-1.0:%s", ++ desc.idVendor, desc.idProduct, bus_device); ++ + deviceName[sizeof(deviceName) -1] = '\0'; + + pthread_mutex_lock(&usbNotifierMutex); +-- +1.7.4.1 + diff --git a/sys-apps/pcsc-lite/pcsc-lite-1.6.6-r1.ebuild b/sys-apps/pcsc-lite/pcsc-lite-1.6.6-r1.ebuild new file mode 100644 index 000000000000..9bf8d6c4305f --- /dev/null +++ b/sys-apps/pcsc-lite/pcsc-lite-1.6.6-r1.ebuild @@ -0,0 +1,84 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/pcsc-lite/pcsc-lite-1.6.6-r1.ebuild,v 1.1 2011/02/22 11:55:59 flameeyes Exp $ + +EAPI="3" + +inherit multilib eutils + +DESCRIPTION="PC/SC Architecture smartcard middleware library" +HOMEPAGE="http://pcsclite.alioth.debian.org/" + +STUPID_NUM="3479" +MY_P="${PN}-${PV/_/-}" +SRC_URI="http://alioth.debian.org/download.php/${STUPID_NUM}/${MY_P}.tar.bz2" +S="${WORKDIR}/${MY_P}" + +LICENSE="as-is" +SLOT="0" +KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +IUSE="usb kernel_linux" + +RDEPEND="usb? ( virtual/libusb:1 )" +DEPEND="${RDEPEND} + dev-util/pkgconfig" +RDEPEND="${RDEPEND} + !<app-crypt/ccid-1.4.1-r1 + kernel_linux? ( sys-fs/udev )" + +pkg_setup() { + enewgroup pcscd +} + +src_prepare() { + # upstream deprecates libusb in favour of libhal, but we don't want + # libhal. Problem is that with 1.6.6 release, there is no way for + # multi-interface devices to work without libhal. This patch was + # written by me (Flameeyes) and edited by upstream to support such + # device. I also have one to test. + epatch "${FILESDIR}"/${P}-libusb-multiinterface.patch +} + +src_configure() { + econf \ + --disable-maintainer-mode \ + --disable-dependency-tracking \ + --docdir="/usr/share/doc/${PF}" \ + --enable-usbdropdir="/usr/$(get_libdir)/readers/usb" \ + $(use_enable usb libusb) \ + --disable-libhal +} + +src_install() { + emake DESTDIR="${D}" install || die "emake install failed" + dodoc AUTHORS DRIVERS HELP README SECURITY ChangeLog || die + + newinitd "${FILESDIR}/pcscd-init.3" pcscd || die + + if use kernel_linux; then + insinto /lib/udev/rules.d + doins "${FILESDIR}"/99-pcscd-hotplug.rules || die + fi +} + +pkg_postinst() { + elog "Starting from version 1.6.5, pcsc-lite will start as user nobody in" + elog "the pcscd group, to avoid running as root." + elog "" + elog "This also means you need the newest drivers available so that the" + elog "devices get the proper owner." + elog "" + elog "Furthermore, a conf.d file is no longer installed by default, as" + elog "the default configuration does not require one. If you need to" + elog "pass further options to pcscd, create a file and set the" + elog "EXTRA_OPTS variable." + elog "" + if use kernel_linux; then + elog "HAL support has been dropped by the ebuild; if you want hotplug" + elog "support, that's provided already by UDEV rules; you only need to" + elog "tell the init system to hotplug it, by setting this variable in" + elog "/etc/rc.conf:" + elog "" + elog " rc_hotplug=\"pcscd\"" + fi +} |