aboutsummaryrefslogtreecommitdiff
path: root/lang/luasql/Makefile
diff options
context:
space:
mode:
authorNicolas Thill <nico@openwrt.org>2014-08-27 13:27:05 +0200
committerNicolas Thill <nico@openwrt.org>2014-08-27 13:27:05 +0200
commita4079863fff3e39a1599227e08f8a2cd7ab916c3 (patch)
treee8a06c1503fdbe43bde0a9bcd5b44a9e96984d71 /lang/luasql/Makefile
parent25bf46cf824f66163b75f8872437da07ad097d1d (diff)
luasql: import from old packages feed
- update source URL - simplify build rules - add license info - add myself as maintainer Signed-off-by: Nicolas Thill <nico@openwrt.org>
Diffstat (limited to 'lang/luasql/Makefile')
-rw-r--r--lang/luasql/Makefile116
1 files changed, 116 insertions, 0 deletions
diff --git a/lang/luasql/Makefile b/lang/luasql/Makefile
new file mode 100644
index 000000000..513fa247d
--- /dev/null
+++ b/lang/luasql/Makefile
@@ -0,0 +1,116 @@
+#
+# Copyright (C) 2010-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luasql
+PKG_VERSION:=2.1.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://files.luaforge.net/releases/luasql/luasql
+PKG_MD5SUM:=63bdd57de4b9d1be336ba112d8cb69eb
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILE:=docs/us/license.html
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luasql/Default
+ SUBMENU:=Lua
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=Lua SQL binding
+ URL:=http://www.keplerproject.org/luasql/
+ DEPENDS:= +lua
+endef
+
+define Package/luasql/Default/description
+ LuaSQL is a simple interface from Lua to a DBMS.
+endef
+
+
+define Package/luasql-mysql
+$(call Package/luasql/Default)
+ TITLE+= for MySQL
+ DEPENDS+= +libmysqlclient
+ VARIANT:=mysql
+endef
+
+define Package/luasql-mysql/description
+$(call Package/luasql/Default/description)
+ .
+ This package contains the MySQL binding.
+endef
+
+
+define Package/luasql-pgsql
+$(call Package/luasql/Default)
+ TITLE+= for PostgreSQL
+ DEPENDS+= +libpq
+ VARIANT:=postgres
+endef
+
+define Package/luasql-pgsql/description
+$(call Package/luasql/Default/description)
+ .
+ This package contains the PostgreSQL binding.
+endef
+
+
+define Package/luasql-sqlite3
+$(call Package/luasql/Default)
+ TITLE+= for SQLite 3
+ DEPENDS+= +libsqlite3
+ VARIANT:=sqlite3
+endef
+
+define Package/luasql-sqlite3/description
+$(call Package/luasql/Default/description)
+ .
+ This package contains the SQLite 3 binding.
+endef
+
+
+TARGET_CFLAGS += $(FPIC) -std=gnu99
+TARGET_CPPFLAGS += -DLUA_USE_LINUX
+
+ifeq ($(BUILD_VARIANT),mysql)
+ TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/mysql
+ TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib/mysql -lmysqlclient -lz
+endif
+
+ifeq ($(BUILD_VARIANT),postgres)
+ TARGET_LDFLAGS += -lpq
+endif
+
+ifeq ($(BUILD_VARIANT),sqlite3)
+ TARGET_LDFLAGS += -lsqlite3 -lpthread
+endif
+
+MAKE_FLAGS += \
+ T="$(BUILD_VARIANT)" \
+ DRIVER_INCS="$(TARGET_CPPFLAGS)" \
+ DRIVER_LIBS="$(TARGET_LDFLAGS)" \
+ CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+ lib
+
+define Package/Install/Default
+ $(INSTALL_DIR) $(1)/usr/lib/lua/luasql
+ $(CP) $(PKG_BUILD_DIR)/src/*.so $(1)/usr/lib/lua/luasql/
+endef
+
+Package/luasql-mysql/install = $(Package/Install/Default)
+Package/luasql-pgsql/install = $(Package/Install/Default)
+Package/luasql-sqlite3/install = $(Package/Install/Default)
+
+$(eval $(call BuildPackage,luasql-mysql))
+$(eval $(call BuildPackage,luasql-pgsql))
+$(eval $(call BuildPackage,luasql-sqlite3))