Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37649463
en ru br
Репозитории ALT
S:0.1.5-alt1
5.1: 0.1.0-alt3
www.altlinux.org/Changes

Группа :: Система/Библиотеки
Пакет: libusb-compat

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: libusb-compat-0.1.5-alt1.patch
Скачать


 .gear/rules                                        |  3 +
 .../tags/1c01e2bc8ccdcbbb4fb6617709990f3a6d1bb347  | 13 ++++
 .gear/tags/list                                    |  1 +
 configure.ac                                       |  6 +-
 libusb-compat.spec                                 | 88 ++++++++++++++++++++++
 libusb.pc.in                                       |  1 +
 libusb/core.c                                      | 10 +++
 7 files changed, 119 insertions(+), 3 deletions(-)
diff --git a/.gear/rules b/.gear/rules
new file mode 100644
index 0000000..1c22244
--- /dev/null
+++ b/.gear/rules
@@ -0,0 +1,3 @@
+tar: 0.1.4:.
+diff: 0.1.4:. .
+
diff --git a/.gear/tags/1c01e2bc8ccdcbbb4fb6617709990f3a6d1bb347 b/.gear/tags/1c01e2bc8ccdcbbb4fb6617709990f3a6d1bb347
new file mode 100644
index 0000000..6b21725
--- /dev/null
+++ b/.gear/tags/1c01e2bc8ccdcbbb4fb6617709990f3a6d1bb347
@@ -0,0 +1,13 @@
+object 96aed2f7963d4a55d575a701adce8e64c0ae89fb
+type commit
+tag 0.1.4
+tagger Peter Stuge <peter@stuge.se> 1335246366 +0200
+
+libusb-compat-0.1.4
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.11 (GNU/Linux)
+
+iD8DBQBPlj4ehR3Q0dhIfEgRAqCmAKCpFeoLUU5Hc2MpEnZZ1MW0OURhSgCdFAkl
+CyJgSvv6nduL7J4S2dXff0M=
+=9SxX
+-----END PGP SIGNATURE-----
diff --git a/.gear/tags/list b/.gear/tags/list
new file mode 100644
index 0000000..3801845
--- /dev/null
+++ b/.gear/tags/list
@@ -0,0 +1 @@
+1c01e2bc8ccdcbbb4fb6617709990f3a6d1bb347 0.1.4
diff --git a/configure.ac b/configure.ac
index 55faa37..debfef2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
-AC_INIT([libusb-compat], [0.1.4])
+AC_INIT([libusb-compat], [0.1.5])
 AM_INIT_AUTOMAKE
 AC_CONFIG_SRCDIR([libusb/core.c])
-AM_CONFIG_HEADER([config.h])
+AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
 
 AC_PREREQ([2.50])
@@ -52,7 +52,7 @@ AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"])
 # Restore gnu89 inline semantics on gcc 4.3 and newer
 saved_cflags="$CFLAGS"
 CFLAGS="$CFLAGS -fgnu89-inline"
-AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), inline_cflags="-fgnu89-inline", inline_cflags="")
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], inline_cflags="-fgnu89-inline", inline_cflags="")
 CFLAGS="$saved_cflags"
 
 AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility])
diff --git a/libusb-compat.spec b/libusb-compat.spec
new file mode 100644
index 0000000..b76beec
--- /dev/null
+++ b/libusb-compat.spec
@@ -0,0 +1,88 @@
+Name: libusb-compat
+Version: 0.1.5
+Release: alt1
+Summary: Libusb is a library which allows userspace access to USB devices
+License: LGPL
+Group: System/Libraries
+Url: http://sourceforge.net/projects/libusb/
+Packager: Alexander Bokovoy <ab@altlinux.org>
+
+Prereq: libusb >= 1.0.1-alt1
+
+Source0: %name-%version.tar
+Patch0: %name-%version-%release.patch
+
+BuildRequires: libusb-devel >= 1.0-alt2
+
+%description
+Libusb is a library which allows userspace access to USB devices.
+Libusb-compat implements compatibility interfaces of libusb 0.1.
+
+%package devel
+Summary: Libusb-compat is a wrapper which allows userspace access to USB devices via older (0.1.0) API of libusb
+Group: Development/C
+Requires: %name = %version-%release
+
+%description devel
+Libusb-compat is a wrapper which allows userspace access to USB devices via older (0.1.0) API of libusb
+
+This package contains header files needed for the development of programs that
+use libusb.
+
+Use of 0.1.0 API of libusb is discouraged, please port your applications to libusb 1.0 API!
+
+%prep
+%setup -q
+%patch -p1
+
+mkdir -p m4
+
+%build
+%autoreconf
+%configure \
+	--disable-static
+%make_build
+
+%install
+%make DESTDIR=%buildroot install
+
+mkdir -p %buildroot/%_lib
+for f in %buildroot%_libdir/lib*.so; do
+	t=$(readlink "$f")
+	ln -sf ../../%_lib/"$t" "$f"
+done
+mv %buildroot%_libdir/lib*.so.* %buildroot/%_lib/
+
+%files
+%doc AUTHORS README NEWS
+/%_lib/libusb-0.1.so.*
+
+%files devel
+%_includedir/usb.h
+%_bindir/libusb-config
+%_libdir/libusb.so
+%_pkgconfigdir/libusb.pc
+
+%changelog
+* Tue Jul 08 2014 Valery Inozemtsev <shrek@altlinux.ru> 0.1.5-alt1
+- 0.1.5
+
+* Thu Apr 26 2012 Valery Inozemtsev <shrek@altlinux.ru> 0.1.4-alt1
+- 0.1.4
+
+* Wed Mar 09 2011 Valery Inozemtsev <shrek@altlinux.ru> 0.1.3-alt3
+- rebuilt for debuginfo
+
+* Tue Nov 30 2010 Valery Inozemtsev <shrek@altlinux.ru> 0.1.3-alt2
+- rebuild
+
+* Tue Feb 09 2010 Valery Inozemtsev <shrek@altlinux.ru> 0.1.3-alt1
+- 0.1.3
+
+* Wed May 20 2009 Valery Inozemtsev <shrek@altlinux.ru> 0.1.0-alt3
+- Move libusb-0.1.so.* to /lib to accompany main libusb-1.0.so.*
+
+* Sun Mar 29 2009 Alexander Bokovoy <ab@altlinux.org> 0.1.0-alt2
+- Package libusb-compat-0.1 separately from libusb
+- Include ALT-specific fixes
+
diff --git a/libusb.pc.in b/libusb.pc.in
index 02d67b8..add91ab 100644
--- a/libusb.pc.in
+++ b/libusb.pc.in
@@ -9,6 +9,7 @@ emulated_by=libusb-1.0
 Name: libusb
 Description: USB access library (libusb-1.0 compat wrapper)
 Version: @LIBUSB01_VERSION@
+Requires.private: libusb-1.0
 Libs: -L${libdir} -lusb
 Cflags: -I${includedir}
 
diff --git a/libusb/core.c b/libusb/core.c
index 2dd1b5f..c0ccb1f 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -21,6 +21,7 @@
 #include <config.h>
 #include <errno.h>
 #include <stdarg.h>
+#include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 
@@ -136,6 +137,13 @@ static void usbi_log(enum usbi_log_level level, const char *function,
 	fprintf(stream, "\n");
 }
 
+static void _usb_finalize(void) {
+       if (ctx) {
+          libusb_exit(ctx);
+               ctx = NULL;
+               }
+}
+
 API_EXPORTED void usb_init(void)
 {
 	int r;
@@ -151,6 +159,8 @@ API_EXPORTED void usb_init(void)
 		/* usb_set_debug can be called before usb_init */
 		if (usb_debug)
 			libusb_set_debug(ctx, 3);
+
+               atexit(_usb_finalize);
 	}
 }
 
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin