]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - Makefile.am
systemd: Rename location-downloader to location-update
[people/ms/libloc.git] / Makefile.am
index 63efb17151530f3cb12cfcd74878c379d43f89f6..bf204d864843f451a256e15c324871f71bce532e 100644 (file)
@@ -37,6 +37,9 @@ LIBLOC_CURRENT=0
 LIBLOC_REVISION=0
 LIBLOC_AGE=0
 
+pythondir = $(prefix)/lib/python3/dist-packages
+pyexecdir = $(prefix)/lib/python$(PYTHON_VERSION)/lib-dynload
+
 DISTCHECK_CONFIGURE_FLAGS = \
        --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
 
@@ -51,9 +54,12 @@ SED_PROCESS = \
        -e 's,@databasedir\@,$(databasedir),g' \
        < $< > $@ || rm $@
 
-databasedir = $(datadir)/location
+databasedir = $(localstatedir)/lib/location
 pkgconfigdir = $(libdir)/pkgconfig
 
+# Overwrite Python path
+pkgpythondir = $(pythondir)/location
+
 %: %.in Makefile
        $(SED_PROCESS)
 
@@ -76,6 +82,8 @@ update-po:
        $(MAKE) -C po update-po
 
 EXTRA_DIST += \
+       examples/private-key.pem \
+       examples/public-key.pem \
        examples/python/create-database.py \
        examples/python/read-database.py
 
@@ -123,6 +131,7 @@ src_libloc_la_LDFLAGS += -export-symbols $(top_srcdir)/src/libloc.sym
 endif
 
 src_libloc_la_LIBADD = \
+       $(OPENSSL_LIBS) \
        $(RESOLV_LIBS)
 
 src_libloc_la_DEPENDENCIES = \
@@ -137,10 +146,18 @@ EXTRA_DIST += \
 CLEANFILES += \
        src/libloc.pc
 
+dist_pkgpython_PYTHON = \
+       src/python/__init__.py \
+       src/python/database.py \
+       src/python/downloader.py \
+       src/python/i18n.py \
+       src/python/importer.py \
+       src/python/logger.py
+
 pyexec_LTLIBRARIES = \
-       src/python/location.la
+       src/python/_location.la
 
-src_python_location_la_SOURCES = \
+src_python__location_la_SOURCES = \
        src/python/locationmodule.c \
        src/python/locationmodule.h \
        src/python/as.c \
@@ -154,17 +171,17 @@ src_python_location_la_SOURCES = \
        src/python/writer.c \
        src/python/writer.h
 
-src_python_location_la_CFLAGS = \
+src_python__location_la_CFLAGS = \
        $(AM_CFLAGS) \
        $(PYTHON_CFLAGS)
 
-src_python_location_la_LDFLAGS = \
+src_python__location_la_LDFLAGS = \
        $(AM_LDFLAGS) \
        -shared \
        -module \
        -avoid-version
 
-src_python_location_la_LIBADD = \
+src_python__location_la_LIBADD = \
        src/libloc.la \
        $(PYTHON_LIBS)
 
@@ -197,11 +214,12 @@ build-perl:
 
        cd $(builddir)/src/perl && $(PERL) Makefile.PL PREFIX="$(prefix)" \
                INC="-I$(abs_srcdir)/src" LIBS="-L$(abs_builddir)/src/.libs -lloc"
-       cd $(builddir)/src/perl && $(MAKE) LD_RUN_PATH=
+       cd $(builddir)/src/perl && $(MAKE) CC="$(CC)" LD="$(LD)" LD_RUN_PATH=
 
 .PHONY: check-perl
 check-perl: testdata.db
-       cd $(builddir)/src/perl && $(MAKE) test database="../../$<"
+       cd $(builddir)/src/perl && $(MAKE) LD_LIBRARY_PATH="$(abs_builddir)/src/.libs" test \
+               database="../../$<" keyfile="$(abs_srcdir)/examples/public-key.pem"
 
 .PHONY: install-perl
 install-perl:
@@ -220,22 +238,26 @@ uninstall-perl:
                $(DESTDIR)/$(prefix)/man/man3/Location.3pm
 
 bin_SCRIPTS = \
-       src/python/location-downloader \
+       src/python/location-exporter \
+       src/python/location-importer \
        src/python/location-query
 
 EXTRA_DIST += \
-       src/python/location-downloader.in \
+       src/python/location-exporter.in \
+       src/python/location-importer.in \
        src/python/location-query.in
 
 CLEANFILES += \
-       src/python/location-downloader \
+       src/python/location-exporter \
+       src/python/location-importer \
        src/python/location-query
+
 # ------------------------------------------------------------------------------
 
 if HAVE_SYSTEMD
 systemdsystemunit_DATA = \
-       src/systemd/location-downloader.service \
-       src/systemd/location-downloader.timer
+       src/systemd/location-update.service \
+       src/systemd/location-update.timer
 
 CLEANFILES += \
        $(systemdsystemunit_DATA)
@@ -245,14 +267,20 @@ INSTALL_DIRS += \
 endif
 
 EXTRA_DIST += \
-       src/systemd/location-downloader.service.in \
-       src/systemd/location-downloader.timer.in
+       src/systemd/location-update.service.in \
+       src/systemd/location-update.timer.in
+
+# ------------------------------------------------------------------------------
+
+dist_database_DATA = \
+       src/signing-key.pem
 
 # ------------------------------------------------------------------------------
 
 TESTS_CFLAGS = \
        $(AM_CFLAGS) \
-       -DLIBLOC_PRIVATE
+       -DLIBLOC_PRIVATE \
+       -DABS_SRCDIR=\"$(abs_srcdir)\"
 
 TESTS = \
        src/test-libloc \
@@ -260,14 +288,16 @@ TESTS = \
        src/test-database \
        src/test-as \
        src/test-network \
-       src/test-country
+       src/test-country \
+       src/test-signature
 
 CLEANFILES += \
-       test.db \
        testdata.db
 
 testdata.db: examples/python/create-database.py
-       PYTHONPATH=$(abs_builddir)/src/python/.libs $(PYTHON) $< $@
+       PYTHONPATH=$(abs_builddir)/src/python/.libs \
+       ABS_SRCDIR="$(abs_srcdir)" \
+               $(PYTHON) $< $@
 
 check_PROGRAMS = \
        src/test-libloc \
@@ -275,7 +305,8 @@ check_PROGRAMS = \
        src/test-database \
        src/test-as \
        src/test-network \
-       src/test-country
+       src/test-country \
+       src/test-signature
 
 src_test_libloc_SOURCES = \
        src/test-libloc.c
@@ -331,10 +362,18 @@ src_test_database_CFLAGS = \
 src_test_database_LDADD = \
        src/libloc.la
 
+src_test_signature_SOURCES = \
+       src/test-signature.c
+
+src_test_signature_CFLAGS = \
+       $(TESTS_CFLAGS)
+
+src_test_signature_LDADD = \
+       src/libloc.la
+
 # ------------------------------------------------------------------------------
 
 MANPAGES = \
-       man/location-downloader.8 \
        man/location-query.8
 
 MANPAGES_TXT  = $(patsubst %.8,%.txt,$(MANPAGES))
@@ -371,6 +410,11 @@ XSLTPROC_COMMAND_MAN = \
        $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
                http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
 
+# Let XSLT find its source on Mac OS X
+ ifeq ($(OS),Darwin)
+export XML_CATALOG_FILES = /usr/local/etc/xml/catalog
+ endif
+
 man/%.xml: man/%.txt man/asciidoc.conf
        $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \
        $(ASCIIDOC) \
@@ -389,3 +433,21 @@ man/%.html: man/%.txt man/asciidoc.conf
 .PHONY: upload-man
 upload-man: $(MANPAGES_HTML)
        rsync -avHz --delete --progress $(MANPAGES_HTML) ms@fs01.haj.ipfire.org:/pub/man-pages/$(PACKAGE_NAME)/
+
+EXTRA_DIST += \
+       debian/build.sh \
+       debian/changelog \
+       debian/compat \
+       debian/control \
+       debian/copyright \
+       debian/libloc-dev.install \
+       debian/libloc.install \
+       debian/libloc.lintian-overrides \
+       debian/libloc.manpages \
+       debian/libloc-perl.install \
+       debian/rules \
+       debian/source/format
+
+.PHONY: debian
+debian: dist
+       $(SHELL) debian/build.sh $(PACKAGE_NAME)-$(PACKAGE_VERSION) $(distdir).tar.xz