(no commit message)
[project/luci.git] / contrib / package / lua-luci / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=lua-luci
10 PKG_VERSION:=5.1.3
11 PKG_RELEASE:=1
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
14 PKG_SOURCE_URL:=http://dev.leipzig.freifunk.net/svn/ff-luci/trunk/contrib/package-source/ \
15 http://firmware.freifunk-halle.net/ffluci/package-source/
16 PKG_MD5SUM:=98b12c767a5eed92169b01537e988c7f
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
19 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
20
21 X_HOST_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/lua-luci/Default
26 SUBMENU:=LUA
27 SECTION:=lang
28 CATEGORY:=Languages
29 TITLE:=LUA programming language
30 URL:=http://www.lua.org/
31 endef
32
33 define Package/lua-luci/Default/description
34 Lua is a powerful light-weight programming language designed for extending
35 applications. Lua is also frequently used as a general-purpose, stand-alone
36 language. Lua is free software.
37 endef
38
39 define Package/liblua-luci
40 $(call Package/lua-luci/Default)
41 SUBMENU:=
42 SECTION:=libs
43 CATEGORY:=Libraries
44 TITLE+= (libraries)
45 endef
46
47 define Package/liblua-luci/description
48 $(call Package/lua-luci/Default/description)
49 This package contains the LUA shared libraries, needed by other programs.
50 endef
51
52 define Package/lua-luci
53 $(call Package/lua-luci/Default)
54 DEPENDS:=+liblua-luci +libreadline +libncurses
55 TITLE+= (interpreter)
56 endef
57
58 define Package/lua-luci/description
59 $(call Package/lua-luci/Default/description)
60 This package contains the LUA language interpreter.
61 endef
62
63 define Package/luac-luci
64 $(call Package/lua-luci/Default)
65 DEPENDS:=+liblua-luci
66 TITLE+= (compiler)
67 endef
68
69 define Package/luac/description
70 $(call Package/lua-luci/Default/description)
71 This package contains the LUA language compiler.
72 endef
73
74 define Package/lua-luci-examples
75 $(call Package/lua-luci/Default)
76 DEPENDS:=lua-luci
77 TITLE+= (examples)
78 endef
79
80 define Package/lua-luci-examples/description
81 $(call Package/lua-luci/Default/description)
82 This package contains LUA language examples.
83 endef
84
85 define Build/Configure
86 endef
87
88 define Build/Compile
89 cp $(PKG_BUILD_DIR)/src $(PKG_BUILD_DIR)/src-host -R
90 $(MAKE) -C $(PKG_BUILD_DIR) \
91 CC="$(TARGET_CROSS)gcc" \
92 LD="$(TARGET_CROSS)ld" \
93 AR="$(TARGET_CROSS)ar rcu" \
94 RANLIB="$(TARGET_CROSS)ranlib" \
95 INSTALL_ROOT=/usr \
96 MYCFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
97 MYLDFLAGS="$(TARGET_LDFLAGS)" \
98 PKG_VERSION=$(PKG_VERSION) \
99 all linux
100 rm -rf $(PKG_INSTALL_DIR)
101 mkdir -p $(PKG_INSTALL_DIR)
102 $(MAKE) -C $(PKG_BUILD_DIR) \
103 INSTALL_TOP="$(PKG_INSTALL_DIR)/usr" \
104 install
105 $(MAKE) -C $(PKG_BUILD_DIR)/src-host luac-host
106 mkdir -p $(X_HOST_DIR)
107 cp $(PKG_BUILD_DIR)/src-host/luac-host $(X_HOST_DIR)/luac
108 endef
109
110 define Build/InstallDev
111 mkdir -p $(1)/usr/include
112 $(CP) $(PKG_INSTALL_DIR)/usr/include/lua{,lib,conf}.h $(1)/usr/include/
113 $(CP) $(PKG_INSTALL_DIR)/usr/include/lauxlib.h $(1)/usr/include/
114 $(CP) $(PKG_INSTALL_DIR)/usr/include/lnum_config.h $(1)/usr/include/
115 mkdir -p $(1)/usr/lib
116 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.{a,so.*} $(1)/usr/lib/
117 ln -sf liblua.so.$(PKG_VERSION) $(1)/usr/lib/liblua.so
118 ln -sf liblua.so.$(PKG_VERSION) $(1)/usr/lib/liblualib.so
119 endef
120
121 define Package/liblua-luci/install
122 $(INSTALL_DIR) $(1)/usr/lib
123 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.so.* $(1)/usr/lib/
124 echo "Replaces: liblua" >> $(1)/CONTROL/control
125 echo "Conflicts: liblua" >> $(1)/CONTROL/control
126 endef
127
128 define Package/lua-luci/install
129 $(INSTALL_DIR) $(1)/usr/bin
130 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua $(1)/usr/bin/
131 echo "Replaces: lua" >> $(1)/CONTROL/control
132 echo "Conflicts: lua" >> $(1)/CONTROL/control
133 endef
134
135 define Package/luac-luci/install
136 $(INSTALL_DIR) $(1)/usr/bin
137 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac $(1)/usr/bin/
138 echo "Replaces: luac" >> $(1)/CONTROL/control
139 echo "Conflicts: luac" >> $(1)/CONTROL/control
140 endef
141
142 define Package/lua-luci-examples/install
143 $(INSTALL_DIR) $(1)/usr/share/lua/examples
144 $(INSTALL_DATA) $(PKG_BUILD_DIR)/test/*.lua \
145 $(1)/usr/share/lua/examples/
146 endef
147
148 $(eval $(call BuildPackage,liblua-luci))
149 $(eval $(call BuildPackage,lua-luci))
150 $(eval $(call BuildPackage,luac-luci))
151 $(eval $(call BuildPackage,lua-luci-examples))