From f0a30a6839a43a105216b843e223d47a17804e04025db06b8d6ec9fd7f319336 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Sat, 15 Apr 2017 20:40:57 +0000 Subject: [PATCH 1/5] Accepting request 488111 from home:mnhauke:sdr-devel - Add patch: 0001-Better-udev-handling.patch - Use proper cmake options - Use group rtlsdr in the udev-rules OBS-URL: https://build.opensuse.org/request/show/488111 OBS-URL: https://build.opensuse.org/package/show/hardware:sdr/rtl-sdr?expand=0&rev=6 --- 0001-Better-udev-handling.patch | 271 ++++++++++++++++++++++++++++++++ rtl-sdr.changes | 8 + rtl-sdr.spec | 15 +- 3 files changed, 291 insertions(+), 3 deletions(-) create mode 100644 0001-Better-udev-handling.patch diff --git a/0001-Better-udev-handling.patch b/0001-Better-udev-handling.patch new file mode 100644 index 0000000..ddcab6c --- /dev/null +++ b/0001-Better-udev-handling.patch @@ -0,0 +1,271 @@ +From b174a5f400f08b04c7595eaabf21484c5c689967 Mon Sep 17 00:00:00 2001 +From: Martin Hauke +Date: Sat, 15 Apr 2017 20:20:36 +0200 +Subject: [PATCH] Better udev-handling + +--- + CMakeLists.txt | 69 +++++++++++++++++++++++++++----- + rtl-sdr.rules => rtl-sdr.rules.in | 84 +++++++++++++++++++-------------------- + 2 files changed, 101 insertions(+), 52 deletions(-) + rename rtl-sdr.rules => rtl-sdr.rules.in (73%) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0597600..fd468b2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -102,16 +102,65 @@ add_custom_target(uninstall + ######################################################################## + # Install udev rules + ######################################################################## +-option(INSTALL_UDEV_RULES "Install udev rules for RTL-SDR" OFF) +-if (INSTALL_UDEV_RULES) +- install ( +- FILES rtl-sdr.rules +- DESTINATION "/etc/udev/rules.d" +- COMPONENT "udev" +- ) +-else (INSTALL_UDEV_RULES) +- message (STATUS "Udev rules not being installed, install them with -DINSTALL_UDEV_RULES=ON") +-endif (INSTALL_UDEV_RULES) ++if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") ++ SET(SYSTEM_IS_LINUX TRUE) ++ SET(UDEV_OPTION_DEFAULT ON) ++else() ++ SET(SYSTEM_IS_LINUX FALSE) ++ SET(UDEV_OPTION_DEFAULT OFF) ++endif() ++ ++option(INSTALL_UDEV_RULES ++ "Install udev rules for the RTLSDR" ++ ${UDEV_OPTION_DEFAULT} ++) ++ ++set(UDEV_RULES_PATH ++ "/etc/udev/rules.d" ++ CACHE STRING ++ "Target directory for udev rule installation. Ensure you have permissions to write to this directory." ++) ++ ++if(SYSTEM_IS_LINUX) ++ if(INSTALL_UDEV_RULES) ++ if(NOT DEFINED UDEV_RULES_GROUP) ++ foreach(group usb plugdev) ++ execute_process(COMMAND "getent" group "${group}" ++ RESULT_VARIABLE _GETENT_RESULT ++ OUTPUT_QUIET ++ ERROR_QUIET) ++ if(NOT _GETENT_RESULT) ++ message(STATUS "Setting udev rule group to - ${group}") ++ set(UDEV_RULES_GROUP ${group}) ++ break() ++ endif(NOT _GETENT_RESULT) ++ endforeach(group) ++ endif(NOT DEFINED UDEV_RULES_GROUP) ++ if(DEFINED UDEV_RULES_GROUP) ++ set(RTLSDR_GROUP "${UDEV_RULES_GROUP}" ++ CACHE STRING "Group to associate RTL-SDR devices with in udev rules") ++ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/rtl-sdr.rules.in ++ ${CMAKE_CURRENT_BINARY_DIR}/rtl-sdr.rules ++ @ONLY ++ ) ++ message(STATUS "RTL-SDR udev rules will be installed to '${UDEV_RULES_PATH}' upon running 'make install'") ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rtl-sdr.rules ++ DESTINATION ${UDEV_RULES_PATH} ++ COMPONENT "udev_rules") ++ else(UDEV_RULES_GROUP) ++ message(STATUS "RTL-SDR udev rules will not be installed because no suitable group was found") ++ message(STATUS "A group can be specified with -DUDEV_RULES_GROUP=") ++ endif(DEFINED UDEV_RULES_GROUP) ++ else(INSTALL_UDEV_RULES) ++ message(STATUS ++ "RTL-SDR udev rules will not be installed because INSTALL_UDEV_RULES=OFF" ++ ) ++ endif(INSTALL_UDEV_RULES) ++else(SYSTEM_IS_LINUX) ++ if(INSTALL_UDEV_RULES) ++ message(STATUS "udev rules not supported on this platform. Hide this message via -DINSTALL_UDEV_RULES=Off") ++ endif(INSTALL_UDEV_RULES) ++endif(SYSTEM_IS_LINUX) + + option(DETACH_KERNEL_DRIVER "Detach kernel driver if loaded" OFF) + if (DETACH_KERNEL_DRIVER) +diff --git a/rtl-sdr.rules b/rtl-sdr.rules.in +similarity index 73% +rename from rtl-sdr.rules +rename to rtl-sdr.rules.in +index b2f4054..9b83b10 100644 +--- a/rtl-sdr.rules ++++ b/rtl-sdr.rules.in +@@ -16,127 +16,127 @@ + # + + # original RTL2832U vid/pid (hama nano, for example) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2832", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2832", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # RTL2832U OEM vid/pid, e.g. ezcap EzTV668 (E4000), Newsky TV28T (E4000/R820T) etc. +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # DigitalNow Quad DVB-T PCI-E card (4x FC0012?) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0413", ATTRS{idProduct}=="6680", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0413", ATTRS{idProduct}=="6680", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Leadtek WinFast DTV Dongle mini D (FC0012) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0413", ATTRS{idProduct}=="6f0f", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0413", ATTRS{idProduct}=="6f0f", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Genius TVGo DVB-T03 USB dongle (Ver. B) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0458", ATTRS{idProduct}=="707f", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0458", ATTRS{idProduct}=="707f", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Terratec Cinergy T Stick Black (rev 1) (FC0012) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00a9", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00a9", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Terratec NOXON rev 1 (FC0013) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b3", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b3", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Terratec Deutschlandradio DAB Stick (FC0013) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b4", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b4", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Terratec NOXON DAB Stick - Radio Energy (FC0013) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b5", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b5", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Terratec Media Broadcast DAB Stick (FC0013) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b7", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b7", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Terratec BR DAB Stick (FC0013) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b8", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b8", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Terratec WDR DAB Stick (FC0013) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b9", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b9", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Terratec MuellerVerlag DAB Stick (FC0013) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00c0", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00c0", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Terratec Fraunhofer DAB Stick (FC0013) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00c6", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00c6", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Terratec Cinergy T Stick RC (Rev.3) (E4000) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00d3", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00d3", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Terratec T Stick PLUS (E4000) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00d7", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00d7", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Terratec NOXON rev 2 (E4000) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00e0", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00e0", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # PixelView PV-DT235U(RN) (FC0012) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1554", ATTRS{idProduct}=="5020", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1554", ATTRS{idProduct}=="5020", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Astrometa DVB-T/DVB-T2 (R828D) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="15f4", ATTRS{idProduct}=="0131", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="15f4", ATTRS{idProduct}=="0131", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # HanfTek DAB+FM+DVB-T +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="15f4", ATTRS{idProduct}=="0133", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="15f4", ATTRS{idProduct}=="0133", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Compro Videomate U620F (E4000) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="185b", ATTRS{idProduct}=="0620", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="185b", ATTRS{idProduct}=="0620", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Compro Videomate U650F (E4000) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="185b", ATTRS{idProduct}=="0650", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="185b", ATTRS{idProduct}=="0650", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Compro Videomate U680F (E4000) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="185b", ATTRS{idProduct}=="0680", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="185b", ATTRS{idProduct}=="0680", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # GIGABYTE GT-U7300 (FC0012) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d393", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d393", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # DIKOM USB-DVBT HD +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d394", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d394", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Peak 102569AGPK (FC0012) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d395", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d395", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # KWorld KW-UB450-T USB DVB-T Pico TV (TUA9001) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d397", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d397", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Zaapa ZT-MINDVBZP (FC0012) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d398", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d398", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # SVEON STV20 DVB-T USB & FM (FC0012) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d39d", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d39d", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Twintech UT-40 (FC0013) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d3a4", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d3a4", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # ASUS U3100MINI_PLUS_V2 (FC0013) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d3a8", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d3a8", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # SVEON STV27 DVB-T USB & FM (FC0013) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d3af", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d3af", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # SVEON STV21 DVB-T USB & FM +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d3b0", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d3b0", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Dexatek DK DVB-T Dongle (Logilink VG0002A) (FC2580) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="1101", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="1101", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Dexatek DK DVB-T Dongle (MSI DigiVox mini II V3.0) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="1102", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="1102", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Dexatek DK 5217 DVB-T Dongle (FC2580) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="1103", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="1103", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # MSI DigiVox Micro HD (FC2580) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="1104", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="1104", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Sweex DVB-T USB (FC0012) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="a803", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="a803", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # GTek T803 (FC0012) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="b803", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="b803", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # Lifeview LV5TDeluxe (FC0012) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="c803", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="c803", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # MyGica TD312 (FC0012) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="d286", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="d286", MODE:="0660", GROUP="@RTLSDR_GROUP@" + + # PROlectrix DV107669 (FC0012) +-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="d803", MODE:="0666" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="d803", MODE:="0660", GROUP="@RTLSDR_GROUP@" +-- +2.12.0 + diff --git a/rtl-sdr.changes b/rtl-sdr.changes index 2b51432..06fed96 100644 --- a/rtl-sdr.changes +++ b/rtl-sdr.changes @@ -1,3 +1,11 @@ + +------------------------------------------------------------------- +Sat Apr 15 18:23:22 UTC 2017 - mardnh@gmx.de + +- Add patch: 0001-Better-udev-handling.patch +- Use proper cmake options +- Use group rtlsdr in the udev-rules + ------------------------------------------------------------------- Thu Mar 23 15:19:35 UTC 2017 - jengelh@inai.de diff --git a/rtl-sdr.spec b/rtl-sdr.spec index bcf7d0b..186080b 100644 --- a/rtl-sdr.spec +++ b/rtl-sdr.spec @@ -18,6 +18,7 @@ %define sover 0 %define libname librtlsdr%{sover} +%define rtlsdr_group rtlsdr Name: rtl-sdr Version: 0.5.3+git.20161127 Release: 0 @@ -25,11 +26,14 @@ Summary: Support programs for RTL2832 License: GPL-2.0+ Group: Productivity/Hamradio/Other Url: http://sdr.osmocom.org/trac/wiki/rtl-sdr +#Git-Clone: https://git.osmocom.org/rtl-sdr Source: %{name}-%{version}.tar.xz +Patch0: 0001-Better-udev-handling.patch BuildRequires: cmake BuildRequires: pkgconfig BuildRequires: pkgconfig(libusb-1.0) BuildRequires: pkgconfig(udev) +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description Programs that controls Realtek RTL2832 based DVB dongle in raw mode, so @@ -60,9 +64,14 @@ Library headers for rtl-sdr driver. %prep %setup -q +%patch0 -p1 %build %cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DINSTALL_UDEV_RULES=ON \ + -DUDEV_RULES_PATH=%{_udevrulesdir} \ + -DUDEV_RULES_GROUP=%{rtlsdr_group} \ -DDETACH_KERNEL_DRIVER=ON make %{?_smp_mflags} @@ -70,8 +79,8 @@ make %{?_smp_mflags} %cmake_install rm %{buildroot}%{_libdir}/librtlsdr.a -install -D -p -m 0644 ./rtl-sdr.rules \ - %{buildroot}%{_udevrulesdir}/10-rtl-sdr.rules +%pre +%{_sbindir}/groupadd -r %{rtlsdr_group} 2> /dev/null || : %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig @@ -99,7 +108,7 @@ install -D -p -m 0644 ./rtl-sdr.rules \ %files udev %defattr(-,root,root) -%{_udevrulesdir}/10-rtl-sdr.rules +%{_udevrulesdir}/rtl-sdr.rules %files devel %defattr(-,root,root) From 1273f09eee75c66eb5d5212d55b70b9abb877e77a75f441a7d3f1e63cd329844 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Sat, 15 Apr 2017 20:41:45 +0000 Subject: [PATCH 2/5] OBS-URL: https://build.opensuse.org/package/show/hardware:sdr/rtl-sdr?expand=0&rev=7 --- rtl-sdr.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/rtl-sdr.spec b/rtl-sdr.spec index 186080b..37fb14d 100644 --- a/rtl-sdr.spec +++ b/rtl-sdr.spec @@ -33,7 +33,6 @@ BuildRequires: cmake BuildRequires: pkgconfig BuildRequires: pkgconfig(libusb-1.0) BuildRequires: pkgconfig(udev) -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description Programs that controls Realtek RTL2832 based DVB dongle in raw mode, so @@ -68,7 +67,6 @@ Library headers for rtl-sdr driver. %build %cmake \ - -DCMAKE_BUILD_TYPE=Release \ -DINSTALL_UDEV_RULES=ON \ -DUDEV_RULES_PATH=%{_udevrulesdir} \ -DUDEV_RULES_GROUP=%{rtlsdr_group} \ From 053a5278624b43657668fc9676341291e813d5e343c7bfcbb4d7142945d50c20 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Thu, 20 Apr 2017 11:50:15 +0000 Subject: [PATCH 3/5] - Update group handling OBS-URL: https://build.opensuse.org/package/show/hardware:sdr/rtl-sdr?expand=0&rev=8 --- rtl-sdr.changes | 4 ++++ rtl-sdr.spec | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/rtl-sdr.changes b/rtl-sdr.changes index 06fed96..51988da 100644 --- a/rtl-sdr.changes +++ b/rtl-sdr.changes @@ -1,3 +1,7 @@ +------------------------------------------------------------------- +Thu Apr 20 11:50:00 UTC 2017 - mpluskal@suse.com + +- Update group handling ------------------------------------------------------------------- Sat Apr 15 18:23:22 UTC 2017 - mardnh@gmx.de diff --git a/rtl-sdr.spec b/rtl-sdr.spec index 37fb14d..07d82d1 100644 --- a/rtl-sdr.spec +++ b/rtl-sdr.spec @@ -78,7 +78,7 @@ make %{?_smp_mflags} rm %{buildroot}%{_libdir}/librtlsdr.a %pre -%{_sbindir}/groupadd -r %{rtlsdr_group} 2> /dev/null || : +getent group %{rtlsdr_group} >/dev/null || groupadd -r %{rtlsdr_group} %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig From 1200a3b0cf0c489f489b206e9737be68f62ffff72018b62bc51522374d418b3f Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Sun, 23 Apr 2017 16:23:20 +0000 Subject: [PATCH 4/5] OBS-URL: https://build.opensuse.org/package/show/hardware:sdr/rtl-sdr?expand=0&rev=9 --- rtl-sdr.changes | 2 +- rtl-sdr.spec | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/rtl-sdr.changes b/rtl-sdr.changes index 51988da..bdae907 100644 --- a/rtl-sdr.changes +++ b/rtl-sdr.changes @@ -1,5 +1,5 @@ ------------------------------------------------------------------- -Thu Apr 20 11:50:00 UTC 2017 - mpluskal@suse.com +Sun Apr 23 16:22:00 UTC 2017 - mpluskal@suse.com - Update group handling diff --git a/rtl-sdr.spec b/rtl-sdr.spec index 07d82d1..600d533 100644 --- a/rtl-sdr.spec +++ b/rtl-sdr.spec @@ -49,6 +49,7 @@ Library to run Realtek RTL2832 based DVB dongle as a SDR receiver. %package udev Summary: Udev rules for RTL2832 Group: Hardware/Other +Requires(pre): shadow %description udev Udev rules for rtl-sdr driver @@ -77,12 +78,12 @@ make %{?_smp_mflags} %cmake_install rm %{buildroot}%{_libdir}/librtlsdr.a -%pre -getent group %{rtlsdr_group} >/dev/null || groupadd -r %{rtlsdr_group} - %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig +%pre udev +getent group %{rtlsdr_group} >/dev/null || groupadd -r %{rtlsdr_group} + %post udev %udev_rules_update From 68a8b17b643a9a8deea9c0e2a8ed7be12dedd2187ed277cf0bd5bb41006714c2 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Sun, 23 Apr 2017 18:24:37 +0000 Subject: [PATCH 5/5] Accepting request 490039 from home:mnhauke:sdr-devel - Use package-meta for tar_scm service and add git-core to BuildRequires OBS-URL: https://build.opensuse.org/request/show/490039 OBS-URL: https://build.opensuse.org/package/show/hardware:sdr/rtl-sdr?expand=0&rev=10 --- _service | 1 + rtl-sdr-0.5.3+git.20161127.tar.xz | 4 ++-- rtl-sdr.changes | 6 ++++++ rtl-sdr.spec | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/_service b/_service index 7f6ec67..b6b1b0a 100644 --- a/_service +++ b/_service @@ -2,6 +2,7 @@ git://git.osmocom.org/rtl-sdr.git git + yes enable rtl-sdr 0.5.3+git.%cd diff --git a/rtl-sdr-0.5.3+git.20161127.tar.xz b/rtl-sdr-0.5.3+git.20161127.tar.xz index 7f4225a..52f732a 100644 --- a/rtl-sdr-0.5.3+git.20161127.tar.xz +++ b/rtl-sdr-0.5.3+git.20161127.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:96f3e68d7c4a8a4f0d91b7f6f0e784dd2e1f465b7f21553d5d171c8df03f8ade -size 98368 +oid sha256:9ec79cb694bc308f7082d9d7e8a5058f098fe451591637d4b32c3696f3ef0940 +size 486524 diff --git a/rtl-sdr.changes b/rtl-sdr.changes index bdae907..c033c6d 100644 --- a/rtl-sdr.changes +++ b/rtl-sdr.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Apr 23 17:52:05 UTC 2017 - mardnh@gmx.de + +- Use package-meta for tar_scm service and add git-core + to BuildRequires + ------------------------------------------------------------------- Sun Apr 23 16:22:00 UTC 2017 - mpluskal@suse.com diff --git a/rtl-sdr.spec b/rtl-sdr.spec index 600d533..22ae892 100644 --- a/rtl-sdr.spec +++ b/rtl-sdr.spec @@ -30,6 +30,7 @@ Url: http://sdr.osmocom.org/trac/wiki/rtl-sdr Source: %{name}-%{version}.tar.xz Patch0: 0001-Better-udev-handling.patch BuildRequires: cmake +BuildRequires: git-core BuildRequires: pkgconfig BuildRequires: pkgconfig(libusb-1.0) BuildRequires: pkgconfig(udev)