* (Hopefully) fixed package source URLs
[project/luci.git] / contrib / package / lua-luci / 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 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=lua-luci
10 PKG_VERSION:=5.1.3
11 PKG_RELEASE:=1
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
14 PKG_SOURCE_URL:=http://dev.leipzig.freifunk.net/svn/ff-luci/trunk/contrib/package-source/
15 PKG_MD5SUM:=98b12c767a5eed92169b01537e988c7f
16
17 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
18 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
19
20 X_HOST_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/lua-luci/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-luci/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-luci
39 $(call Package/lua-luci/Default)
40   SUBMENU:=
41   SECTION:=libs
42   CATEGORY:=Libraries
43   TITLE+= (libraries)
44 endef
45
46 define Package/liblua-luci/description
47 $(call Package/lua-luci/Default/description)
48  This package contains the LUA shared libraries, needed by other programs.
49 endef
50
51 define Package/lua-luci
52 $(call Package/lua-luci/Default)
53   DEPENDS:=+liblua-luci +libreadline +libncurses
54   TITLE+= (interpreter)
55 endef
56
57 define Package/lua-luci/description
58 $(call Package/lua-luci/Default/description)
59  This package contains the LUA language interpreter.
60 endef
61
62 define Package/luac-luci
63 $(call Package/lua-luci/Default)
64   DEPENDS:=+liblua-luci
65   TITLE+= (compiler)
66 endef
67
68 define Package/luac/description
69 $(call Package/lua-luci/Default/description)
70  This package contains the LUA language compiler.
71 endef
72
73 define Package/lua-luci-examples
74 $(call Package/lua-luci/Default)
75   DEPENDS:=lua-luci
76   TITLE+= (examples)
77 endef
78
79 define Package/lua-luci-examples/description
80 $(call Package/lua-luci/Default/description)
81  This package contains LUA language examples.
82 endef
83
84 define Build/Configure
85 endef
86
87 define Build/Compile
88         cp $(PKG_BUILD_DIR)/src $(PKG_BUILD_DIR)/src-host -R
89         $(MAKE) -C $(PKG_BUILD_DIR) \
90                 CC="$(TARGET_CROSS)gcc" \
91                 LD="$(TARGET_CROSS)ld" \
92                 AR="$(TARGET_CROSS)ar rcu" \
93                 RANLIB="$(TARGET_CROSS)ranlib" \
94                 INSTALL_ROOT=/usr \
95                 MYCFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
96                 MYLDFLAGS="$(TARGET_LDFLAGS)" \
97                 PKG_VERSION=$(PKG_VERSION) \
98                 all linux 
99         rm -rf $(PKG_INSTALL_DIR)
100         mkdir -p $(PKG_INSTALL_DIR)
101         $(MAKE) -C $(PKG_BUILD_DIR) \
102                 INSTALL_TOP="$(PKG_INSTALL_DIR)/usr" \
103                 install
104         $(MAKE) -C $(PKG_BUILD_DIR)/src-host luac-host
105         mkdir -p $(X_HOST_DIR)
106         cp $(PKG_BUILD_DIR)/src-host/luac-host $(X_HOST_DIR)/luac
107 endef
108
109 define Build/InstallDev
110         mkdir -p $(1)/usr/include
111         $(CP) $(PKG_INSTALL_DIR)/usr/include/lua{,lib,conf}.h $(1)/usr/include/
112         $(CP) $(PKG_INSTALL_DIR)/usr/include/lauxlib.h $(1)/usr/include/
113         $(CP) $(PKG_INSTALL_DIR)/usr/include/lnum_config.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-luci/install
121         $(INSTALL_DIR) $(1)/usr/lib
122         $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.so.* $(1)/usr/lib/
123         echo "Replaces: liblua" >> $(1)/CONTROL/control
124         echo "Conflicts: liblua" >> $(1)/CONTROL/control
125 endef
126
127 define Package/lua-luci/install
128         $(INSTALL_DIR) $(1)/usr/bin
129         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua $(1)/usr/bin/
130         echo "Replaces: lua" >> $(1)/CONTROL/control
131         echo "Conflicts: lua" >> $(1)/CONTROL/control
132 endef
133
134 define Package/luac-luci/install
135         $(INSTALL_DIR) $(1)/usr/bin
136         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac $(1)/usr/bin/
137         echo "Replaces: luac" >> $(1)/CONTROL/control
138         echo "Conflicts: luac" >> $(1)/CONTROL/control
139 endef
140
141 define Package/lua-luci-examples/install
142         $(INSTALL_DIR) $(1)/usr/share/lua/examples
143         $(INSTALL_DATA) $(PKG_BUILD_DIR)/test/*.lua \
144                 $(1)/usr/share/lua/examples/
145 endef
146
147 $(eval $(call BuildPackage,liblua-luci))
148 $(eval $(call BuildPackage,lua-luci))
149 $(eval $(call BuildPackage,luac-luci))
150 $(eval $(call BuildPackage,lua-luci-examples))