summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Melki <christian.melki@t2data.com>2021-11-18 14:49:30 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2021-11-27 12:02:21 +0100
commit423ab3e0d44f52f52011785091cd7ade9d1725e8 (patch)
tree3b4be10ab15689efedbe0c5c1164646bf90c56ae
parent90cb7745825c21908f3bacd99f4deafbaefd0940 (diff)
downloadptxdist-423ab3e0d44f52f52011785091cd7ade9d1725e8.tar.gz
ptxdist-423ab3e0d44f52f52011785091cd7ade9d1725e8.tar.xz
librtlsdr: New package. Version 0.8
librtlsdr is a library for using RealTek DVB-T receivers as SDR (Software Defined Radio). This library is used by various tools to tune into bands and decode radio data. Signed-off-by: Christian Melki <christian.melki@t2data.com> Message-Id: <20211118134931.3603813-1-christian.melki@t2data.com> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--rules/librtlsdr.in29
-rw-r--r--rules/librtlsdr.make66
2 files changed, 95 insertions, 0 deletions
diff --git a/rules/librtlsdr.in b/rules/librtlsdr.in
new file mode 100644
index 000000000..6f53ee7bb
--- /dev/null
+++ b/rules/librtlsdr.in
@@ -0,0 +1,29 @@
+## SECTION=system_libraries
+
+menuconfig LIBRTLSDR
+ tristate
+ prompt "librtlsdr "
+ select HOST_CMAKE
+ select LIBUSB
+ help
+ Realtek SDR (Software Defined Radio) library.
+
+if LIBRTLSDR
+
+comment "Install options ---"
+
+config LIBRTLSDR_TOOLS
+ bool
+ default y
+ prompt "Install tools "
+ help
+ Installs rtl-sdr tools.
+
+config LIBRTLSDR_UDEV
+ bool
+ default y
+ prompt "Install udev rules "
+ help
+ Installs udev rules.
+
+endif
diff --git a/rules/librtlsdr.make b/rules/librtlsdr.make
new file mode 100644
index 000000000..64f3492bd
--- /dev/null
+++ b/rules/librtlsdr.make
@@ -0,0 +1,66 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2021 by Christian Melki <christian.melki@t2data.com>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_LIBRTLSDR) += librtlsdr
+
+#
+# Paths and names
+#
+LIBRTLSDR_VERSION := 0.8.0
+LIBRTLSDR_MD5 := 64f31f30f79cd91e4cd70b0a8edcff4e
+LIBRTLSDR := librtlsdr-$(LIBRTLSDR_VERSION)
+LIBRTLSDR_SUFFIX := tar.gz
+LIBRTLSDR_URL := https://github.com/librtlsdr/librtlsdr/archive/refs/tags/v$(LIBRTLSDR_VERSION).$(LIBRTLSDR_SUFFIX)
+LIBRTLSDR_SOURCE := $(SRCDIR)/$(LIBRTLSDR).$(LIBRTLSDR_SUFFIX)
+LIBRTLSDR_DIR := $(BUILDDIR)/$(LIBRTLSDR)
+LIBRTLSDR_LICENSE := GPL-2.0-only
+LIBRTLSDR_LICENSE_FILES := \
+ file://COPYING;md5=751419260aa954499f7abaabaa882bbe
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+LIBRTLSDR_CONF_TOOL := cmake
+LIBRTLSDR_CONF_OPT := \
+ $(CROSS_CMAKE_USR) \
+ -DCMAKE_INSTALL_LIBDIR=/usr/$(CROSS_LIB_DIR) \
+ -DLIB_INSTALL_DIR=/usr/$(CROSS_LIB_DIR) \
+ -DENABLE_SHARED=ON \
+ -DINSTALL_UDEV_RULES=ON
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/librtlsdr.targetinstall:
+ @$(call targetinfo)
+ @$(call install_init, librtlsdr)
+ @$(call install_fixup, librtlsdr,PRIORITY,optional)
+ @$(call install_fixup, librtlsdr,SECTION,base)
+ @$(call install_fixup, librtlsdr,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
+ @$(call install_fixup, librtlsdr,DESCRIPTION,missing)
+ @$(call install_lib, librtlsdr, 0, 0, 0644, librtlsdr)
+
+ifdef PTXCONF_LIBRTLSDR_TOOLS
+ @$(call install_glob, librtlsdr, 0, 0, -, /usr/bin, *rtl_*,)
+endif
+
+ifdef PTXCONF_LIBRTLSDR_UDEV
+ @$(call install_copy, librtlsdr, 0, 0, 0644, \
+ $(LIBRTLSDR_PKGDIR)/etc/udev/rules.d/rtl-sdr.rules, \
+ /usr/lib/udev/rules.d/81-rtl-sdr.rules)
+endif
+
+ @$(call install_finish, librtlsdr)
+ @$(call touch)
+
+# vim: syntax=make