From eadff1810e2702d0b99c91f74c91b81b483dc560 Mon Sep 17 00:00:00 2001 From: Rick Farina Date: Sun, 21 Jul 2019 21:41:03 -0400 Subject: net-wireless/rtl-sdr: add rtl_tcp openrc support Package-Manager: Portage-2.3.69, Repoman-2.3.16 Signed-off-by: Rick Farina --- net-wireless/rtl-sdr/files/rtl_tcp.confd | 4 ++ net-wireless/rtl-sdr/files/rtl_tcp.initd | 18 +++++++++ net-wireless/rtl-sdr/rtl-sdr-0.6.0-r1.ebuild | 56 ++++++++++++++++++++++++++++ net-wireless/rtl-sdr/rtl-sdr-0.6.0.ebuild | 50 ------------------------- net-wireless/rtl-sdr/rtl-sdr-9999.ebuild | 10 ++++- 5 files changed, 86 insertions(+), 52 deletions(-) create mode 100644 net-wireless/rtl-sdr/files/rtl_tcp.confd create mode 100644 net-wireless/rtl-sdr/files/rtl_tcp.initd create mode 100644 net-wireless/rtl-sdr/rtl-sdr-0.6.0-r1.ebuild delete mode 100644 net-wireless/rtl-sdr/rtl-sdr-0.6.0.ebuild (limited to 'net-wireless/rtl-sdr') diff --git a/net-wireless/rtl-sdr/files/rtl_tcp.confd b/net-wireless/rtl-sdr/files/rtl_tcp.confd new file mode 100644 index 000000000000..530e89fc940d --- /dev/null +++ b/net-wireless/rtl-sdr/files/rtl_tcp.confd @@ -0,0 +1,4 @@ +# /etc/conf.d/rtl_tcp - configuration file for /etc/init.d/rtl_tcp + +# Options to pass to rtl_tcp, see `rtl_tcp -h` +#RTL_TCP_OPTIONS="-d0" diff --git a/net-wireless/rtl-sdr/files/rtl_tcp.initd b/net-wireless/rtl-sdr/files/rtl_tcp.initd new file mode 100644 index 000000000000..2e4d07b8c28a --- /dev/null +++ b/net-wireless/rtl-sdr/files/rtl_tcp.initd @@ -0,0 +1,18 @@ +#!/sbin/openrc-run +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +start() { + ebegin "Starting rtl_tcp" + start-stop-daemon --start --quiet --pidfile /run/rtl_tcp.pid \ + --background --make-pidfile --exec /usr/bin/rtl_tcp \ + -1 /var/log/rtl_tcp.log -2 /var/log/rtl_tcp.log \ + -- ${RTL_TCP_OPTIONS} + eend ${?} +} + +stop() { + ebegin "Stopping rtl_tcp" + start-stop-daemon --stop --quiet --pidfile /run/rtl_tcp.pid + eend ${?} +} diff --git a/net-wireless/rtl-sdr/rtl-sdr-0.6.0-r1.ebuild b/net-wireless/rtl-sdr/rtl-sdr-0.6.0-r1.ebuild new file mode 100644 index 000000000000..59c56f84f78b --- /dev/null +++ b/net-wireless/rtl-sdr/rtl-sdr-0.6.0-r1.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit cmake-utils multilib + +DESCRIPTION="turns your Realtek RTL2832 based DVB dongle into a SDR receiver" +HOMEPAGE="http://sdr.osmocom.org/trac/wiki/rtl-sdr" + +if [[ ${PV} == 9999* ]]; then + inherit git-r3 + SRC_URI="" + EGIT_REPO_URI="https://git.osmocom.org/${PN}" + KEYWORDS="" +else + SRC_URI="https://github.com/steve-m/librtlsdr/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64 ~x86" + S="${WORKDIR}"/librtlsdr-${PV} +fi + +LICENSE="GPL-2" +SLOT="0" +IUSE="" + +DEPEND="virtual/libusb:1" +RDEPEND="${DEPEND}" + +src_unpack() { + if [[ ${PV} == 9999* ]]; then + git-r3_src_unpack + else + default + fi +} + +src_configure() { + #the udev rules are 666, we don't want that + mycmakeargs=( + -DINSTALL_UDEV_RULES=OFF + -DDETACH_KERNEL_DRIVER=ON + -DLIB_INSTALL_DIR=$(get_libdir) + ) + cmake-utils_src_configure +} + +src_install() { + cmake-utils_src_install + newinitd "${FILESDIR}"/rtl_tcp.initd rtl_tcp + newconfd "${FILESDIR}"/rtl_tcp.confd rtl_tcp +} + +pkg_postinst() { + elog "Only users in the usb group can capture." + elog "Just run 'gpasswd -a usb', then have re-login." +} diff --git a/net-wireless/rtl-sdr/rtl-sdr-0.6.0.ebuild b/net-wireless/rtl-sdr/rtl-sdr-0.6.0.ebuild deleted file mode 100644 index a6d38d237ac6..000000000000 --- a/net-wireless/rtl-sdr/rtl-sdr-0.6.0.ebuild +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit cmake-utils multilib - -DESCRIPTION="turns your Realtek RTL2832 based DVB dongle into a SDR receiver" -HOMEPAGE="http://sdr.osmocom.org/trac/wiki/rtl-sdr" - -if [[ ${PV} == 9999* ]]; then - inherit git-r3 - SRC_URI="" - EGIT_REPO_URI="https://git.osmocom.org/${PN}" - KEYWORDS="" -else - SRC_URI="https://github.com/steve-m/librtlsdr/archive/${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64 ~arm ~arm64 ~x86" - S="${WORKDIR}"/librtlsdr-${PV} -fi - -LICENSE="GPL-2" -SLOT="0" -IUSE="" - -DEPEND="virtual/libusb:1" -RDEPEND="${DEPEND}" - -src_unpack() { - if [[ ${PV} == 9999* ]]; then - git-r3_src_unpack - else - default - fi -} - -src_configure() { - #the udev rules are 666, we don't want that - mycmakeargs=( - -DINSTALL_UDEV_RULES=OFF - -DDETACH_KERNEL_DRIVER=ON - -DLIB_INSTALL_DIR=$(get_libdir) - ) - cmake-utils_src_configure -} - -pkg_postinst() { - elog "Only users in the usb group can capture." - elog "Just run 'gpasswd -a usb', then have re-login." -} diff --git a/net-wireless/rtl-sdr/rtl-sdr-9999.ebuild b/net-wireless/rtl-sdr/rtl-sdr-9999.ebuild index cb32ad203bb9..5b9fb0899d30 100644 --- a/net-wireless/rtl-sdr/rtl-sdr-9999.ebuild +++ b/net-wireless/rtl-sdr/rtl-sdr-9999.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=6 @@ -41,11 +41,17 @@ src_configure() { mycmakeargs=( -DINSTALL_UDEV_RULES=OFF -DDETACH_KERNEL_DRIVER=ON - -DLIB_INSTALL_DIR=/usr/$(get_libdir) + -DLIB_INSTALL_DIR=$(get_libdir) ) cmake-utils_src_configure } +src_install() { + cmake-utils_src_install + newinitd "${FILESDIR}"/rtl_tcp.initd rtl_tcp + newconfd "${FILESDIR}"/rtl_tcp.confd rtl_tcp +} + pkg_postinst() { elog "Only users in the usb group can capture." elog "Just run 'gpasswd -a usb', then have re-login." -- cgit v1.2.3-65-gdbad