uci: update to latest version, uses cmake now
[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
8 include $(TOPDIR)/rules.mk
9
10 UCI_VERSION=2011-03-26
11 UCI_RELEASE=1
12
13 PKG_NAME:=uci
14 PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE))
15 PKG_RELEASE:=1
16 PKG_REV:=0e8c97eef4aa154543c539b13b5e16859cec8a25
17
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19 PKG_SOURCE_URL:=git://nbd.name/uci.git
20 PKG_SOURCE_SUBDIR:=uci-$(PKG_VERSION)
21 PKG_SOURCE_VERSION:=$(PKG_REV)
22 PKG_SOURCE_PROTO:=git
23 PKG_MIRROR_MD5SUM:=d5329ee38167608bfe2d6f758d9250d0
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/cmake.mk
27
28 # set to 1 to enable debugging
29 DEBUG=
30
31 define Package/libuci
32 SECTION:=libs
33 CATEGORY:=Libraries
34 TITLE:=C library for the Unified Configuration Interface (UCI)
35 endef
36
37 define Package/uci
38 SECTION:=base
39 CATEGORY:=Base system
40 DEPENDS:=+libuci
41 TITLE:=Utility for the Unified Configuration Interface (UCI)
42 endef
43
44 define Package/ucitrigger
45 SECTION:=base
46 CATEGORY:=Base system
47 DEPENDS:=+libuci-lua +lua
48 TITLE:=Automatic triggers for applying system config changes
49 endef
50
51 define Package/libuci-lua
52 SECTION=libs
53 CATEGORY=Libraries
54 DEPENDS:=+libuci +liblua
55 TITLE:=Lua plugin for UCI
56 endef
57
58 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
59 TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib
60
61 CMAKE_OPTIONS = \
62 -DLUAPATH=/usr/lib/lua \
63 $(if $(DEBUG),-DUCI_DEBUG=ON)
64
65 define Package/libuci/install
66 $(INSTALL_DIR) $(1)/lib
67 $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/lib/
68 endef
69
70 define Package/libuci-lua/install
71 $(INSTALL_DIR) $(1)/usr/lib/lua
72 $(CP) $(PKG_BUILD_DIR)/lua/uci.so $(1)/usr/lib/lua/
73 endef
74
75 define Package/ucitrigger/install
76 $(INSTALL_DIR) $(1)/usr/lib/lua/uci $(1)/lib/config/trigger $(1)/usr/sbin
77 $(INSTALL_DATA) ./trigger/lib/trigger.lua $(1)/usr/lib/lua/uci/
78 $(INSTALL_DATA) ./trigger/modules/*.lua $(1)/lib/config/trigger/
79 $(INSTALL_DATA) $(PKG_BUILD_DIR)/trigger/uci_trigger.so $(1)/usr/lib/
80 $(INSTALL_BIN) ./trigger/apply_config $(1)/usr/sbin/
81 endef
82
83 define Package/uci/install
84 $(INSTALL_DIR) $(1)/etc/uci-defaults
85 $(INSTALL_DIR) $(1)/sbin
86 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uci $(1)/sbin/
87 $(CP) ./files/* $(1)/
88 endef
89
90 define Build/InstallDev
91 $(INSTALL_DIR) $(1)/usr/include
92 $(CP) $(PKG_BUILD_DIR)/uci{,_config,map}.h $(1)/usr/include
93 $(INSTALL_DIR) $(1)/usr/lib
94 $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/usr/lib
95 $(CP) $(PKG_BUILD_DIR)/libuci.a $(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,ucitrigger))