[packages] massive change: replace occurences of -I$(STAGING_DIR)/{include,usr/includ...
[openwrt/svn-archive/archive.git] / lang / luafilesystem / Makefile
1 #
2 # Copyright (C) 2008-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:=luafilesystem
11 PKG_VERSION:=1.4.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://luaforge.net/frs/download.php/3345
16 PKG_MD5SUM:=fe2fa6decc48f0267b4f09975750280e
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/liblua-filesystem
21 SUBMENU:=Lua
22 SECTION:=lang
23 CATEGORY:=Languages
24 TITLE:=LuaFileSystem
25 URL:=http://www.luaforge.net/projects/luafilesystem
26 DEPENDS:=+liblua
27 endef
28
29 define Package/luafilesystem/description
30 This package contains the LuaFileSystem library, a set of portable
31 functions for directory creation, listing and deletion and for file
32 locking.
33 endef
34
35 define Build/Configure
36 endef
37
38 TARGET_CFLAGS += $(FPIC) $(TARGET_CPPFLAGS)
39
40 TARGET_LDFLAGS += -llua
41
42 define Build/Compile
43 $(MAKE) -C $(PKG_BUILD_DIR) \
44 $(TARGET_CONFIGURE_OPTS) \
45 CFLAGS="$(TARGET_CFLAGS)" \
46 LDFLAGS="$(TARGET_LDFLAGS)"
47 $(TARGET_CROSS)ar r $(PKG_BUILD_DIR)/src/liblua-filesystem.a $(PKG_BUILD_DIR)/src/lfs.o
48 endef
49
50 define Build/InstallDev
51 mkdir -p $(STAGING_DIR)/usr/include
52 mkdir -p $(STAGING_DIR)/usr/lib/lua/5.1/
53 $(CP) $(PKG_BUILD_DIR)/src/lfs.h $(STAGING_DIR)/usr/include
54 $(CP) $(PKG_BUILD_DIR)/src/lfs.so \
55 $(STAGING_DIR)/usr/lib/liblua-filesystem.so.0.0.0
56 cd $(STAGING_DIR)/usr/lib/ && \
57 ln -fs liblua-filesystem.so.0.0.0 liblua-filesystem.so
58 cd $(STAGING_DIR)/usr/lib/ && \
59 ln -fs liblua-filesystem.so.0.0.0 liblua-filesystem.so.0
60 cd $(STAGING_DIR)/usr/lib/lua/5.1/ && \
61 ln -fs ../../liblua-filesystem.so.0.0.0 lfs.so
62 $(CP) $(PKG_BUILD_DIR)/src/liblua-filesystem.a $(STAGING_DIR)/usr/lib
63 endef
64
65 define Package/liblua-filesystem/install
66 $(INSTALL_DIR) $(1)/usr/lib/lua/5.1
67 $(CP) $(PKG_BUILD_DIR)/src/lfs.so \
68 $(1)/usr/lib/liblua-filesystem.so.0.0.0
69 cd $(1)/usr/lib/ && ln -fs liblua-filesystem.so.0.0.0 liblua-filesystem.so
70 cd $(1)/usr/lib/lua/5.1/ && \
71 ln -fs ../../liblua-filesystem.so.0.0.0 lfs.so
72 endef
73
74 $(eval $(call BuildPackage,liblua-filesystem))