Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #
  2. # Copyright (C) 2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. include $(TOPDIR)/rules.mk
  7. PKG_NAME:=rtl-sdr
  8. PKG_VERSION:=0.5.3-20150608-$(PKG_SOURCE_VERSION)
  9. PKG_RELEASE:=2
  10. PKG_SOURCE_PROTO:=git
  11. PKG_SOURCE_URL:=https://git.osmocom.org/rtl-sdr
  12. PKG_SOURCE_VERSION:=e3c03f738f5aef4dc51e2b741fbdb542b9cc1bb1
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
  16. PKG_BUILD_PARALLEL:=1
  17. CMAKE_INSTALL:=1
  18. PKG_LICENSE:=GPLv2
  19. PKG_LICENSE_FILES:=COPYING
  20. PKG_MAINTAINER:=Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr>
  21. include $(INCLUDE_DIR)/package.mk
  22. include $(INCLUDE_DIR)/cmake.mk
  23. define Package/rtl-sdr/Default
  24. TITLE:=Software Defined Radio with Realtek RTL2832U
  25. URL:=http://sdr.osmocom.org/trac/wiki/rtl-sdr
  26. endef
  27. define Package/rtl-sdr/Default/description
  28. rtl-sdr allows DVB-T dongles based on the Realtek RTL2832U to be used as
  29. an inexpensive SDR.
  30. endef
  31. define Package/rtl-sdr
  32. $(call Package/rtl-sdr/Default)
  33. SECTION:=utils
  34. CATEGORY:=Utilities
  35. DEPENDS:=+librt +libpthread +librtlsdr
  36. endef
  37. define Package/rtl-sdr/description
  38. $(call Package/rtl-sdr/Default/description)
  39. This package contains the utilities and daemons.
  40. endef
  41. define Package/librtlsdr
  42. $(call Package/rtl-sdr/Default)
  43. TITLE+= shared library
  44. SECTION:=libs
  45. CATEGORY:=Libraries
  46. TITLE+= library
  47. DEPENDS:=+libusb-1.0
  48. endef
  49. define Package/librtlsdr/description
  50. $(call Package/rtl-sdr/Default/description)
  51. This package contains the librtlsdr shared library.
  52. endef
  53. TARGET_CFLAGS += $(FPIC)
  54. define Build/InstallDev
  55. $(INSTALL_DIR) $(1)/usr/include
  56. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  57. $(INSTALL_DIR) $(1)/usr/lib
  58. $(CP) $(PKG_INSTALL_DIR)/usr/lib/librtlsdr.so* $(1)/usr/lib/
  59. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  60. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/librtlsdr.pc $(1)/usr/lib/pkgconfig/
  61. endef
  62. define Package/rtl-sdr/install
  63. $(INSTALL_DIR) $(1)/usr/bin
  64. $(CP) $(PKG_INSTALL_DIR)/usr/bin/rtl_* $(1)/usr/bin/
  65. $(INSTALL_DIR) $(1)/etc/init.d
  66. $(INSTALL_BIN) files/rtl_tcp.init $(1)/etc/init.d/rtl_tcp
  67. $(INSTALL_DIR) $(1)/etc/config
  68. $(INSTALL_CONF) files/rtl_tcp.config $(1)/etc/config/rtl_tcp
  69. endef
  70. define Package/librtlsdr/install
  71. $(INSTALL_DIR) $(1)/usr/lib
  72. $(CP) $(PKG_INSTALL_DIR)/usr/lib/librtlsdr.so* $(1)/usr/lib/
  73. endef
  74. $(eval $(call BuildPackage,rtl-sdr))
  75. $(eval $(call BuildPackage,librtlsdr))