libubox: add packaging info for uloop lua binding
[openwrt/svn-archive/archive.git] / package / libs / libubox / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=libubox
4 PKG_VERSION:=2013-08-01
5 PKG_RELEASE=$(PKG_SOURCE_VERSION)
6
7 PKG_SOURCE_PROTO:=git
8 PKG_SOURCE_URL:=git://nbd.name/luci2/libubox.git
9 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
10 PKG_SOURCE_VERSION:=04f194aa8a04926fe7f2e42bbf9ba6c62d49339e
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
12 PKG_MIRROR_MD5SUM:=
13 CMAKE_INSTALL:=1
14
15 PKG_LICENSE:=ISC BSD-3c
16 PKG_LICENSE_FILES:=
17
18 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
19
20 PKG_BUILD_DEPENDS:=lua
21
22 include $(INCLUDE_DIR)/package.mk
23 include $(INCLUDE_DIR)/cmake.mk
24
25 define Package/libubox
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=Basic utility library
29 DEPENDS:=
30 endef
31
32 define Package/libblobmsg-json
33 SECTION:=libs
34 CATEGORY:=Libraries
35 TITLE:=blobmsg <-> json conversion library
36 DEPENDS:=+libjson-c +libubox
37 endef
38
39 define Package/jshn
40 SECTION:=utils
41 CATEGORY:=Utilities
42 DEPENDS:=+libjson-c
43 TITLE:=JSON SHell Notation
44 endef
45
46 define Package/jshn/description
47 Library for parsing and generating JSON from shell scripts
48 endef
49
50 define Package/libjson-script
51 SECTION:=utils
52 CATEGORY:=Utilities
53 DEPENDS:=+libubox
54 TITLE:=Minimalistic JSON based scripting engine
55 endef
56
57 define Package/libubox-lua
58 SECTION:=libs
59 CATEGORY:=Libraries
60 DEPENDS:=+libubox +liblua
61 TITLE:=Lua binding for the OpenWrt Basic utility library
62 endef
63
64 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
65 CMAKE_OPTIONS = \
66 -DLUAPATH=/usr/lib/lua
67
68 define Package/libubox/install
69 $(INSTALL_DIR) $(1)/lib/
70 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libubox.so $(1)/lib/
71 endef
72
73 define Package/libblobmsg-json/install
74 $(INSTALL_DIR) $(1)/lib/
75 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblobmsg_json.so $(1)/lib/
76 endef
77
78 define Package/jshn/install
79 $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/share/libubox
80 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/jshn $(1)/usr/bin
81 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libubox/jshn.sh $(1)/usr/share/libubox
82 endef
83
84 define Package/libjson-script/install
85 $(INSTALL_DIR) $(1)/lib/
86 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libjson_script.so $(1)/lib/
87 endef
88
89 define Package/libubox-lua/install
90 $(INSTALL_DIR) $(1)/usr/lib/lua
91 $(CP) $(PKG_BUILD_DIR)/lua/uloop.so $(1)/usr/lib/lua/
92 endef
93
94 $(eval $(call BuildPackage,libubox))
95 $(eval $(call BuildPackage,libblobmsg-json))
96 $(eval $(call BuildPackage,jshn))
97 $(eval $(call BuildPackage,libjson-script))
98 $(eval $(call BuildPackage,libubox-lua))