uci: update to the latest version
[openwrt/openwrt.git] / package / system / uci / Makefile
1 #
2 # Copyright (C) 2008-2014 OpenWrt.org
3 # Copyright (C) 2016 LEDE project
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=uci
12 PKG_RELEASE:=1
13
14 PKG_SOURCE_URL=$(LEDE_GIT)/project/uci.git
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE_DATE=2017-04-12
17 PKG_SOURCE_VERSION:=c4df32b386c7bb29568140d135d7315e76c934b7
18 PKG_MIRROR_HASH:=88abfe828f164666e3d3c90141449d9c8f622d32b29df135b1b72fcadbb2cb34
19
20 PKG_LICENSE:=LGPL-2.1
21 PKG_LICENSE_FILES:=
22
23 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
24
25 PKG_BUILD_PARALLEL:=0
26
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/cmake.mk
29
30 # set to 1 to enable debugging
31 DEBUG=
32
33 define Package/libuci
34 SECTION:=libs
35 CATEGORY:=Libraries
36 TITLE:=C library for the Unified Configuration Interface (UCI)
37 DEPENDS:=+libubox
38 endef
39
40 define Package/uci
41 SECTION:=base
42 CATEGORY:=Base system
43 DEPENDS:=+libuci
44 TITLE:=Utility for the Unified Configuration Interface (UCI)
45 endef
46
47 define Package/libuci-lua
48 SECTION=libs
49 CATEGORY=Libraries
50 DEPENDS:=+libuci +liblua
51 TITLE:=Lua plugin for UCI
52 endef
53
54 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
55 TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib
56
57 CMAKE_OPTIONS = \
58 -DLUAPATH=/usr/lib/lua \
59 $(if $(DEBUG),-DUCI_DEBUG=ON)
60
61 define Package/libuci/install
62 $(INSTALL_DIR) $(1)/lib
63 $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/lib/
64 endef
65
66 define Package/libuci-lua/install
67 $(INSTALL_DIR) $(1)/usr/lib/lua
68 $(CP) $(PKG_BUILD_DIR)/lua/uci.so $(1)/usr/lib/lua/
69 endef
70
71 define Package/uci/install
72 $(INSTALL_DIR) $(1)/etc/uci-defaults
73 $(INSTALL_DIR) $(1)/sbin
74 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uci $(1)/sbin/
75 $(CP) ./files/* $(1)/
76 endef
77
78 define Build/InstallDev
79 $(INSTALL_DIR) $(1)/usr/include
80 $(CP) $(PKG_BUILD_DIR)/uci{,_config,_blob,map}.h $(1)/usr/include
81 $(INSTALL_DIR) $(1)/usr/lib
82 $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/usr/lib
83 $(CP) $(PKG_BUILD_DIR)/libucimap.a $(1)/usr/lib
84 endef
85
86 $(eval $(call BuildPackage,uci))
87 $(eval $(call BuildPackage,libuci))
88 $(eval $(call BuildPackage,libuci-lua))