fix potential rootfs owner/group mismatch (tgz root only, patch from #4562)
[openwrt.git] / package / lua / Makefile
1 #
2 # Copyright (C) 2006-2008 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.4
13 PKG_RELEASE:=3
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:=d0870f2de55d59c1c8419f36e8fac150
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/lua/Default
25 SUBMENU:=LUA
26 SECTION:=lang
27 CATEGORY:=Languages
28 TITLE:=LUA programming language
29 URL:=http://www.lua.org/
30 endef
31
32 define Package/lua/Default/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 endef
37
38 define Package/liblua
39 $(call Package/lua/Default)
40 SUBMENU:=
41 SECTION:=libs
42 CATEGORY:=Libraries
43 TITLE+= (libraries)
44 endef
45
46 define Package/liblua/description
47 $(call Package/lua/Default/description)
48 This package contains the LUA shared libraries, needed by other programs.
49 endef
50
51 define Package/lua
52 $(call Package/lua/Default)
53 DEPENDS:=+liblua
54 TITLE+= (interpreter)
55 endef
56
57 define Package/lua/description
58 $(call Package/lua/Default/description)
59 This package contains the LUA language interpreter.
60 endef
61
62 define Package/luac
63 $(call Package/lua/Default)
64 DEPENDS:=+liblua
65 TITLE+= (compiler)
66 endef
67
68 define Package/luac/description
69 $(call Package/lua/Default/description)
70 This package contains the LUA language compiler.
71 endef
72
73 define Package/lua-examples
74 $(call Package/lua/Default)
75 DEPENDS:=lua
76 TITLE+= (examples)
77 endef
78
79 define Package/lua-examples/description
80 $(call Package/lua/Default/description)
81 This package contains LUA language examples.
82 endef
83
84 define Build/Configure
85 endef
86
87 TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC)
88
89 ifneq ($(CONFIG_USE_EGLIBC),)
90 ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),)
91 TARGET_CFLAGS += -DNO_GETLOGIN
92 endif
93 endif
94
95 define Build/Compile
96 $(MAKE) -C $(PKG_BUILD_DIR) \
97 CC="$(TARGET_CROSS)gcc" \
98 AR="$(TARGET_CROSS)ar rcu" \
99 RANLIB="$(TARGET_CROSS)ranlib" \
100 INSTALL_ROOT=/usr \
101 CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
102 MYLDFLAGS="$(TARGET_LDFLAGS)" \
103 PKG_VERSION=$(PKG_VERSION) \
104 linux
105 rm -rf $(PKG_INSTALL_DIR)
106 mkdir -p $(PKG_INSTALL_DIR)
107 $(MAKE) -C $(PKG_BUILD_DIR) \
108 INSTALL_TOP="$(PKG_INSTALL_DIR)/usr" \
109 install
110 endef
111
112 define Build/InstallDev
113 mkdir -p $(1)/usr/include
114 $(CP) $(PKG_INSTALL_DIR)/usr/include/lua{,lib,conf}.h $(1)/usr/include/
115 $(CP) $(PKG_INSTALL_DIR)/usr/include/lauxlib.h $(1)/usr/include/
116 $(CP) $(PKG_INSTALL_DIR)/usr/include/lnum_config.h $(1)/usr/include/
117 mkdir -p $(1)/usr/lib
118 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.{a,so*} $(1)/usr/lib/
119 ln -sf liblua.so.$(PKG_VERSION) $(1)/usr/lib/liblualib.so
120 endef
121
122 define Package/liblua/install
123 $(INSTALL_DIR) $(1)/usr/lib
124 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.so.* $(1)/usr/lib/
125 endef
126
127 define Package/lua/install
128 $(INSTALL_DIR) $(1)/usr/bin
129 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua $(1)/usr/bin/
130 endef
131
132 define Package/luac/install
133 $(INSTALL_DIR) $(1)/usr/bin
134 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac $(1)/usr/bin/
135 endef
136
137 define Package/lua-examples/install
138 $(INSTALL_DIR) $(1)/usr/share/lua/examples
139 $(INSTALL_DATA) $(PKG_BUILD_DIR)/test/*.lua \
140 $(1)/usr/share/lua/examples/
141 endef
142
143 $(eval $(call BuildPackage,liblua))
144 $(eval $(call BuildPackage,lua))
145 $(eval $(call BuildPackage,luac))
146 $(eval $(call BuildPackage,lua-examples))
This page took 0.044646 seconds and 5 git commands to generate.