Compare commits

...
Sign in to create a new pull request.

33 commits

Author SHA1 Message Date
Kate Hsuan
4a3bd6f9ec Revert "Add patches to skip uninitialized devices" (rhbz#2390535)
The fix brought a regression to mess storage so revert the fix and then
trying to find the better fixes.

This reverts commit 3c2e5bfcc5.
2025-08-29 10:43:28 +08:00
Benjamin Berg
3c2e5bfcc5 Add patches to skip uninitialized devices
Otherwise there is a race condition if libusb enumerates the devices
while udev is processing the event.

Resolves: #2346771
2025-08-11 21:15:41 +02:00
Yaakov Selkowitz
378cca96bd Always regenerate autotools
Since we're modifying a Makefile.am, the corresponding Makefile.in will
have to be regenerated, and we should never rely on any release having
matching autotools versions.
2025-08-05 10:18:38 -04:00
Kate Hsuan
1029314e65 Update to the upstream version 1.0.29 and migrate to tmt test
1. Update to upstream version 1.0.29.
2. Migrate the test to tmt.

Resolves: #2382956 #2385130
2025-08-05 14:03:49 +08:00
Fedora Release Engineering
48b605aa37 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-24 20:31:14 +00:00
Kate Hsuan
3d48eee863 Fix the automake 1.17 issue for the versions less than f43 and rhel11
Since automake 1.17 is in f43 and recent f42 and libusb1 1.0.28 is
released with automake 1.17, automake has to be rerun in %prep
for versions less than f43 to get the correct build scripts.
2025-03-27 15:16:45 +08:00
LuK1337
200675a582
Update to 1.0.28 2025-03-26 14:12:07 +01:00
LuK1337
3af8635952
Verify source code with GPG 2025-03-26 14:09:14 +01:00
Marc-André Lureau
6c14dc7303 Provides/Obsoletes mingw-libusbx
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-01-30 14:45:14 +04:00
Fedora Release Engineering
fbcadef2f4 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-20 08:12:49 +00:00
Fedora Release Engineering
8756bdd701 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-17 14:46:08 +00:00
Yaakov Selkowitz
abbe292d8b Fix ELN build
Possibly undefined macros must be ?-prefixed, and ELN (the future RHEL 11)
is tracking rawhide and also has automake 1.17.
2025-01-13 11:00:27 -05:00
Kate Hsuan
31c1f013c1 Fix the build failure with automake-1.17
Reran autoconf, aclocal, and automake to ensure the configure works
with automake-1.17.

Resolves: #2335712
2025-01-10 11:45:44 +08:00
Jean THOMAS
2e36c0bb64 Add MinGW builds 2024-10-22 10:22:24 +02:00
Fedora Release Engineering
60468ae8bb Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-18 15:22:46 +00:00
Kate Hsuan
8ea6134119 Build the test code without a rpath 2024-05-08 11:16:24 +08:00
Kate Hsuan
07032b3e9c Update to 1.0.27
- Update to 1.0.27
- Add tests, including init_context, set_option, and stress_mt
2024-03-04 15:06:09 +08:00
Fedora Release Engineering
1dcfc6520a Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-25 03:51:42 +00:00
Fedora Release Engineering
31b51b7c83 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-21 05:38:03 +00:00
Miroslav Suchý
758eaec579 Migrate to SPDX license
This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_2
2023-09-19 03:54:03 +00:00
Fedora Release Engineering
6952413693 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-20 12:25:11 +00:00
Fedora Release Engineering
bf42a855b4 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 17:43:11 +00:00
Kate Hsuan
91d4c17a0b Update to 1.0.26 2022-09-30 16:27:25 +08:00
Fedora Release Engineering
b6b18ebcd9 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-21 19:17:58 +00:00
Benjamin Berg
6352bb192a Enable and fix gating tests 2022-02-22 13:26:01 +01:00
Benjamin Berg
5e2dcc2c62 Work around API misuse in gutenprint
Related: #2056326
2022-02-22 13:23:34 +01:00
Benjamin Berg
e1239cc046 Add umockdev based tests
See https://github.com/libusb/libusb/pull/1078
2022-02-22 13:23:34 +01:00
Benjamin Berg
36cafe8c9f Update regression fix patch for late transfer free's
Resolves: #2056326
2022-02-22 13:13:26 +01:00
Benjamin Berg
ddf6170c92 Fix a crash if a transfer outlives closing the device 2022-02-15 12:02:50 +01:00
Benjamin Berg
ac977fad6e Fix a crash after libusb_exit API has been misused
Resolves: #2050638
2022-02-10 12:06:41 +01:00
Benjamin Berg
6719df21e1 Fix automatic changelog
The changelog for the 1.0.25 update was missing as I rolled the move to
automatic generation and the update into one commit.
2022-02-02 20:08:21 +01:00
Benjamin Berg
608ae59ae9 Update to 1.0.25 2022-02-02 16:59:34 +01:00
Fedora Release Engineering
99125e46ea - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 17:31:16 +00:00
14 changed files with 257 additions and 373 deletions

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

8
.gitignore vendored
View file

@ -1 +1,9 @@
/libusb-1.0.24.tar.bz2
/libusb-1.0.25.tar.bz2
/libusb-1.0.26.tar.bz2
/libusb-1.0.27.tar.bz2
/libusb-1.0.27.tar.bz2.asc
/libusb-1.0.28.tar.bz2
/libusb-1.0.28.tar.bz2.asc
/libusb-1.0.29.tar.bz2
/libusb-1.0.29.tar.bz2.asc

View file

@ -1,60 +0,0 @@
From c486d01297a366aae8dcd3f715d0bfd8b995949b Mon Sep 17 00:00:00 2001
From: Chris Dickens <christopher.a.dickens@gmail.com>
Date: Mon, 8 Feb 2021 09:27:20 -0800
Subject: [PATCH 1/2] linux_usbfs: Accept sysfs attributes not terminated with
newline
Benjamin Berg reports that some CI systems that simulate sysfs devices
are causing libusb to report errors because such systems are not
conforming to the sysfs pattern of terminating attribute values with a
newline character. Reduce the severity of encountering such
non-conforming attibute values from an error that prevents enumeration
to a warning message.
Closes #857
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
---
libusb/os/linux_usbfs.c | 12 +++++++-----
libusb/version_nano.h | 2 +-
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c
index 4882c0f..ebf8cfe 100644
--- a/libusb/os/linux_usbfs.c
+++ b/libusb/os/linux_usbfs.c
@@ -505,7 +505,7 @@ static int read_sysfs_attr(struct libusb_context *ctx,
if (fd < 0)
return fd;
- r = read(fd, buf, sizeof(buf));
+ r = read(fd, buf, sizeof(buf) - 1);
if (r < 0) {
r = errno;
close(fd);
@@ -523,16 +523,18 @@ static int read_sysfs_attr(struct libusb_context *ctx,
return 0;
}
- /* The kernel does *not* NULL-terminate the string, but every attribute
+ /* The kernel does *not* NUL-terminate the string, but every attribute
* should be terminated with a newline character. */
if (!isdigit(buf[0])) {
usbi_err(ctx, "attribute %s doesn't have numeric value?", attr);
return LIBUSB_ERROR_IO;
} else if (buf[r - 1] != '\n') {
- usbi_err(ctx, "attribute %s doesn't end with newline?", attr);
- return LIBUSB_ERROR_IO;
+ usbi_warn(ctx, "attribute %s doesn't end with newline?", attr);
+ } else {
+ /* Remove the terminating newline character */
+ r--;
}
- buf[r - 1] = '\0';
+ buf[r] = '\0';
errno = 0;
value = strtol(buf, &endptr, 10);
--
2.29.2

View file

@ -1,61 +0,0 @@
From f6d2cb561402c3b6d3627c0eb89e009b503d9067 Mon Sep 17 00:00:00 2001
From: Chris Dickens <christopher.a.dickens@gmail.com>
Date: Sun, 13 Dec 2020 15:49:19 -0800
Subject: [PATCH] linux_usbfs: Fix parsing of descriptors for
multi-configuration devices
Commit e2be556bd2 ("linux_usbfs: Parse config descriptors during device
initialization") introduced a regression for devices with multiple
configurations. The logic that verifies the reported length of the
configuration descriptors failed to count the length of the
configuration descriptor itself and would truncate the actual length by
9 bytes, leading to a parsing error for subsequent descriptors.
Closes #825
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
---
libusb/os/linux_usbfs.c | 12 ++++++++----
libusb/version_nano.h | 2 +-
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c
index fb2ed53..4d2dc8d 100644
--- a/libusb/os/linux_usbfs.c
+++ b/libusb/os/linux_usbfs.c
@@ -641,7 +641,12 @@ static int seek_to_next_config(struct libusb_context *ctx,
uint8_t *buffer, size_t len)
{
struct usbi_descriptor_header *header;
- int offset = 0;
+ int offset;
+
+ /* Start seeking past the config descriptor */
+ offset = LIBUSB_DT_CONFIG_SIZE;
+ buffer += LIBUSB_DT_CONFIG_SIZE;
+ len -= LIBUSB_DT_CONFIG_SIZE;
while (len > 0) {
if (len < 2) {
@@ -718,7 +723,7 @@ static int parse_config_descriptors(struct libusb_device *dev)
}
if (priv->sysfs_dir) {
- /*
+ /*
* In sysfs wTotalLength is ignored, instead the kernel returns a
* config descriptor with verified bLength fields, with descriptors
* with an invalid bLength removed.
@@ -727,8 +732,7 @@ static int parse_config_descriptors(struct libusb_device *dev)
int offset;
if (num_configs > 1 && idx < num_configs - 1) {
- offset = seek_to_next_config(ctx, buffer + LIBUSB_DT_CONFIG_SIZE,
- remaining - LIBUSB_DT_CONFIG_SIZE);
+ offset = seek_to_next_config(ctx, buffer, remaining);
if (offset < 0)
return offset;
sysfs_config_len = (uint16_t)offset;
--
2.29.2

View file

@ -1,220 +0,0 @@
From f38f09da98acc63966b65b72029b1f7f81166bef Mon Sep 17 00:00:00 2001
From: Chris Dickens <christopher.a.dickens@gmail.com>
Date: Mon, 8 Feb 2021 11:56:13 -0800
Subject: [PATCH 2/2] linux_usbfs: Gracefully handle buggy devices with a
configuration 0
The USB spec states that a configuration value of 0 is reserved and is
used to indicate the device in not configured (e.g. is in the address
state). Unfortunately some devices do exist that violate this and use 0
as the bConfigurationValue of the configuration descriptor.
Improve how the Linux backend handles such non-conformant devices by
adding special handling around the configuration value 0. Most devices
will not require this special handling, but for those that do there is
no way to distinguish between the device being unconfigured and using
configuration 0.
Closes #850
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
---
libusb/os/linux_usbfs.c | 94 ++++++++++++++++++++++++++---------------
libusb/version_nano.h | 2 +-
2 files changed, 60 insertions(+), 36 deletions(-)
diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c
index ebf8cfe..3a1894c 100644
--- a/libusb/os/linux_usbfs.c
+++ b/libusb/os/linux_usbfs.c
@@ -128,7 +128,7 @@ struct linux_device_priv {
void *descriptors;
size_t descriptors_len;
struct config_descriptor *config_descriptors;
- uint8_t active_config; /* cache val for !sysfs_available */
+ int active_config; /* cache val for !sysfs_available */
};
struct linux_device_handle_priv {
@@ -169,6 +169,21 @@ struct linux_transfer_priv {
int iso_packet_offset;
};
+static int dev_has_config0(struct libusb_device *dev)
+{
+ struct linux_device_priv *priv = usbi_get_device_priv(dev);
+ struct config_descriptor *config;
+ uint8_t idx;
+
+ for (idx = 0; idx < dev->device_descriptor.bNumConfigurations; idx++) {
+ config = &priv->config_descriptors[idx];
+ if (config->desc->bConfigurationValue == 0)
+ return 1;
+ }
+
+ return 0;
+}
+
static int get_usbfs_fd(struct libusb_device *dev, mode_t mode, int silent)
{
struct libusb_context *ctx = DEVICE_CTX(dev);
@@ -574,22 +589,12 @@ static int sysfs_scan_device(struct libusb_context *ctx, const char *devname)
}
/* read the bConfigurationValue for a device */
-static int sysfs_get_active_config(struct libusb_device *dev, uint8_t *config)
+static int sysfs_get_active_config(struct libusb_device *dev, int *config)
{
struct linux_device_priv *priv = usbi_get_device_priv(dev);
- int ret, tmp;
-
- ret = read_sysfs_attr(DEVICE_CTX(dev), priv->sysfs_dir, "bConfigurationValue",
- UINT8_MAX, &tmp);
- if (ret < 0)
- return ret;
- if (tmp == -1)
- tmp = 0; /* unconfigured */
-
- *config = (uint8_t)tmp;
-
- return 0;
+ return read_sysfs_attr(DEVICE_CTX(dev), priv->sysfs_dir, "bConfigurationValue",
+ UINT8_MAX, config);
}
int linux_get_device_address(struct libusb_context *ctx, int detached,
@@ -765,6 +770,9 @@ static int parse_config_descriptors(struct libusb_device *dev)
}
}
+ if (config_desc->bConfigurationValue == 0)
+ usbi_warn(ctx, "device has configuration 0");
+
priv->config_descriptors[idx].desc = config_desc;
priv->config_descriptors[idx].actual_len = config_len;
@@ -798,7 +806,7 @@ static int op_get_active_config_descriptor(struct libusb_device *dev,
{
struct linux_device_priv *priv = usbi_get_device_priv(dev);
void *config_desc;
- uint8_t active_config;
+ int active_config;
int r;
if (priv->sysfs_dir) {
@@ -810,12 +818,12 @@ static int op_get_active_config_descriptor(struct libusb_device *dev,
active_config = priv->active_config;
}
- if (active_config == 0) {
+ if (active_config == -1) {
usbi_err(DEVICE_CTX(dev), "device unconfigured");
return LIBUSB_ERROR_NOT_FOUND;
}
- r = op_get_config_descriptor_by_value(dev, active_config, &config_desc);
+ r = op_get_config_descriptor_by_value(dev, (uint8_t)active_config, &config_desc);
if (r < 0)
return r;
@@ -863,17 +871,26 @@ static int usbfs_get_active_config(struct libusb_device *dev, int fd)
/* we hit this error path frequently with buggy devices :( */
usbi_warn(DEVICE_CTX(dev), "get configuration failed, errno=%d", errno);
+
+ /* assume the current configuration is the first one if we have
+ * the configuration descriptors, otherwise treat the device
+ * as unconfigured. */
+ if (priv->config_descriptors)
+ priv->active_config = (int)priv->config_descriptors[0].desc->bConfigurationValue;
+ else
+ priv->active_config = -1;
} else if (active_config == 0) {
- /* some buggy devices have a configuration 0, but we're
- * reaching into the corner of a corner case here, so let's
- * not support buggy devices in these circumstances.
- * stick to the specs: a configuration value of 0 means
- * unconfigured. */
- usbi_warn(DEVICE_CTX(dev), "active cfg 0? assuming unconfigured device");
+ if (dev_has_config0(dev)) {
+ /* some buggy devices have a configuration 0, but we're
+ * reaching into the corner of a corner case here. */
+ priv->active_config = 0;
+ } else {
+ priv->active_config = -1;
+ }
+ } else {
+ priv->active_config = (int)active_config;
}
- priv->active_config = active_config;
-
return LIBUSB_SUCCESS;
}
@@ -1004,9 +1021,9 @@ static int initialize_device(struct libusb_device *dev, uint8_t busnum,
usbi_warn(ctx, "Missing rw usbfs access; cannot determine "
"active configuration descriptor");
if (priv->config_descriptors)
- priv->active_config = priv->config_descriptors[0].desc->bConfigurationValue;
+ priv->active_config = (int)priv->config_descriptors[0].desc->bConfigurationValue;
else
- priv->active_config = 0; /* No config dt */
+ priv->active_config = -1; /* No config dt */
return LIBUSB_SUCCESS;
}
@@ -1428,22 +1445,27 @@ static int op_get_configuration(struct libusb_device_handle *handle,
uint8_t *config)
{
struct linux_device_priv *priv = usbi_get_device_priv(handle->dev);
+ int active_config;
int r;
if (priv->sysfs_dir) {
- r = sysfs_get_active_config(handle->dev, config);
+ r = sysfs_get_active_config(handle->dev, &active_config);
} else {
struct linux_device_handle_priv *hpriv = usbi_get_device_handle_priv(handle);
r = usbfs_get_active_config(handle->dev, hpriv->fd);
if (r == LIBUSB_SUCCESS)
- *config = priv->active_config;
+ active_config = priv->active_config;
}
if (r < 0)
return r;
- if (*config == 0)
- usbi_err(HANDLE_CTX(handle), "device unconfigured");
+ if (active_config == -1) {
+ usbi_warn(HANDLE_CTX(handle), "device unconfigured");
+ active_config = 0;
+ }
+
+ *config = (uint8_t)active_config;
return 0;
}
@@ -1467,11 +1489,13 @@ static int op_set_configuration(struct libusb_device_handle *handle, int config)
return LIBUSB_ERROR_OTHER;
}
- if (config == -1)
- config = 0;
+ /* if necessary, update our cached active config descriptor */
+ if (!priv->sysfs_dir) {
+ if (config == 0 && !dev_has_config0(handle->dev))
+ config = -1;
- /* update our cached active config descriptor */
- priv->active_config = (uint8_t)config;
+ priv->active_config = config;
+ }
return LIBUSB_SUCCESS;
}
--
2.29.2

15
changelog Normal file
View file

@ -0,0 +1,15 @@
* Fri Sep 30 2022 Kate Hsuan <hpa@redhat.com> 1.0.26-1
- Update to 1.0.26
* Wed Feb 02 2022 Benjamin Berg <bberg@redhat.com> 1.0.25-1
- Update to 1.0.25
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.24-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.24-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 19 18:47:55 CET 2021 Benjamin Berg <bberg@redhat.com> - 1.0.24-3
- New libusb1 package replacing libusbx
Resolves: #1918269

View file

@ -3,4 +3,10 @@ product_versions:
- fedora-*
decision_context: bodhi_update_push_testing
rules:
- !PassingTestCaseRule {test_case_name: dist.depcheck}
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

117
libusb1.keyring Normal file
View file

@ -0,0 +1,117 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: Hostname:
Version: Hockeypuck 2.2
xsFNBF7yPL0BEADQc/2dx8H7a7r1SGYph5hmkszs0O9V/43m8XhNnbnFraXjmbEv
xm2wE6AuR301mjAqYSt/mphmH54z4GBbgmLBrK8TGdhlK0K11PeSudRN4jsLs+U3
ErtkAHODmzyg7QiW3GWudP/lJQRSqNBoadeOdOsKMoJxm7T2a9fyyf8FR/FfShjv
NB62jSWq0x0WnglI/V/ZOi/mOnqoggCoWXLzwqbKasicvfNsTPJIsjiu24US6mif
nRllMWr/6aHyCOX6+x6PsQ35NF5C5B7b0c1fY7zU/UiM/JBF4HDf7jltzTIjHjho
jTwcEkCVmunW+jSwjsLcr/zkOsu1re0W/VJJNXOhSnNUDpM7t9FeSfJ0LGlXYnGI
5ZUCQ8w4RcKmkHYhepCjDVWYkCmxmTgO7LaAXZ5S0GeOoSDsvHNHYywAXNmB6A0s
3kv/8i3wT8K1w9972eYW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Axn8QkAZrslhe7zAdHp9nVuCn
NtLfN6M7WpF42uz7PLJP60wdNPYDHYdSkGiRs9KNPpmBY2PldkkA9IX1L5/TvcPR
mvzTnVVTlycj5N8bMrU4uIBxU3FwozpyNIfjQxRYXMe5GOU2eqtVYtxgeN7wqGZ8
dFzovMtHTKPPhEJ8uFSd//npnP6QMZgQA53Heaif9EbyrXJBlzRTPfGvr61XyNQk
5p5PG8RVrp3CdwEGZrYEkh5U4WR+C7SPZccMApzKGcb3
=sExt
-----END PGP PUBLIC KEY BLOCK-----

View file

@ -1,20 +1,32 @@
%bcond mingw %[0%{?fedora} && !0%{?flatpak}]
Summary: Library for accessing USB devices
Name: libusb1
Version: 1.0.24
Release: 4%{?dist}
Version: 1.0.29
Release: %autorelease
Source0: https://github.com/libusb/libusb/releases/download/v%{version}/libusb-%{version}.tar.bz2
License: LGPLv2+
Source1: https://github.com/libusb/libusb/releases/download/v%{version}/libusb-%{version}.tar.bz2.asc
Source2: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xc68187379b23de9efc46651e2c80ff56c6830a0e#/%{name}.keyring
License: LGPL-2.1-or-later
URL: http://libusb.info
BuildRequires: systemd-devel doxygen libtool
BuildRequires: umockdev-devel
BuildRequires: make
BuildRequires: gcc
BuildRequires: gnupg2
# libusbx was removed in F34
Provides: libusbx = %{version}-%{release}
Obsoletes: libusbx < %{version}-%{release}
Patch001: 0001-linux_usbfs-Accept-sysfs-attributes-not-terminated-w.patch
Patch002: 0001-linux_usbfs-Fix-parsing-of-descriptors-for-multi-con.patch
Patch003: 0002-linux_usbfs-Gracefully-handle-buggy-devices-with-a-c.patch
%if %{with mingw}
BuildRequires: mingw32-filesystem >= 95
BuildRequires: mingw32-gcc-c++
BuildRequires: mingw64-filesystem >= 95
BuildRequires: mingw64-gcc-c++
# mingw-libusbx was removed in F42
Provides: mingw-libusbx = %{version}-%{release}
Obsoletes: mingw-libusbx < %{version}-%{release}
%endif
%description
This package provides a way for applications to access USB devices.
@ -58,14 +70,40 @@ Obsoletes: libusbx-tests-examples < %{version}-%{release}
%description tests-examples
This package contains tests and examples for %{name}.
%if %{with mingw}
%package -n mingw32-%{name}
Summary: MinGW Windows %{name} library
Provides: mingw32-libusbx = %{version}-%{release}
Obsoletes: mingw32-libusbx < %{version}-%{release}
%description -n mingw32-%{name}
MinGW Windows %{name} library.
%package -n mingw64-%{name}
Summary: MinGW Windows %{name} library
Provides: mingw64-libusbx = %{version}-%{release}
Obsoletes: mingw64-libusbx < %{version}-%{release}
%description -n mingw64-%{name}
MinGW Windows %{name} library.
%endif
%prep
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%autosetup -p1 -n libusb-%{version}
chmod -x examples/*.c
mkdir -p m4
sed -i '/AM_LDFLAGS = -static/d' tests/Makefile.am
autoscan
aclocal
autoconf
automake --add-missing
%build
mkdir %{_target_os}
pushd %{_target_os}
%define _configure ../configure
%configure --disable-static --enable-examples-build
%{make_build}
pushd doc
@ -74,12 +112,24 @@ popd
pushd tests
make
popd
popd
%if %{with mingw}
# MinGW build
%mingw_configure --disable-static
%mingw_make_build
%endif
%install
pushd %{_target_os}
%{make_install}
mkdir -p $RPM_BUILD_ROOT%{_bindir}
install -m 755 tests/.libs/init_context $RPM_BUILD_ROOT%{_bindir}/libusb-test-init_context
install -m 755 tests/.libs/set_option $RPM_BUILD_ROOT%{_bindir}/libusb-test-set_option
install -m 755 tests/.libs/stress $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress
install -m 755 tests/.libs/stress_mt $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress_mt
install -m 755 tests/.libs/umockdev $RPM_BUILD_ROOT%{_bindir}/libusb-test-umockdev
install -m 755 examples/.libs/testlibusb \
$RPM_BUILD_ROOT%{_bindir}/libusb-test-libusb
# Some examples are very device-specific / require specific hw and miss --help
@ -89,13 +139,23 @@ for i in fxload listdevs xusb; do
$RPM_BUILD_ROOT%{_bindir}/libusb-example-$i
done
rm $RPM_BUILD_ROOT%{_libdir}/*.la
popd
%if %{with mingw}
%mingw_make_install
%endif
%check
pushd %{_target_os}
LD_LIBRARY_PATH=libusb/.libs ldd $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress
LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-test-init_context
LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-test-set_option
LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress
LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-test-umockdev
LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-test-libusb
LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-example-listdevs
popd
%ldconfig_scriptlets
@ -112,20 +172,36 @@ LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-example-listdevs
%{_libdir}/pkgconfig/libusb-1.0.pc
%files devel-doc
%doc doc/api-1.0 examples/*.c
%doc %{_target_os}/doc/api-1.0 examples/*.c
%files tests-examples
%{_bindir}/libusb-example-fxload
%{_bindir}/libusb-example-listdevs
%{_bindir}/libusb-example-xusb
%{_bindir}/libusb-test-init_context
%{_bindir}/libusb-test-set_option
%{_bindir}/libusb-test-stress
%{_bindir}/libusb-test-stress_mt
%{_bindir}/libusb-test-umockdev
%{_bindir}/libusb-test-libusb
%if %{with mingw}
%files -n mingw32-libusb1
%license COPYING
%doc AUTHORS README ChangeLog
%{mingw32_bindir}/libusb-1.0.dll
%{mingw32_includedir}/libusb-1.0
%{mingw32_libdir}/*.dll.a
%{mingw32_libdir}/pkgconfig/libusb-1.0.pc
%files -n mingw64-libusb1
%license COPYING
%doc AUTHORS README ChangeLog
%{mingw64_bindir}/libusb-1.0.dll
%{mingw64_includedir}/libusb-1.0
%{mingw64_libdir}/*.dll.a
%{mingw64_libdir}/pkgconfig/libusb-1.0.pc
%endif
%changelog
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.24-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 19 18:47:55 CET 2021 Benjamin Berg <bberg@redhat.com> - 1.0.24-3
- New libusb1 package replacing libusbx
Resolves: #1918269
%autochangelog

11
plans/integration.fmf Normal file
View file

@ -0,0 +1,11 @@
summary: Basic smoke test
discover:
how: fmf
prepare:
- name: packages
how: install
package:
- glibc-common
- libusb1-tests-examples
execute:
how: tmt

View file

@ -1 +1,2 @@
SHA512 (libusb-1.0.24.tar.bz2) = 5aea36a530aaa15c6dd656d0ed3ce204522c9946d8d39ffbb290dab4a98cda388a2598da4995123d1032324056090bd429e702459626d3e8d7daeebc4e7ff3dc
SHA512 (libusb-1.0.29.tar.bz2) = 04f8bda8197c9ecf52709609b8fbfea762fd82ddb5cde153a7630b0e8ed557d42da8cbc44f2f593aa22fdd0762e16716300565d67adb0c5240d7f3723321f690
SHA512 (libusb-1.0.29.tar.bz2.asc) = 57e12d3a58d8ac418e28f6d83a7cb8c0268ed5d2752707796aa5bf1f8bcf2a8083aa664d36ffcdcc96da62153afa792728662fa8230be9e2865d4a37003e199d

View file

@ -0,0 +1,6 @@
summary:
Test for libusb1
test: bash ./run.sh

View file

@ -4,5 +4,6 @@ set -e
ldd /usr/bin/libusb-test-stress
/usr/bin/libusb-test-stress
/usr/bin/libusb-test-umockdev
/usr/bin/libusb-test-libusb
/usr/bin/libusb-example-listdevs

View file

@ -1,17 +0,0 @@
---
- hosts: localhost
roles:
- role: standard-test-source
tags:
- always
required_packages:
- git
- role: standard-test-basic
tags:
- atomic
- classic
tests:
- test:
dir: .
run: run.sh