%define xtrx_group xtrx %define sover 0 %define libname libxtrxll%{sover} %global _udevrulesdir /etc/udev/rules.d Name: libxtrxll Version: 0.0.0+git.20201202 Release: 1.2 Summary: XTRX Low-level API library License: LGPL-2.1-only Group: Development/Libraries/C and C++ URL: http://xtrx.io #Git-Clone: https://github.com/xtrx-sdr/libxtrxll.git Source: %{name}-%{version}.tar.gz Patch0: libxtrxll-fix-udev-permissions.patch BuildRequires: cmake BuildRequires: git-core BuildRequires: gcc-c++ BuildRequires: pkgconfig BuildRequires: pkgconfig(libusb) BuildRequires: pkgconfig(libusb3380) %description Low level XTRX hardware abstraction library. %package -n %{libname} Summary: XTRX Low-level API library Group: System/Libraries Requires: xtrx-usb-udev %description -n %{libname} Low level XTRX hardware abstraction library. %package devel Summary: XTRX Low-level API library - devel Group: Development/Libraries/C and C++ Requires: %{libname} = %{version} %description devel Low level XTRX hardware abstraction library. This subpackage contains libraries and header files for developing applications that want to make use of libxtrxll. %package -n xtrxll-tools Summary: Low level tools for XTRX Group: Hardware/Other %description -n xtrxll-tools Low level tools for XTRX SDR devices. %package -n xtrx-usb-udev Summary: Udev rules for XTRX USB devices Group: Hardware/Other Provides: xtrx-udev = %{version} Obsoletes: xtrx-udev < %{version} BuildArch: noarch %description -n xtrx-usb-udev Udev rules for XTRX USB devices. %prep %setup -q %patch 0 -p1 %build %cmake \ -DCMAKE_SHARED_LINKER_FLAGS="" \ %ifarch %{ix86} x86_64 -DFORCE_ARCH=x86_64 \ %endif %ifarch %{arm} aarch64 -DFORCE_ARCH=arm \ %endif -DENABLE_PCIE=ON \ -DENABLE_USB3380=ON \ -DINSTALL_UDEV_RULES=ON \ -DUDEV_RULES_PATH=%{_udevrulesdir} %cmake_build %install %cmake_install install -d %{buildroot}/%{_bindir} mv %{buildroot}%{_libdir}/xtrxll/test_xtrxflash %{buildroot}/%{_bindir} mv %{buildroot}%{_libdir}/xtrxll/test_xtrxll %{buildroot}/%{_bindir} %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig %pre -n xtrx-usb-udev getent group %{xtrx_group} >/dev/null || groupadd -r %{xtrx_group} %post -n xtrx-usb-udev %udev_rules_update %postun -n xtrx-usb-udev %udev_rules_update %files -n xtrx-usb-udev %{_udevrulesdir}/50-xtrx.rules %files -n %{libname} %license LICENSE %doc README.md %{_libdir}/libxtrxll.so.%{sover}* %files devel %{_includedir}/xtrxll_*.h %{_libdir}/libxtrxll.so %{_libdir}/pkgconfig/libxtrxll.pc %files -n xtrxll-tools %{_bindir}/test_xtrxflash %{_bindir}/test_xtrxll %files -n xtrx-usb-udev %{_udevrulesdir}/50-xtrx-usb3380.rules %changelog * Wed Dec 09 2020 lu3vea@gmail.com - 2019.07-1 - First Fedora spec