4 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
5 AM_MAKEFLAGS = --no-print-directory
11 OS = $(shell uname -s)
17 bashcompletiondir = @bashcompletiondir@
20 -include $(top_builddir)/config.h \
21 -DSYSCONFDIR=\""$(sysconfdir)"\" \
24 AM_CFLAGS = ${my_CFLAGS} \
28 AM_LDFLAGS = ${my_LDFLAGS}
30 # leaving a space here to work around automake's conditionals
32 AM_LDFLAGS += -Wl,-dead_strip
43 DISTCHECK_CONFIGURE_FLAGS = \
44 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
47 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
48 -e 's,@VERSION\@,$(VERSION),g' \
49 -e 's,@prefix\@,$(prefix),g' \
50 -e 's,@exec_prefix\@,$(exec_prefix),g' \
51 -e 's,@bindir\@,$(bindir),g' \
52 -e 's,@libdir\@,$(libdir),g' \
53 -e 's,@includedir\@,$(includedir),g' \
54 -e 's,@databasedir\@,$(databasedir),g' \
57 cron_dailydir = $(sysconfdir)/cron.daily
58 databasedir = $(localstatedir)/lib/location
59 pkgconfigdir = $(libdir)/pkgconfig
61 # Overwrite Python path
62 pkgpythondir = $(pythondir)/location
67 @INTLTOOL_POLICY_RULE@
69 # ------------------------------------------------------------------------------
71 AM_V_ASCIIDOC = $(AM_V_ASCIIDOC_$(V))
72 AM_V_ASCIIDOC_ = $(AM_V_ASCIIDOC_$(AM_DEFAULT_VERBOSITY))
73 AM_V_ASCIIDOC_0 = @echo " ASCIIDOC" $@;
75 AM_V_XSLT = $(AM_V_XSLT_$(V))
76 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
77 AM_V_XSLT_0 = @echo " XSLT " $@;
79 # ------------------------------------------------------------------------------
82 update-po: po/POTFILES.in
83 $(MAKE) -C po update-po
85 po/POTFILES.in: Makefile
86 find $(abs_srcdir)/src -type f \( -name '*.in' -o -name '*.py' \) \
87 \! -exec git check-ignore -q {} \; -print | \
88 sed -e "s@$(abs_srcdir)/@@g" | LC_ALL=C sort > $@
91 examples/private-key.pem \
92 examples/public-key.pem \
93 examples/python/create-database.py \
94 examples/python/read-database.py
96 pkginclude_HEADERS = \
98 src/libloc/address.h \
100 src/libloc/as-list.h \
101 src/libloc/compat.h \
102 src/libloc/country.h \
103 src/libloc/country-list.h \
104 src/libloc/database.h \
105 src/libloc/format.h \
106 src/libloc/network.h \
107 src/libloc/network-list.h \
108 src/libloc/network-tree.h \
109 src/libloc/private.h \
110 src/libloc/stringpool.h \
111 src/libloc/resolv.h \
117 src_libloc_la_SOURCES = \
132 EXTRA_DIST += src/libloc.sym
134 src_libloc_la_CFLAGS = \
139 src_libloc_la_LDFLAGS = \
141 -version-info $(LIBLOC_CURRENT):$(LIBLOC_REVISION):$(LIBLOC_AGE)
143 if HAVE_LD_VERSION_SCRIPT
144 src_libloc_la_LDFLAGS += -Wl,--version-script=$(top_srcdir)/src/libloc.sym
146 src_libloc_la_LDFLAGS += -export-symbols $(top_srcdir)/src/libloc.sym
149 src_libloc_la_LIBADD = \
153 src_libloc_la_DEPENDENCIES = \
154 ${top_srcdir}/src/libloc.sym
156 noinst_LTLIBRARIES = \
157 src/libloc-internal.la
159 src_libloc_internal_la_SOURCES = \
160 $(src_libloc_la_SOURCES)
162 src_libloc_internal_la_CFLAGS = \
163 $(src_libloc_la_CFLAGS)
165 src_libloc_internal_la_LDFLAGS = \
166 $(filter-out -version-info %,$(src_libloc_la_LDFLAGS))
168 src_libloc_internal_la_LIBADD = \
169 $(src_libloc_la_LIBADD)
171 src_libloc_internal_la_DEPENDENCIES = \
172 $(src_libloc_la_DEPENDENCIES)
183 if BUILD_BASH_COMPLETION
184 bashcompletion_DATA = \
185 bash-completion/location
189 bash-completion/location
191 dist_pkgpython_PYTHON = \
192 src/python/location/__init__.py \
193 src/python/location/database.py \
194 src/python/location/downloader.py \
195 src/python/location/export.py \
196 src/python/location/i18n.py \
197 src/python/location/importer.py \
198 src/python/location/logger.py
200 pyexec_LTLIBRARIES = \
201 src/python/_location.la
203 src_python__location_la_SOURCES = \
204 src/python/locationmodule.c \
205 src/python/locationmodule.h \
208 src/python/country.c \
209 src/python/country.h \
210 src/python/database.c \
211 src/python/database.h \
212 src/python/network.c \
213 src/python/network.h \
214 src/python/writer.c \
217 src_python__location_la_CFLAGS = \
221 src_python__location_la_LDFLAGS = \
227 src_python__location_la_LIBADD = \
231 # ------------------------------------------------------------------------------
237 luadir = $(LUA_INSTALL_CMOD)
239 src_lua_location_la_SOURCES = \
245 src_lua_location_la_CFLAGS = \
249 src_lua_location_la_LDFLAGS = \
256 src_lua_location_la_LIBADD = \
273 # ------------------------------------------------------------------------------
275 # Compile & install bindings
276 all-local: $(foreach binding,$(BINDINGS),build-$(binding))
277 check-local: $(foreach binding,$(BINDINGS),check-$(binding))
278 install-exec-local: $(foreach binding,$(BINDINGS),install-$(binding))
279 clean-local: $(foreach binding,$(BINDINGS),clean-$(binding))
280 uninstall-local: $(foreach binding,$(BINDINGS),uninstall-$(binding))
284 src/perl/.gitignore \
285 src/perl/Location.xs \
287 src/perl/Makefile.PL \
288 src/perl/lib/Location.pm \
289 src/perl/t/Location.t \
292 build-perl: src/libloc.la
293 @mkdir -p $(builddir)/src/perl/{lib,t}
294 @test -e $(builddir)/src/perl/Location.xs || ln -s --relative $(srcdir)/src/perl/Location.xs $(builddir)/src/perl/
295 @test -e $(builddir)/src/perl/MANIFEST || ln -s --relative $(srcdir)/src/perl/MANIFEST $(builddir)/src/perl/
296 @test -e $(builddir)/src/perl/Makefile.PL || ln -s --relative $(srcdir)/src/perl/Makefile.PL $(builddir)/src/perl/
297 @test -e $(builddir)/src/perl/lib/Location.pm || ln -s --relative $(srcdir)/src/perl/lib/Location.pm $(builddir)/src/perl/lib/
298 @test -e $(builddir)/src/perl/t/Location.t || ln -s --relative $(srcdir)/src/perl/t/Location.t $(builddir)/src/perl/t/
299 @test -e $(builddir)/src/perl/typemap || ln -s --relative $(srcdir)/src/perl/typemap $(builddir)/src/perl/
301 cd $(builddir)/src/perl && $(PERL) Makefile.PL NO_PACKLIST=1 NO_PERLLOCAL=1 \
303 INC="-I$(abs_srcdir)/src" LIBS="-L$(abs_builddir)/src/.libs -lloc"
304 cd $(builddir)/src/perl && $(MAKE)
308 check-perl: testdata.db build-perl
309 cd $(builddir)/src/perl && $(MAKE) LD_LIBRARY_PATH="$(abs_builddir)/src/.libs" test \
310 database="../../$<" keyfile="$(abs_srcdir)/examples/public-key.pem"
313 install-perl: build-perl
314 cd $(builddir)/src/perl && $(MAKE) install DESTDIR=$(DESTDIR)
318 cd $(builddir)/src/perl && $(MAKE) distclean
321 .PHONY: uninstall-perl
324 $(DESTDIR)/@PERL_MODPATH@/Location.pm \
325 $(DESTDIR)/@PERL_MODPATH@/auto/Location/Location.so \
326 $(DESTDIR)/@PERL_MANPATH@/Location.3pm
327 -rmdir $(DESTDIR)/@PERL_MODPATH@/auto/Location
330 src/scripts/location \
331 src/scripts/location-importer
334 src/scripts/location.in \
335 src/scripts/location-importer.in
338 src/scripts/location \
339 src/scripts/location-importer
341 # ------------------------------------------------------------------------------
343 # Use systemd timers if available
345 systemdsystemunit_DATA = \
346 src/systemd/location-update.service \
347 src/systemd/location-update.timer
350 $(systemdsystemunit_DATA)
353 $(systemdsystemunitdir)
355 # Otherwise fall back to cron
357 cron_daily_SCRIPTS = \
358 src/cron/location-update
365 src/cron/location-update.in \
366 src/systemd/location-update.service.in \
367 src/systemd/location-update.timer.in
369 # ------------------------------------------------------------------------------
371 dist_database_DATA = \
376 chmod 444 $(DESTDIR)$(databasedir)/database.db
378 .PHONY: update-database
380 curl https://location.ipfire.org/databases/1/location.db.xz | xz -d > data/database.db
382 # ------------------------------------------------------------------------------
387 -DABS_SRCDIR=\"$(abs_srcdir)\"
391 src/libloc-internal.la
393 TESTS_ENVIRONMENT = \
394 LUA_CPATH="$(abs_builddir)/src/lua/.libs/?.so;;" \
395 PYTHONPATH=$(abs_srcdir)/src/python:$(abs_builddir)/src/python/.libs \
396 TEST_DATA_DIR="$(abs_top_srcdir)/data" \
397 TEST_DATABASE="$(abs_top_srcdir)/data/database.db"
402 $(dist_check_SCRIPTS)
407 testdata.db: examples/python/create-database.py
408 PYTHONPATH=$(abs_srcdir)/src/python:$(abs_builddir)/src/python/.libs \
409 ABS_SRCDIR="$(abs_srcdir)" \
412 dist_check_SCRIPTS = \
413 tests/python/country.py \
414 tests/python/networks-dedup.py \
415 tests/python/test-database.py \
416 tests/python/test-export.py
425 src/test-stringpool \
429 src/test-network-list \
434 src_test_libloc_SOURCES = \
437 src_test_libloc_CFLAGS = \
440 src_test_libloc_LDADD = \
443 src_test_as_SOURCES = \
446 src_test_as_CFLAGS = \
449 src_test_as_LDADD = \
452 src_test_country_SOURCES = \
455 src_test_country_CFLAGS = \
458 src_test_country_LDADD = \
461 src_test_network_SOURCES = \
464 src_test_network_CFLAGS = \
467 src_test_network_LDADD = \
470 src_test_network_list_SOURCES = \
471 src/test-network-list.c
473 src_test_network_list_CFLAGS = \
476 src_test_network_list_LDADD = \
479 src_test_stringpool_SOURCES = \
480 src/test-stringpool.c
482 src_test_stringpool_CFLAGS = \
485 src_test_stringpool_LDADD = \
488 src_test_database_SOURCES = \
491 src_test_database_CFLAGS = \
494 src_test_database_LDADD = \
497 src_test_signature_SOURCES = \
500 src_test_signature_CFLAGS = \
503 src_test_signature_LDADD = \
506 src_test_address_SOURCES = \
509 src_test_address_CFLAGS = \
512 src_test_address_LDADD = \
515 # ------------------------------------------------------------------------------
523 man/loc_database_count_as.3 \
524 man/loc_database_get_as.3 \
525 man/loc_database_get_country.3 \
526 man/loc_database_lookup.3 \
527 man/loc_database_new.3 \
528 man/loc_get_log_priority.3 \
530 man/loc_set_log_fn.3 \
531 man/loc_set_log_priority.3
536 MANPAGES_TXT = $(MANPAGES_TXT_3) $(MANPAGES_TXT_1)
537 MANPAGES_TXT_3 = $(patsubst %.3,%.txt,$(MANPAGES_3))
538 MANPAGES_TXT_1 = $(patsubst %.1,%.txt,$(MANPAGES_1))
539 MANPAGES_HTML = $(patsubst %.txt,%.html,$(MANPAGES_TXT))
540 MANPAGES_XML = $(patsubst %.txt,%.xml,$(MANPAGES_TXT))
543 man: $(MANPAGES) $(MANPAGES_HTML)
561 --stringparam man.output.quietly 1 \
562 --stringparam funcsynopsis.style ansi \
563 --stringparam man.th.extra1.suppress 1 \
564 --stringparam man.authors.section.enabled 1 \
565 --stringparam man.copyright.section.enabled 1
567 XSLTPROC_COMMAND_MAN = \
568 $(AM_V_XSLT)$(MKDIR_P) $(dir $@) && \
569 $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
570 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
572 # Let XSLT find its source on Mac OS X
574 export XML_CATALOG_FILES = /usr/local/etc/xml/catalog
577 man/%.xml: man/%.txt man/asciidoc.conf
578 $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \
580 -f $(abs_srcdir)/man/asciidoc.conf \
581 -d manpage -b docbook -o $@ $<
584 $(XSLTPROC_COMMAND_MAN)
587 $(XSLTPROC_COMMAND_MAN)
589 man/%.html: man/%.txt man/asciidoc.conf
590 $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \
592 -f $(abs_srcdir)/man/asciidoc.conf \
593 -b html5 -a icons -a theme=flask -o $@ $<
596 upload-man: $(MANPAGES_HTML)
597 rsync -avHz --delete --progress $(MANPAGES_HTML) ms@fs01.haj.ipfire.org:/pub/man-pages/$(PACKAGE_NAME)/
607 debian/genchangelog.sh \
608 debian/gensymbols.sh \
609 debian/libloc1.install \
610 debian/libloc1.symbols \
611 debian/libloc-dev.install \
612 debian/location.install \
613 debian/location.postinst \
614 debian/location.postrm \
615 debian/python3-location.examples \
616 debian/python3-location.install \
618 debian/source/format \
623 $(SHELL) debian/build.sh $(PACKAGE_NAME)-$(PACKAGE_VERSION) $(distdir).tar.xz