ubus: update to current git, package up libubus-lua
[oweals/openwrt.git] / package / ubus / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=ubus
4 PKG_VERSION:=2012-05-05
5 PKG_RELEASE=$(PKG_SOURCE_VERSION)
6
7 PKG_SOURCE_PROTO:=git
8 PKG_SOURCE_URL:=git://nbd.name/luci2/ubus.git
9 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
10 PKG_SOURCE_VERSION:=25b9b4b827f74482743689386b195dca3b81a0df
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
12 PKG_MIRROR_MD5SUM:=d68885340ab1cee2e04e9055186beb11
13 CMAKE_INSTALL:=1
14
15 include $(INCLUDE_DIR)/package.mk
16 include $(INCLUDE_DIR)/cmake.mk
17
18 define Package/ubus
19   SECTION:=luci2
20   CATEGORY:=LuCI2
21   SUBMENU:=System
22   DEPENDS:=+libubus +libblobmsg-json +ubusd
23   TITLE:=OpenWrt RPC client utility
24 endef
25
26 define Package/ubusd
27   SECTION:=luci2
28   CATEGORY:=LuCI2
29   SUBMENU:=System
30   TITLE:=OpenWrt RPC daemon
31 endef
32
33 define Package/libubus
34   SECTION:=luci2
35   CATEGORY:=LuCI2
36   SUBMENU:=Libraries
37   DEPENDS:=+libubox
38   TITLE:=OpenWrt RPC client library
39 endef
40
41 define Package/libubus-lua
42   SECTION:=luci2
43   CATEGORY:=LuCI2
44   SUBMENU:=Libraries
45   DEPENDS:=+libubus +liblua
46   TITLE:=Lua binding for the OpenWrt RPC client
47 endef
48
49 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
50
51 define Package/ubus/install
52         $(INSTALL_DIR) $(1)/bin
53         $(CP) $(PKG_INSTALL_DIR)/usr/bin/ubus $(1)/bin/
54 endef
55
56 define Package/ubusd/install
57         $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d
58         $(INSTALL_BIN) ./files/ubus.init $(1)/etc/init.d/ubus
59         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ubusd $(1)/sbin/
60 endef
61
62 define Package/libubus/install
63         $(INSTALL_DIR) $(1)/lib
64         $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/lib/
65 endef
66
67 define Package/libubus-lua/install
68         $(INSTALL_DIR) $(1)/usr/lib/lua
69         $(CP) $(PKG_BUILD_DIR)/lua/ubus.so $(1)/usr/lib/lua/
70 endef
71
72 $(eval $(call BuildPackage,ubus))
73 $(eval $(call BuildPackage,ubusd))
74 $(eval $(call BuildPackage,libubus))
75 $(eval $(call BuildPackage,libubus-lua))
76