From 6563469fc1f0c62e1c861136651c55f2b9bdfa98 Mon Sep 17 00:00:00 2001 From: Tim Ruehsen Date: Thu, 20 Mar 2014 17:17:24 +0100 Subject: [PATCH] inital commit --- AUTHORS | 0 COPYING | 1 + ChangeLog | 2 ++ INSTALL | 1 + Makefile.am | 14 +++++++++++ NEWS | 0 README | 0 README.md | 18 +++++++++++-- autogen.sh | 18 +++++++++++++ configure.ac | 61 +++++++++++++++++++++++++++++++++++++++++++++ include/Makefile.am | 1 + include/libpsl.h | 0 tests/Makefile.am | 32 ++++++++++++++++++++++++ 13 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 AUTHORS create mode 120000 COPYING create mode 100644 ChangeLog create mode 120000 INSTALL create mode 100644 Makefile.am create mode 100644 NEWS create mode 100644 README create mode 100755 autogen.sh create mode 100644 configure.ac create mode 100644 include/Makefile.am create mode 100644 include/libpsl.h create mode 100644 tests/Makefile.am diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/COPYING b/COPYING new file mode 120000 index 0000000..caeca07 --- /dev/null +++ b/COPYING @@ -0,0 +1 @@ +/usr/share/automake-1.14/COPYING \ No newline at end of file diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..938ace1 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,2 @@ +2014-02-20 Tim Ruehsen + * inital setup diff --git a/INSTALL b/INSTALL new file mode 120000 index 0000000..f812f5a --- /dev/null +++ b/INSTALL @@ -0,0 +1 @@ +/usr/share/automake-1.14/INSTALL \ No newline at end of file diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..6064291 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,14 @@ +# got some hints from https://gitorious.org/openismus-playground/examplelib/source + +SUBDIRS = po include libpsl src examples tests +ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} + +# Enable GTK-Doc during make distcheck +#DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man + +## Install the generated pkg-config file (.pc) into the expected location for +## architecture-dependent package configuration information. Occasionally, +## pkg-config files are also used for architecture-independent data packages, +## in which case the correct install location would be $(datadir)/pkgconfig. +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libpsl-$(LIBPSL_API_VERSION).pc diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index bbe6bac..2572a4f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,16 @@ -libpsl -====== +libpsl - C library to handle the Public Suffix List +=================================================== + +Find more information [here](http://publicsuffix.org/). +Download the Public Suffix List [here](https://hg.mozilla.org/mozilla-central/raw-file/tip/netwerk/dns/effective_tld_names.dat). + +Building from git +----------------- + +Download project and prepare sources with + + git clone http://github.com/rockdaboot/mget + ./autogen.sh + ./configure + make + make check diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..3006b3d --- /dev/null +++ b/autogen.sh @@ -0,0 +1,18 @@ +# !/bin/sh -e + +if test -z `which autoreconf`; then + echo "No autoreconf found. You must install the autoconf package." + exit 1 +fi + +mkdir m4 2>/dev/null + +autoreconf --install --force --symlink || exit $? + +echo +echo "----------------------------------------------------------------" +echo "Initialized build system. For a common configuration please run:" +echo "----------------------------------------------------------------" +echo +echo "./configure" +echo diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..972bbc4 --- /dev/null +++ b/configure.ac @@ -0,0 +1,61 @@ + +AC_INIT([LibPSL], [0.1], [tim.ruehsen@gmx.de], [psl], [http://github.com/rockdaboot/libpsl]) +AC_PREREQ([2.59]) +AM_INIT_AUTOMAKE([1.10 -Wall no-define]) + +# Generate two configuration headers; one for building the library itself with +# an autogenerated template, and a second one that will be installed alongside +# the library. +AC_CONFIG_HEADERS([config.h]) +AC_PROG_CXX +LT_INIT([disable-static]) +C_CONFIG_MACRO_DIR([m4]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +# Define these substitions here to keep all version information in one place. +# For information on how to properly maintain the library version information, +# refer to the libtool manual, section "Updating library version information": +# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +AC_SUBST([LIBPSL_SO_VERSION], [0:0:0]) +AC_SUBST([LIBPSL_API_VERSION], [0.1]) + +# Check for valgrind +ac_enable_valgrind=no +AC_ARG_ENABLE(valgrind-tests, + AS_HELP_STRING([--enable-valgrind-tests], [enable using Valgrind for tests]), + [ac_enable_valgrind=$enableval], [ac_enable_valgrind=no]) + +if test "${ac_enable_valgrind}" = "yes" ; then + AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no) + if test "$HAVE_VALGRIND" = "yes" ; then + VALGRIND_ENVIRONMENT="valgrind --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-origins=yes" + AC_SUBST(VALGRIND_ENVIRONMENT) + TESTS_INFO="Test suite will be run under Valgrind" + else + TESTS_INFO="Valgrind not found" + fi +else + TESTS_INFO="Valgrind testing not enabled" +fi + +# Override the template file name of the generated .pc file, so that there +# is no need to rename the template file when the API version changes. +AC_CONFIG_FILES([Makefile + include/Makefile + src/Makefile + po/Makefile.in + tests/Makefile + libpsl-${LIBPSL_API_VERSION}.pc:libpsl.pc.in]) +AC_OUTPUT + +AC_MSG_NOTICE([Summary of build options: + + Version: ${PACKAGE_VERSION} + Host OS: ${host_os} + Install prefix: ${prefix} + Compiler: ${CC} + CFlags: ${CFLAGS} ${CPPFLAGS} + LDFlags: ${LDFLAGS} + Tests: ${TESTS_INFO} +]) + diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000..a45de59 --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1 @@ +include_HEADERS = libpsl.h diff --git a/include/libpsl.h b/include/libpsl.h new file mode 100644 index 0000000..e69de29 diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..0055c82 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,32 @@ +#DEFS = @DEFS@ -DDATADIR=\"$(datadir)/@PACKAGE@\" -DSRCDIR=\"$(srcdir)\" +DEFS = @DEFS@ -DDATADIR=\"$(top_srcdir)/data\" -DSRCDIR=\"$(srcdir)\" +AM_CPPFLAGS = -Wno-missing-field-initializers -I$(top_srcdir)/include +AM_LDFLAGS = -static +LDADD = libtest.la ../src/libpsl-@LIBPSL_API_VERSION@.la + +PSL_TESTS = test + +check_PROGRAMS = $(PSL_TESTS) + +test_SOURCES = test.c +test_LDADD = ../src/libpsl-@LIBPSL_API_VERSION@.la +test_parse_html_LDADD = ../libmget/libmget-@LIBPSL_API_VERSION@.la + +noinst_LTLIBRARIES = libtest.la +libtest_la_SOURCES = libtest.c +libtest_la_CPPFLAGS = -I$(top_srcdir)/tests -I$(top_srcdir)/include +#libtest_LDADD = libtest.o + +EXTRA_DIST = libtest.h +dist-hook: + rm -f $(distdir)/files/elb_bibel.txt +# cp $(top_srcdir)/data/public_suffixes.txt $(distdir)/files/ +# rm -rf `find $(distdir)/files -name CVS` + +#dist-hook: +# mkdir $(distdir)/random +# cp -p $(srcdir)/random/a1 $(srcdir)/random/a2 $(distdir)/random + +TESTS_ENVIRONMENT = TESTS_VALGRIND="@VALGRIND_ENVIRONMENT@" +#TESTS = test $(PSL_TESTS) +TESTS = $(PSL_TESTS)