1cf6dd842d79494dbf57c017c178fc98cfcc04b2
[openwrt/svn-archive/archive.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.4
12 UCI_RELEASE=4
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:=1ce8e92e3aa023763e8f4da91a70563d
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 UCI_MAKEOPTS = \
51 $(TARGET_CONFIGURE_OPTS) \
52 COPTS="$(TARGET_CFLAGS)" \
53 DEBUG="$(DEBUG)" \
54 VERSION="$(UCI_VERSION)" \
55 CPPFLAGS="-I$(PKG_BUILD_DIR) -I$(STAGING_DIR)/usr/include" \
56 OS="Linux"
57
58 define Build/Compile
59 $(MAKE) -C $(PKG_BUILD_DIR) $(UCI_MAKEOPTS)
60 $(MAKE) -C $(PKG_BUILD_DIR)/lua $(UCI_MAKEOPTS)
61 endef
62
63 define Package/libuci/install
64 $(INSTALL_DIR) $(1)/lib
65 $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/lib/
66 endef
67
68 define Package/libuci-lua/install
69 $(INSTALL_DIR) $(1)/usr/lib/lua
70 $(CP) $(PKG_BUILD_DIR)/lua/uci.so $(1)/usr/lib/lua/
71 endef
72
73 define Package/uci/install
74 $(INSTALL_DIR) $(1)/etc/uci-defaults
75 $(INSTALL_DIR) $(1)/sbin
76 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uci $(1)/sbin/
77 $(CP) ./files/uci/* $(1)/
78 endef
79
80 define Build/InstallDev
81 $(INSTALL_DIR) $(1)/usr/include
82 $(CP) $(PKG_BUILD_DIR)/uci{,_config}.h $(1)/usr/include
83 $(INSTALL_DIR) $(1)/usr/lib
84 $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/usr/lib
85 endef
86
87 $(eval $(call BuildPackage,uci))
88 $(eval $(call BuildPackage,libuci))
89 $(eval $(call BuildPackage,libuci-lua))