|
@@ -0,0 +1,116 @@
|
|
1
|
+#
|
|
2
|
+# Copyright (C) 2010-2014 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:=luasql
|
|
11
|
+PKG_VERSION:=2.1.1
|
|
12
|
+PKG_RELEASE:=1
|
|
13
|
+
|
|
14
|
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
15
|
+PKG_SOURCE_URL:=http://files.luaforge.net/releases/luasql/luasql
|
|
16
|
+PKG_MD5SUM:=63bdd57de4b9d1be336ba112d8cb69eb
|
|
17
|
+
|
|
18
|
+PKG_LICENSE:=MIT
|
|
19
|
+PKG_LICENSE_FILE:=docs/us/license.html
|
|
20
|
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
|
|
21
|
+
|
|
22
|
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
|
23
|
+
|
|
24
|
+include $(INCLUDE_DIR)/package.mk
|
|
25
|
+
|
|
26
|
+define Package/luasql/Default
|
|
27
|
+ SUBMENU:=Lua
|
|
28
|
+ SECTION:=lang
|
|
29
|
+ CATEGORY:=Languages
|
|
30
|
+ TITLE:=Lua SQL binding
|
|
31
|
+ URL:=http://www.keplerproject.org/luasql/
|
|
32
|
+ DEPENDS:= +lua
|
|
33
|
+endef
|
|
34
|
+
|
|
35
|
+define Package/luasql/Default/description
|
|
36
|
+ LuaSQL is a simple interface from Lua to a DBMS.
|
|
37
|
+endef
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+define Package/luasql-mysql
|
|
41
|
+$(call Package/luasql/Default)
|
|
42
|
+ TITLE+= for MySQL
|
|
43
|
+ DEPENDS+= +libmysqlclient
|
|
44
|
+ VARIANT:=mysql
|
|
45
|
+endef
|
|
46
|
+
|
|
47
|
+define Package/luasql-mysql/description
|
|
48
|
+$(call Package/luasql/Default/description)
|
|
49
|
+ .
|
|
50
|
+ This package contains the MySQL binding.
|
|
51
|
+endef
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+define Package/luasql-pgsql
|
|
55
|
+$(call Package/luasql/Default)
|
|
56
|
+ TITLE+= for PostgreSQL
|
|
57
|
+ DEPENDS+= +libpq
|
|
58
|
+ VARIANT:=postgres
|
|
59
|
+endef
|
|
60
|
+
|
|
61
|
+define Package/luasql-pgsql/description
|
|
62
|
+$(call Package/luasql/Default/description)
|
|
63
|
+ .
|
|
64
|
+ This package contains the PostgreSQL binding.
|
|
65
|
+endef
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+define Package/luasql-sqlite3
|
|
69
|
+$(call Package/luasql/Default)
|
|
70
|
+ TITLE+= for SQLite 3
|
|
71
|
+ DEPENDS+= +libsqlite3
|
|
72
|
+ VARIANT:=sqlite3
|
|
73
|
+endef
|
|
74
|
+
|
|
75
|
+define Package/luasql-sqlite3/description
|
|
76
|
+$(call Package/luasql/Default/description)
|
|
77
|
+ .
|
|
78
|
+ This package contains the SQLite 3 binding.
|
|
79
|
+endef
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+TARGET_CFLAGS += $(FPIC) -std=gnu99
|
|
83
|
+TARGET_CPPFLAGS += -DLUA_USE_LINUX
|
|
84
|
+
|
|
85
|
+ifeq ($(BUILD_VARIANT),mysql)
|
|
86
|
+ TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/mysql
|
|
87
|
+ TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib/mysql -lmysqlclient -lz
|
|
88
|
+endif
|
|
89
|
+
|
|
90
|
+ifeq ($(BUILD_VARIANT),postgres)
|
|
91
|
+ TARGET_LDFLAGS += -lpq
|
|
92
|
+endif
|
|
93
|
+
|
|
94
|
+ifeq ($(BUILD_VARIANT),sqlite3)
|
|
95
|
+ TARGET_LDFLAGS += -lsqlite3 -lpthread
|
|
96
|
+endif
|
|
97
|
+
|
|
98
|
+MAKE_FLAGS += \
|
|
99
|
+ T="$(BUILD_VARIANT)" \
|
|
100
|
+ DRIVER_INCS="$(TARGET_CPPFLAGS)" \
|
|
101
|
+ DRIVER_LIBS="$(TARGET_LDFLAGS)" \
|
|
102
|
+ CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
|
|
103
|
+ lib
|
|
104
|
+
|
|
105
|
+define Package/Install/Default
|
|
106
|
+ $(INSTALL_DIR) $(1)/usr/lib/lua/luasql
|
|
107
|
+ $(CP) $(PKG_BUILD_DIR)/src/*.so $(1)/usr/lib/lua/luasql/
|
|
108
|
+endef
|
|
109
|
+
|
|
110
|
+Package/luasql-mysql/install = $(Package/Install/Default)
|
|
111
|
+Package/luasql-pgsql/install = $(Package/Install/Default)
|
|
112
|
+Package/luasql-sqlite3/install = $(Package/Install/Default)
|
|
113
|
+
|
|
114
|
+$(eval $(call BuildPackage,luasql-mysql))
|
|
115
|
+$(eval $(call BuildPackage,luasql-pgsql))
|
|
116
|
+$(eval $(call BuildPackage,luasql-sqlite3))
|