diff --git a/libusbx.rpmlintrc b/libusbx.rpmlintrc new file mode 100644 index 0000000..b3776ca --- /dev/null +++ b/libusbx.rpmlintrc @@ -0,0 +1,6 @@ +# The docs are on other subpackages +addFilter(r'no-documentation') +# Only the tests / example lack manpages, and there are no plans to fix this +addFilter(r'no-manual-page-for-binary') +# "libusb" is not a spelling error +addFilter(r'spelling-error') diff --git a/libusbx.spec b/libusbx.spec index ddacccf..5d23723 100644 --- a/libusbx.spec +++ b/libusbx.spec @@ -1,13 +1,12 @@ Summary: Library for accessing USB devices Name: libusbx Version: 1.0.22 -Release: 2%{?dist} +Release: 3%{?dist} # upstream libusbx has merged back with libusb and is now called libusb again # but we already have a libusb package for the old libusb-compat-0.1, renaming # that to libusb-compat while at the same time giving this its name is a bit # tricky, lets stick with the libusbx name for now Source0: https://github.com/libusb/libusb/releases/download/v1.0.22/libusb-1.0.22.tar.bz2 -#Source0: https://github.com/libusb/libusb/archive/v1.0.21-rc2/libusb-%{version}-rc2.tar.gz License: LGPLv2+ URL: http://libusb.info BuildRequires: systemd-devel doxygen libtool @@ -47,8 +46,17 @@ BuildArch: noarch This package contains API documentation for %{name}. +%package tests-examples +Summary: Tests and examples for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description tests-examples +This package contains tests and examples for %{name}. + + %prep %setup -q -n libusb-%{version} +chmod -x examples/*.c mkdir -p m4 autoreconf -ivf @@ -59,13 +67,33 @@ make %{?_smp_mflags} pushd doc make docs popd +pushd tests +make +popd %install %make_install +mkdir -p $RPM_BUILD_ROOT%{_bindir} +install -m 755 tests/.libs/stress $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress +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 +# So we only install a subset of more generic / useful examples +for i in fxload listdevs xusb; do + install -m 755 examples/.libs/$i \ + $RPM_BUILD_ROOT%{_bindir}/libusb-example-$i +done rm $RPM_BUILD_ROOT%{_libdir}/*.la +%check +LD_LIBRARY_PATH=libusb/.libs ldd $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress +LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-test-stress +LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-test-libusb +LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-example-listdevs + + %ldconfig_scriptlets @@ -82,8 +110,20 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la %files devel-doc %doc doc/html examples/*.c +%files tests-examples +%{_bindir}/libusb-example-fxload +%{_bindir}/libusb-example-listdevs +%{_bindir}/libusb-example-xusb +%{_bindir}/libusb-test-stress +%{_bindir}/libusb-test-libusb + %changelog +* Wed Mar 13 2019 Hans de Goede - 1.0.22-3 +- Add tests and examples to a new tests-examples subpackage, so that these + can be used for the upcoming gating stuff +- Add %%check using some of the tests/examples + * Fri Feb 01 2019 Fedora Release Engineering - 1.0.22-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild