upgrade to uci 0.5.0, adds list handling support
[openwrt/openwrt.git] / package / uci / Makefile
1 #
2 # Copyright (C) 2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 UCI_VERSION=0.5
12 UCI_RELEASE=0
13
14 PKG_NAME:=uci
15 PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE))
16 PKG_RELEASE:=1
17
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19 PKG_SOURCE_URL:=http://downloads.openwrt.org/sources
20 PKG_MD5SUM:=5db883e535d8175a568fa202d0aed190
21
22 include $(INCLUDE_DIR)/package.mk
23
24 # set to 1 to enable debugging
25 DEBUG=
26
27 define Package/libuci
28 SECTION:=libs
29 CATEGORY:=Libraries
30 TITLE:=C library for the Unified Configuration Interface (UCI)
31 endef
32
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
40 define Package/libuci-lua
41 SECTION=libs
42 CATEGORY=Libraries
43 DEPENDS:=+libuci +lua
44 TITLE:=Lua plugin for UCI
45 endef
46
47 define Build/Configure
48 endef
49
50 TARGET_CFLAGS += $(FPIC)
51 UCI_MAKEOPTS = \
52 $(TARGET_CONFIGURE_OPTS) \
53 COPTS="$(TARGET_CFLAGS)" \
54 DEBUG="$(DEBUG)" \
55 VERSION="$(UCI_VERSION)" \
56 CPPFLAGS="-I$(PKG_BUILD_DIR) -I$(STAGING_DIR)/usr/include" \
57 OS="Linux"
58
59 define Build/Compile
60 $(MAKE) -C $(PKG_BUILD_DIR) $(UCI_MAKEOPTS)
61 $(MAKE) -C $(PKG_BUILD_DIR)/lua $(UCI_MAKEOPTS)
62 endef
63
64 define Package/libuci/install
65 $(INSTALL_DIR) $(1)/lib
66 $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/lib/
67 endef
68
69 define Package/libuci-lua/install
70 $(INSTALL_DIR) $(1)/usr/lib/lua
71 $(CP) $(PKG_BUILD_DIR)/lua/uci.so $(1)/usr/lib/lua/
72 endef
73
74 define Package/uci/install
75 $(INSTALL_DIR) $(1)/etc/uci-defaults
76 $(INSTALL_DIR) $(1)/sbin
77 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uci $(1)/sbin/
78 $(CP) ./files/* $(1)/
79 endef
80
81 define Build/InstallDev
82 $(INSTALL_DIR) $(1)/usr/include
83 $(CP) $(PKG_BUILD_DIR)/uci{,_config}.h $(1)/usr/include
84 $(INSTALL_DIR) $(1)/usr/lib
85 $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/usr/lib
86 endef
87
88 $(eval $(call BuildPackage,uci))
89 $(eval $(call BuildPackage,libuci))
90 $(eval $(call BuildPackage,libuci-lua))