1c2d2305f3c6a88cebd8404f881478457916146d
[openwrt/svn-archive/archive.git] / lang / lua / 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 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=lua
12 PKG_VERSION:=5.1.2
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.lua.org/ftp/ \
17 http://ftp.gwdg.de/pub/languages/lua/ \
18 http://mirrors.dotsrc.org/lua/ \
19 http://www.tecgraf.puc-rio.br/lua/ftp/
20 PKG_MD5SUM:=687ce4c2a1ddff18f1008490fdc4e5e0
21
22 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
23 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/lua/Default
28 SUBMENU:=LUA
29 SECTION:=lang
30 CATEGORY:=Languages
31 TITLE:=LUA programming language
32 URL:=http://www.lua.org/
33 endef
34
35 define Package/liblua
36 $(call Package/lua/Default)
37 SUBMENU:=
38 SECTION:=libs
39 CATEGORY:=Libraries
40 TITLE+= (libraries)
41 endef
42
43 define Package/liblua/description
44 =
45 Lua is a powerful light-weight programming language designed for extending
46 applications. Lua is also frequently used as a general-purpose, stand-alone
47 language. Lua is free software. This package contains the LUA shared libraries, needed by other programs.
48 endef
49
50 define Package/lua
51 $(call Package/lua/Default)
52 DEPENDS:=+liblua +libreadline +libncurses
53 TITLE+= (interpreter)
54 endef
55
56 define Package/lua/description
57 =
58 Lua is a powerful light-weight programming language designed for extending
59 applications. Lua is also frequently used as a general-purpose, stand-alone
60 language. Lua is free software. This package contains the LUA language interpreter.
61 endef
62
63 define Package/luac
64 $(call Package/lua/Default)
65 DEPENDS:=+liblua
66 TITLE+= (compiler)
67 endef
68
69 define Package/luac/description
70 =
71 Lua is a powerful light-weight programming language designed for extending
72 applications. Lua is also frequently used as a general-purpose, stand-alone
73 language. Lua is free software. This package contains the LUA language compiler.
74 endef
75
76 define Package/lua-examples
77 $(call Package/lua/Default)
78 DEPENDS:=lua
79 TITLE+= (examples)
80 endef
81
82 define Package/lua-examples/description
83 =
84 Lua is a powerful light-weight programming language designed for extending
85 applications. Lua is also frequently used as a general-purpose, stand-alone
86 language. Lua is free software. This package contains LUA language examples.
87 endef
88
89 define Build/Configure
90 endef
91
92 define Build/Compile
93 $(MAKE) -C $(PKG_BUILD_DIR) \
94 CC="$(TARGET_CROSS)gcc" \
95 LD="$(TARGET_CROSS)ld" \
96 AR="$(TARGET_CROSS)ar rcu" \
97 RANLIB="$(TARGET_CROSS)ranlib" \
98 INSTALL_ROOT=/usr \
99 MYCFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
100 MYLDFLAGS="$(TARGET_LDFLAGS)" \
101 PKG_VERSION=$(PKG_VERSION) \
102 all linux
103 rm -rf $(PKG_INSTALL_DIR)
104 mkdir -p $(PKG_INSTALL_DIR)
105 $(MAKE) -C $(PKG_BUILD_DIR) \
106 INSTALL_TOP="$(PKG_INSTALL_DIR)/usr" \
107 install
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 mkdir -p $(1)/usr/lib
115 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.{a,so.*} $(1)/usr/lib/
116 ln -sf liblua.so.$(PKG_VERSION) $(1)/usr/lib/liblua.so
117 ln -sf liblua.so.$(PKG_VERSION) $(1)/usr/lib/liblualib.so
118 endef
119
120 define Package/liblua/install
121 $(INSTALL_DIR) $(1)/usr/lib
122 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.so.* $(1)/usr/lib/
123 endef
124
125 define Package/lua/install
126 $(INSTALL_DIR) $(1)/usr/bin
127 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua $(1)/usr/bin/
128 endef
129
130 define Package/luac/install
131 $(INSTALL_DIR) $(1)/usr/bin
132 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac $(1)/usr/bin/
133 endef
134
135 define Package/lua-examples/install
136 $(INSTALL_DIR) $(1)/usr/share/lua/examples
137 $(INSTALL_DATA) $(PKG_BUILD_DIR)/test/*.lua \
138 $(1)/usr/share/lua/examples/
139 endef
140
141 $(eval $(call BuildPackage,liblua))
142 $(eval $(call BuildPackage,lua))
143 $(eval $(call BuildPackage,luac))
144 $(eval $(call BuildPackage,lua-examples))