net-wireless/rtl-sdr: add rtl_tcp openrc support
authorRick Farina <zerochaos@gentoo.org>
Mon, 22 Jul 2019 01:41:03 +0000 (21:41 -0400)
committerRick Farina <zerochaos@gentoo.org>
Mon, 22 Jul 2019 01:41:03 +0000 (21:41 -0400)
Package-Manager: Portage-2.3.69, Repoman-2.3.16
Signed-off-by: Rick Farina <zerochaos@gentoo.org>
net-wireless/rtl-sdr/files/rtl_tcp.confd [new file with mode: 0644]
net-wireless/rtl-sdr/files/rtl_tcp.initd [new file with mode: 0644]
net-wireless/rtl-sdr/rtl-sdr-0.6.0-r1.ebuild [moved from net-wireless/rtl-sdr/rtl-sdr-0.6.0.ebuild with 88% similarity]
net-wireless/rtl-sdr/rtl-sdr-9999.ebuild

diff --git a/net-wireless/rtl-sdr/files/rtl_tcp.confd b/net-wireless/rtl-sdr/files/rtl_tcp.confd
new file mode 100644 (file)
index 0000000..530e89f
--- /dev/null
@@ -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 (file)
index 0000000..2e4d07b
--- /dev/null
@@ -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 ${?}
+}
similarity index 88%
rename from net-wireless/rtl-sdr/rtl-sdr-0.6.0.ebuild
rename to net-wireless/rtl-sdr/rtl-sdr-0.6.0-r1.ebuild
index a6d38d237ac66b2094e956be9b2fd306a531b47d..59c56f84f78b22cfca8acb19c4f161a4a9298c6a 100644 (file)
@@ -44,6 +44,12 @@ src_configure() {
        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 <USER> usb', then have <USER> re-login."
index cb32ad203bb97419e44dcd0f49ea18ba809273a7..5b9fb0899d30c361ef73fce39e0c5f7fba3fb797 100644 (file)
@@ -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 <USER> usb', then have <USER> re-login."