upgrade uci to 0.3.3, build lua plugin
[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.3
12 UCI_RELEASE=3
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:=e1d3204629938adb21c6bf84a08ce001
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/uci-sh
41   SECTION:=base
42   CATEGORY:=Base system
43   DEPENDS:=@!PACKAGE_uci
44   TITLE:=Old shell/awk implementation of UCI
45 endef
46
47 define Package/libuci-lua
48   SECTION=libs
49   CATEGORY=Libraries
50   DEPENDS:=+libuci +lua
51   TITLE:=Lua plugin for UCI
52 endef
53
54 define Build/Configure
55 endef
56
57 UCI_MAKEOPTS = \
58                 $(TARGET_CONFIGURE_OPTS) \
59                 COPTS="$(TARGET_CFLAGS)" \
60                 DEBUG="$(DEBUG)" \
61                 VERSION="$(UCI_VERSION)" \
62                 CPPFLAGS="-I$(PKG_BUILD_DIR) -I$(STAGING_DIR)/usr/include" \
63                 OS="Linux"
64
65 define Build/Compile
66         $(MAKE) -C $(PKG_BUILD_DIR) $(UCI_MAKEOPTS)
67         $(MAKE) -C $(PKG_BUILD_DIR)/lua $(UCI_MAKEOPTS)
68 endef
69
70 define Package/libuci/install
71         $(INSTALL_DIR) $(1)/lib
72         $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/lib/
73 endef
74
75 define Package/libuci-lua/install
76         $(INSTALL_DIR) $(1)/usr/lib/lua/5.1
77         $(CP) $(PKG_BUILD_DIR)/lua/uci.so $(1)/usr/lib/lua/5.1
78 endef
79
80 define Package/uci/install
81         $(INSTALL_DIR) $(1)/sbin
82         $(INSTALL_BIN) $(PKG_BUILD_DIR)/uci $(1)/sbin/
83         $(CP) ./files/uci/* $(1)/
84 endef
85
86 define Package/uci-sh/install
87         $(INSTALL_DIR) $(1)
88         $(CP) ./files/uci-sh/* $(1)/
89 endef
90
91 define Build/InstallDev
92         $(INSTALL_DIR) $(1)/usr/include
93         $(CP) $(PKG_BUILD_DIR)/uci{,_config}.h $(1)/usr/include
94         $(INSTALL_DIR) $(1)/usr/lib
95         $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/usr/lib
96 endef
97
98 $(eval $(call BuildPackage,uci))
99 $(eval $(call BuildPackage,libuci))
100 $(eval $(call BuildPackage,libuci-lua))
101 $(eval $(call BuildPackage,uci-sh))