INSTALL_DIRS =
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = --no-print-directory
+check_SCRIPTS =
SUBDIRS = . po
BINDINGS =
src/libloc.la \
$(PYTHON_LIBS)
+# ------------------------------------------------------------------------------
+
+if ENABLE_LUA
+lua_LTLIBRARIES = \
+ src/lua/location.la
+
+luadir = $(LUA_INSTALL_CMOD)
+
+src_lua_location_la_SOURCES = \
+ src/lua/location.c \
+ src/lua/location.h
+
+src_lua_location_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(LUA_CFLAGS)
+
+src_lua_location_la_LDFLAGS = \
+ $(AM_LDFLAGS) \
+ $(LUA_LDFLAGS) \
+ -shared \
+ -module \
+ -avoid-version
+
+src_lua_location_la_LIBADD = \
+ src/libloc.la \
+ $(LUA_LIBS)
+endif
+
+EXTRA_DIST += \
+ src/lua/location.c \
+ src/lua/location.h
+
+LUA_TESTS = \
+ tests/lua/main.lua
+
+EXTRA_DIST += \
+ $(LUA_TESTS)
+
+# ------------------------------------------------------------------------------
+
# Compile & install bindings
all-local: $(foreach binding,$(BINDINGS),build-$(binding))
check-local: $(foreach binding,$(BINDINGS),check-$(binding))
src/libloc-internal.la
TESTS_ENVIRONMENT = \
+ LUA_PATH="$(abs_builddir)/src/lua/.libs/?.so;;" \
PYTHONPATH=$(abs_srcdir)/src/python:$(abs_builddir)/src/python/.libs \
TEST_DATA_DIR="$(abs_top_srcdir)/data"
TESTS = \
$(check_PROGRAMS) \
+ $(check_SCRIPTS) \
$(dist_check_SCRIPTS)
CLEANFILES += \
tests/python/test-database.py \
tests/python/test-export.py
+if ENABLE_LUA
+check_SCRIPTS += \
+ $(LUA_TESTS)
+endif
+
check_PROGRAMS = \
src/test-libloc \
src/test-stringpool \
--- /dev/null
+/*
+ libloc - A library to determine the location of someone on the Internet
+
+ Copyright (C) 2024 IPFire Development Team <info@ipfire.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+*/
+
+#include <lua.h>
+
+#include "location.h"
+
+int luaopen_location(lua_State* L) {
+ return 0;
+}
--- /dev/null
+/*
+ libloc - A library to determine the location of someone on the Internet
+
+ Copyright (C) 2024 IPFire Development Team <info@ipfire.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+*/
+
+#include <lua.h>
+
+int luaopen_location(lua_State* L);
--- /dev/null
+#!/usr/bin/lua
+--[[###########################################################################
+# #
+# libloc - A library to determine the location of someone on the Internet #
+# #
+# Copyright (C) 2024 IPFire Development Team <info@ipfire.org> #
+# #
+# This library is free software; you can redistribute it and/or #
+# modify it under the terms of the GNU Lesser General Public #
+# License as published by the Free Software Foundation; either #
+# version 2.1 of the License, or (at your option) any later version. #
+# #
+# This library is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
+# Lesser General Public License for more details. #
+# #
+############################################################################--]]
+
+luaunit = require("luaunit")
+
+function test_load()
+ -- Try loading the module
+ location = require("location")
+end
+
+os.exit(luaunit.LuaUnit.run())