mark click as broken for now - fails to build and should be replaced with a newer...
[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.1
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:=22f4f912f20802c11006fe9b84d5c461
21 PKG_CAT:=zcat
22
23 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
24 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/lua/Default
29 SECTION:=lang
30 CATEGORY:=Languages
31 TITLE:=LUA programming language
32 DESCRIPTION:=\
33 Lua is a powerful light-weight programming language designed for extending \\\
34 applications. Lua is also frequently used as a general-purpose, stand-alone \\\
35 language. Lua is free software.
36 URL:=http://www.lua.org/
37 endef
38
39 define Package/liblua
40 $(call Package/lua/Default)
41 SECTION:=libs
42 CATEGORY:=Libraries
43 TITLE+= (libraries)
44 DESCRIPTION+=\\\
45 \\\
46 This package contains the LUA shared libraries, needed by other programs.
47 endef
48
49 define Package/lua
50 $(call Package/lua/Default)
51 DEPENDS:=+liblua +libreadline +libncurses
52 TITLE+= (interpreter)
53 DESCRIPTION+=\\\
54 \\\
55 This package contains the LUA language interpreter.
56 endef
57
58 define Package/luac
59 $(call Package/lua/Default)
60 DEPENDS:=+liblua
61 TITLE+= (compiler)
62 DESCRIPTION+=\\\
63 \\\
64 This package contains the LUA language compiler.
65 endef
66
67 define Package/lua-examples
68 $(call Package/lua/Default)
69 DEPENDS:=lua
70 TITLE+= (examples)
71 DESCRIPTION+=\\\
72 \\\
73 This package contains LUA language examples.
74 endef
75
76 define Build/Configure
77 endef
78
79 define Build/Compile
80 $(MAKE) -C $(PKG_BUILD_DIR) \
81 CC="$(TARGET_CROSS)gcc" \
82 LD="$(TARGET_CROSS)ld" \
83 AR="$(TARGET_CROSS)ar rcu" \
84 RANLIB="$(TARGET_CROSS)ranlib" \
85 INSTALL_ROOT=/usr \
86 MYCFLAGS="-I$(STAGING_DIR)/usr/include $(TARGET_CFLAGS)" \
87 MYLDFLAGS="-L$(STAGING_DIR)/usr/lib" \
88 PKG_VERSION=$(PKG_VERSION) \
89 all linux
90 rm -rf $(PKG_INSTALL_DIR)
91 mkdir -p $(PKG_INSTALL_DIR)
92 $(MAKE) -C $(PKG_BUILD_DIR) \
93 INSTALL_TOP="$(PKG_INSTALL_DIR)/usr" \
94 install
95 endef
96
97 define Build/InstallDev
98 mkdir -p $(STAGING_DIR)/usr/include
99 $(CP) $(PKG_INSTALL_DIR)/usr/include/lua{,lib,conf}.h $(STAGING_DIR)/usr/include/
100 $(CP) $(PKG_INSTALL_DIR)/usr/include/lauxlib.h $(STAGING_DIR)/usr/include/
101 mkdir -p $(STAGING_DIR)/usr/lib
102 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.{a,so.*} $(STAGING_DIR)/usr/lib/
103 ln -sf liblua.so.$(PKG_VERSION) $(STAGING_DIR)/usr/lib/liblua.so
104 ln -sf liblua.so.$(PKG_VERSION) $(STAGING_DIR)/usr/lib/liblualib.so
105 endef
106
107 define Build/UninstallDev
108 rm -rf \
109 $(STAGING_DIR)/usr/include/lua{,lib,conf}.h \
110 $(STAGING_DIR)/usr/include/lauxlib.h \
111 $(STAGING_DIR)/usr/lib/liblua.{a,so*}
112 endef
113
114 define Package/liblua/install
115 $(INSTALL_DIR) $(1)/usr/lib
116 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.so.* $(1)/usr/lib/
117 endef
118
119 define Package/lua/install
120 $(INSTALL_DIR) $(1)/usr/bin
121 $(CP) $(PKG_INSTALL_DIR)/usr/bin/lua $(1)/usr/bin/
122 endef
123
124 define Package/luac/install
125 $(INSTALL_DIR) $(1)/usr/bin
126 $(CP) $(PKG_INSTALL_DIR)/usr/bin/luac $(1)/usr/bin/
127 endef
128
129 define Package/lua-examples/install
130 $(INSTALL_DIR) $(1)/usr/share/lua/examples
131 $(INSTALL_DATA) $(PKG_BUILD_DIR)/test/*.lua \
132 $(1)/usr/share/lua/examples/
133 endef
134
135 $(eval $(call BuildPackage,liblua))
136 $(eval $(call BuildPackage,lua))
137 $(eval $(call BuildPackage,luac))
138 $(eval $(call BuildPackage,lua-examples))