Makefile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #
  2. # Copyright (C) 2009 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/kernel.mk
  9. PKG_NAME:=crda
  10. PKG_RELEASE:=2
  11. PKG_VERSION:=1.1.0
  12. PKG_SOURCE_URL:=http://wireless.kernel.org/download/crda
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  14. PKG_MD5SUM:=6004584d2e39e899f7642b141dd72028
  15. PKG_BUILD_DEPENDS:=mac80211
  16. PKG_REGULATORY_NAME:=regulatory
  17. PKG_REGULATORY_VERSION:=2010.11.17
  18. PKG_REGULATORY_SOURCE_URL:=http://mirror2.openwrt.org/sources
  19. #PKG_REGULATORY_SOURCE_URL:=http://wireless.kernel.org/download/wireless-regdb/regulatory.bins
  20. PKG_REGULATORY_SOURCE:=$(PKG_REGULATORY_VERSION)-$(PKG_REGULATORY_NAME).bin
  21. PKG_REGULATORY_MD5SUM:=4a497f045d93a8d5b135f4d2816faa83
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/crda
  24. SECTION:=net
  25. CATEGORY:=Network
  26. TITLE:=Central Regulatory Domain Agent (CRDA)
  27. DEPENDS:=+libnl-tiny
  28. URL:=http://wireless.kernel.org/en/developers/Regulatory/CRDA
  29. endef
  30. define Download/wireless-regdb
  31. FILE:=$(PKG_REGULATORY_SOURCE)
  32. URL:=$(PKG_REGULATORY_SOURCE_URL)
  33. VERSION:=$(PKG_REGULATORY_VERSION)
  34. MD5SUM:=$(PKG_REGULATORY_MD5SUM)
  35. endef
  36. $(eval $(call Download,wireless-regdb))
  37. define Package/crda/description
  38. This is the Central Regulatory Domain Agent for Linux. It serves one
  39. purpose: tell Linux kernel what to enforce. In essence it is a udev
  40. helper for communication between the kernel and userspace. You only
  41. need to run this manually for debugging purposes. For manual changing
  42. of regulatory domains use iw (iw reg set) or wpa_supplicant (feature
  43. yet to be added).
  44. endef
  45. TARGET_CPPFLAGS := \
  46. -I$(STAGING_DIR)/usr/include/libnl-tiny \
  47. -D_GNU_SOURCE \
  48. $(TARGET_CPPFLAGS)
  49. MAKE_FLAGS += \
  50. NL1FOUND="" NL2FOUND=Y \
  51. NLLIBNAME="libnl-tiny" \
  52. NLLIBS="-lnl-tiny -lm" \
  53. REG_BIN="$(DL_DIR)/$(PKG_REGULATORY_SOURCE)" \
  54. crda
  55. define Package/crda/install
  56. $(INSTALL_DIR) $(1)/sbin
  57. $(INSTALL_DIR) $(1)/etc/hotplug.d
  58. $(INSTALL_DIR) $(1)/etc/hotplug.d/platform
  59. $(INSTALL_DIR) $(1)/usr/lib/crda
  60. $(INSTALL_BIN) $(PKG_BUILD_DIR)/crda $(1)/sbin/
  61. $(INSTALL_DATA) ./files/hotplug.rule $(1)/etc/hotplug.d/platform/10-regulatory
  62. $(INSTALL_DATA) $(DL_DIR)/$(PKG_REGULATORY_SOURCE) $(1)/usr/lib/crda/regulatory.bin
  63. endef
  64. $(eval $(call BuildPackage,crda))