Makefile 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #
  2. # Copyright (C) 2008-2014 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. UCI_VERSION=2015-08-27
  9. UCI_RELEASE=1
  10. PKG_NAME:=uci
  11. PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE))
  12. PKG_RELEASE:=1
  13. PKG_REV:=2cd94fd505b293e657278e31deb32a7d66d20714
  14. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  15. PKG_SOURCE_URL:=git://nbd.name/uci.git
  16. PKG_SOURCE_SUBDIR:=uci-$(PKG_VERSION)
  17. PKG_SOURCE_VERSION:=$(PKG_REV)
  18. PKG_SOURCE_PROTO:=git
  19. PKG_LICENSE:=LGPL-2.1
  20. PKG_LICENSE_FILES:=
  21. PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
  22. PKG_BUILD_PARALLEL:=0
  23. include $(INCLUDE_DIR)/package.mk
  24. include $(INCLUDE_DIR)/cmake.mk
  25. # set to 1 to enable debugging
  26. DEBUG=
  27. define Package/libuci
  28. SECTION:=libs
  29. CATEGORY:=Libraries
  30. TITLE:=C library for the Unified Configuration Interface (UCI)
  31. DEPENDS:=+libubox
  32. endef
  33. define Package/uci
  34. SECTION:=base
  35. CATEGORY:=Base system
  36. DEPENDS:=+libuci
  37. TITLE:=Utility for the Unified Configuration Interface (UCI)
  38. endef
  39. define Package/libuci-lua
  40. SECTION=libs
  41. CATEGORY=Libraries
  42. DEPENDS:=+libuci +liblua
  43. TITLE:=Lua plugin for UCI
  44. endef
  45. TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
  46. TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib
  47. CMAKE_OPTIONS = \
  48. -DLUAPATH=/usr/lib/lua \
  49. $(if $(DEBUG),-DUCI_DEBUG=ON)
  50. define Package/libuci/install
  51. $(INSTALL_DIR) $(1)/lib
  52. $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/lib/
  53. endef
  54. define Package/libuci-lua/install
  55. $(INSTALL_DIR) $(1)/usr/lib/lua
  56. $(CP) $(PKG_BUILD_DIR)/lua/uci.so $(1)/usr/lib/lua/
  57. endef
  58. define Package/uci/install
  59. $(INSTALL_DIR) $(1)/etc/uci-defaults
  60. $(INSTALL_DIR) $(1)/sbin
  61. $(INSTALL_BIN) $(PKG_BUILD_DIR)/uci $(1)/sbin/
  62. $(CP) ./files/* $(1)/
  63. endef
  64. define Build/InstallDev
  65. $(INSTALL_DIR) $(1)/usr/include
  66. $(CP) $(PKG_BUILD_DIR)/uci{,_config,_blob,map}.h $(1)/usr/include
  67. $(INSTALL_DIR) $(1)/usr/lib
  68. $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/usr/lib
  69. $(CP) $(PKG_BUILD_DIR)/libucimap.a $(1)/usr/lib
  70. endef
  71. $(eval $(call BuildPackage,uci))
  72. $(eval $(call BuildPackage,libuci))
  73. $(eval $(call BuildPackage,libuci-lua))