Pre-publish changes
* gitignore cleanup
* cmake package generator option in cache
* util use strcasecmp
--- a/.gitignore Mon Apr 27 13:15:23 2009 +0300
+++ b/.gitignore Tue May 19 00:42:01 2009 +0300
@@ -1,25 +1,4 @@
-# ignore generated by libtool files (no more necessary)
-*.a
-*.o
-*.lo
-*.la
+*~
+build
+*.swp
*.so
-*.lai
-*.so.*
-# ignore backup files
-*~
-# ignore docs: they are not important and apiref is generated on the fly
-*.html
-# ignore generated makefile
-Makefile
-# ignore cmake files
-*.cmake
-CMake*
-CPack*
-# ignore generated header
-config.h
-# ignore resulting bundles
-*.deb
-*.tar.bz2
-# ignore build dir
-build
--- a/CMakeLists.txt Mon Apr 27 13:15:23 2009 +0300
+++ b/CMakeLists.txt Tue May 19 00:42:01 2009 +0300
@@ -1,3 +1,18 @@
+## Copyright 2009 Myhailo Danylenko
+# This file is part of lua-lm
+#
+# lua-lm is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
cmake_minimum_required(VERSION 2.6)
project(lua-lm C)
@@ -22,8 +37,11 @@
set(CPACK_RESOURCE_FILE_README ${lua-lm_SOURCE_DIR}/README)
set(CPACK_RESOURCE_FILE_WELCOME ${lua-lm_SOURCE_DIR}/README)
set(CPACK_DEBIAN_PACKAGE_SECTION libs)
+# XXX: tmp=`tempfile`; obj=${lua-lm_BINARY_DIR}/loudmouth.so; ldd $obj > $tmp; objdump -p $obj | \grep NEEDED | sed -e 's/.*NEEDED *//' | xargs -I "{}" grep -F "{}" $tmp | sed -e 's/.*=> *\(\S*\).*/\1/' | xargs dpkg -S | cut -d : -f 1 | sort -u ; \rm $tmp
+# TODO: versions
+set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libglib2.0-0, liblua5.1-0, libloudmouth1-0")
set(CPACK_SOURCE_GENERATOR TBZ2)
-set(CPACK_GENERATOR DEB)
+set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...")
# FIXME: Detect architecture. How? Though, it anyway produces nonconformant deb names...
set(CPACK_SYSTEM_NAME i386)
# XXX: Set package name directly to get rid of -Sources?
--- a/README Mon Apr 27 13:15:23 2009 +0300
+++ b/README Tue May 19 00:42:01 2009 +0300
@@ -2,13 +2,13 @@
This is a lua 5.1 interface for loudmouth jabber client library.
To install it, you need:
-- lua
+- lua (in fact, optional, to run test, but for now CMake cannot detect liblua separately)
- liblua headers and library
- glib headers and library
- loudmouth headers and library
- cmake
-- pkg-config
-- perl (optional)
+- pkg-config (to detect glib and loudmouth)
+- perl (optional, to generate documentation)
Then do
$ mkdir build
@@ -18,10 +18,12 @@
$ make
# make install
-Debian users can instead of make install do
+Debian users can instead of make install do,
$ fakeroot make package
# dpkg -i liblua5.1-*.deb
+Users of other systems can set other CPack generator wich cache editor.
+
This code underlies terms of GNU GPL v2 or later.
I will be happy to get feedback, patches, suggestions, etc.
--- a/TODO Mon Apr 27 13:15:23 2009 +0300
+++ b/TODO Tue May 19 00:42:01 2009 +0300
@@ -1,4 +1,6 @@
Verify refcounts of lm objects. Need a decent test script for that.
Some additional lua functions?
+Do something abouth strcasecmp non-portability.
+Add versions to dependencies.
--- a/util.c Mon Apr 27 13:15:23 2009 +0300
+++ b/util.c Tue May 19 00:42:01 2009 +0300
@@ -1,5 +1,5 @@
-#include <glib.h> // g_ascii_strcasecmp
+#include <strings.h>
#include <lua.h>
#include <lauxlib.h>
@@ -8,7 +8,7 @@
enum_value_t string2enum (const char *string, const string2enum_t *set)
{
while (set->string) {
- if (!g_ascii_strcasecmp (string, set->string))
+ if (!strcasecmp (string, set->string))
return set->value;
++set;
}