[package] fix luasocket compilation failures (#6065)
[packages.git] / lang / luasocket / Makefile
1
2 # Copyright (C) 2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=luasocket
11 PKG_VERSION:=2.0.2
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://luaforge.net/frs/download.php/2664
16 PKG_MD5SUM:=41445b138deb7bcfe97bff957503da8e
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/luasocket
21   SUBMENU:=Lua
22   SECTION:=lang
23   CATEGORY:=Languages
24   TITLE:=LuaSocket
25   URL:=http://luasocket.luaforge.net/
26   DEPENDS:=+lua
27 endef
28
29 define Package/luasocket/description
30   LuaSocket is the most comprehensive networking support
31   library for the Lua language. It provides easy access to
32   TCP, UDP, DNS, SMTP, FTP, HTTP, MIME and much more.
33 endef
34
35 define Build/Configure
36 endef
37
38 define Build/Compile
39         $(MAKE) -C $(PKG_BUILD_DIR)/ all \
40         LIBDIR="$(TARGET_LDFLAGS)" \
41         CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -std=gnu99" \
42         LD="$(TARGET_CROSS)ld -shared" 
43 endef
44
45
46 define Package/luasocket/install
47         $(INSTALL_DIR) $(1)/usr/lib/lua
48         $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/mime.{so.1.0.2,lua} $(1)/usr/lib/lua
49         $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/socket.{so.2.0.2,lua} $(1)/usr/lib/lua
50         $(INSTALL_DIR) $(1)/usr/lib/lua/mime
51         ln -sf ../mime.so.1.0.2 $(1)/usr/lib/lua/mime/core.so
52         $(INSTALL_DIR) $(1)/usr/lib/lua/socket
53         ln -sf ../socket.so.2.0.2 $(1)/usr/lib/lua/socket/core.so
54 endef
55
56 $(eval $(call BuildPackage,luasocket))