4 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
5 AM_MAKEFLAGS = --no-print-directory
10 OS = $(shell uname -s)
12 DEBIAN_TARBALL_NAME = $(PACKAGE_NAME)_$(PACKAGE_VERSION).orig.tar.xz
15 $(DEBIAN_TARBALL_NAME)
22 -include $(top_builddir)/config.h \
23 -DSYSCONFDIR=\""$(sysconfdir)"\" \
26 AM_CFLAGS = ${my_CFLAGS} \
32 # leaving a space here to work around automake's conditionals
34 AM_LDFLAGS += -Wl,-dead_strip
45 DISTCHECK_CONFIGURE_FLAGS = \
46 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
49 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
50 -e 's,@VERSION\@,$(VERSION),g' \
51 -e 's,@prefix\@,$(prefix),g' \
52 -e 's,@exec_prefix\@,$(exec_prefix),g' \
53 -e 's,@bindir\@,$(bindir),g' \
54 -e 's,@libdir\@,$(libdir),g' \
55 -e 's,@includedir\@,$(includedir),g' \
56 -e 's,@databasedir\@,$(databasedir),g' \
59 databasedir = $(localstatedir)/lib/location
60 pkgconfigdir = $(libdir)/pkgconfig
62 # XXX hardcode path for Debian
63 pythondir = $(prefix)/lib/python3/dist-packages
64 pyexecdir = $(prefix)/lib/python$(PYTHON_VERSION)/lib-dynload
66 # Overwrite Python path
67 pkgpythondir = $(pythondir)/location
72 @INTLTOOL_POLICY_RULE@
74 # ------------------------------------------------------------------------------
76 AM_V_ASCIIDOC = $(AM_V_ASCIIDOC_$(V))
77 AM_V_ASCIIDOC_ = $(AM_V_ASCIIDOC_$(AM_DEFAULT_VERBOSITY))
78 AM_V_ASCIIDOC_0 = @echo " ASCIIDOC" $@;
80 AM_V_XSLT = $(AM_V_XSLT_$(V))
81 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
82 AM_V_XSLT_0 = @echo " XSLT " $@;
84 # ------------------------------------------------------------------------------
88 $(MAKE) -C po update-po
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 = \
105 src/loc/stringpool.h \
112 src_libloc_la_SOURCES = \
122 EXTRA_DIST += src/libloc.sym
124 src_libloc_la_CFLAGS = \
129 src_libloc_la_LDFLAGS = \
131 -version-info $(LIBLOC_CURRENT):$(LIBLOC_REVISION):$(LIBLOC_AGE)
133 if HAVE_LD_VERSION_SCRIPT
134 src_libloc_la_LDFLAGS += -Wl,--version-script=$(top_srcdir)/src/libloc.sym
136 src_libloc_la_LDFLAGS += -export-symbols $(top_srcdir)/src/libloc.sym
139 src_libloc_la_LIBADD = \
143 src_libloc_la_DEPENDENCIES = \
144 ${top_srcdir}/src/libloc.sym
155 dist_pkgpython_PYTHON = \
156 src/python/__init__.py \
157 src/python/database.py \
159 src/python/importer.py \
162 pyexec_LTLIBRARIES = \
163 src/python/_location.la
165 src_python__location_la_SOURCES = \
166 src/python/locationmodule.c \
167 src/python/locationmodule.h \
170 src/python/country.c \
171 src/python/country.h \
172 src/python/database.c \
173 src/python/database.h \
174 src/python/network.c \
175 src/python/network.h \
176 src/python/writer.c \
179 src_python__location_la_CFLAGS = \
183 src_python__location_la_LDFLAGS = \
189 src_python__location_la_LIBADD = \
193 # Compile & install bindings
194 all-local: $(foreach binding,$(BINDINGS),build-$(binding))
195 check-local: $(foreach binding,$(BINDINGS),check-$(binding))
196 install-exec-local: $(foreach binding,$(BINDINGS),install-$(binding))
197 clean-local: $(foreach binding,$(BINDINGS),clean-$(binding))
198 uninstall-local: $(foreach binding,$(BINDINGS),uninstall-$(binding))
202 src/perl/.gitignore \
203 src/perl/Location.xs \
205 src/perl/Makefile.PL \
206 src/perl/lib/Location.pm \
207 src/perl/t/Location.t \
212 @mkdir -p $(builddir)/src/perl/{lib,t}
213 @test -e $(builddir)/src/perl/Location.xs || ln -s --relative $(srcdir)/src/perl/Location.xs $(builddir)/src/perl/
214 @test -e $(builddir)/src/perl/MANIFEST || ln -s --relative $(srcdir)/src/perl/MANIFEST $(builddir)/src/perl/
215 @test -e $(builddir)/src/perl/Makefile.PL || ln -s --relative $(srcdir)/src/perl/Makefile.PL $(builddir)/src/perl/
216 @test -e $(builddir)/src/perl/lib/Location.pm || ln -s --relative $(srcdir)/src/perl/lib/Location.pm $(builddir)/src/perl/lib/
217 @test -e $(builddir)/src/perl/t/Location.t || ln -s --relative $(srcdir)/src/perl/t/Location.t $(builddir)/src/perl/t/
218 @test -e $(builddir)/src/perl/typemap || ln -s --relative $(srcdir)/src/perl/typemap $(builddir)/src/perl/
220 cd $(builddir)/src/perl && $(PERL) Makefile.PL PREFIX="$(prefix)" \
221 INC="-I$(abs_srcdir)/src" LIBS="-L$(abs_builddir)/src/.libs -lloc"
222 cd $(builddir)/src/perl && $(MAKE) LD_RUN_PATH=
225 check-perl: testdata.db
226 cd $(builddir)/src/perl && $(MAKE) LD_LIBRARY_PATH="$(abs_builddir)/src/.libs" test \
227 database="../../$<" keyfile="$(abs_srcdir)/examples/public-key.pem"
231 cd $(builddir)/src/perl && $(MAKE) install
235 cd $(builddir)/src/perl && $(MAKE) distclean
237 .PHONY: uninstall-perl
240 $(DESTDIR)/$(prefix)/lib/*/perl/*/Location.pm \
241 $(DESTDIR)/$(prefix)/lib/*/perl/*/auto/Location \
242 $(DESTDIR)/$(prefix)/lib/*/perl/*/perllocal.pod \
243 $(DESTDIR)/$(prefix)/man/man3/Location.3pm
246 src/python/location-downloader \
247 src/python/location-exporter \
248 src/python/location-importer \
249 src/python/location-query
252 src/python/location-downloader.in \
253 src/python/location-exporter.in \
254 src/python/location-importer.in \
255 src/python/location-query.in
258 src/python/location-downloader \
259 src/python/location-exporter \
260 src/python/location-importer \
261 src/python/location-query
263 # ------------------------------------------------------------------------------
266 systemdsystemunit_DATA = \
267 src/systemd/location-downloader.service \
268 src/systemd/location-downloader.timer
271 $(systemdsystemunit_DATA)
274 $(systemdsystemunitdir)
278 src/systemd/location-downloader.service.in \
279 src/systemd/location-downloader.timer.in
281 # ------------------------------------------------------------------------------
283 dist_database_DATA = \
286 # ------------------------------------------------------------------------------
291 -DABS_SRCDIR=\"$(abs_srcdir)\"
295 src/test-stringpool \
305 testdata.db: examples/python/create-database.py
306 PYTHONPATH=$(abs_builddir)/src/python/.libs \
307 ABS_SRCDIR="$(abs_srcdir)" \
312 src/test-stringpool \
319 src_test_libloc_SOURCES = \
322 src_test_libloc_CFLAGS = \
325 src_test_libloc_LDADD = \
328 src_test_as_SOURCES = \
331 src_test_as_CFLAGS = \
334 src_test_as_LDADD = \
337 src_test_country_SOURCES = \
340 src_test_country_CFLAGS = \
343 src_test_country_LDADD = \
346 src_test_network_SOURCES = \
349 src_test_network_CFLAGS = \
352 src_test_network_LDADD = \
355 src_test_stringpool_SOURCES = \
356 src/test-stringpool.c
358 src_test_stringpool_CFLAGS = \
361 src_test_stringpool_LDADD = \
364 src_test_database_SOURCES = \
367 src_test_database_CFLAGS = \
370 src_test_database_LDADD = \
373 src_test_signature_SOURCES = \
376 src_test_signature_CFLAGS = \
379 src_test_signature_LDADD = \
382 # ------------------------------------------------------------------------------
385 man/location-downloader.8 \
388 MANPAGES_TXT = $(patsubst %.8,%.txt,$(MANPAGES))
389 MANPAGES_HTML = $(patsubst %.txt,%.html,$(MANPAGES_TXT))
390 MANPAGES_XML = $(patsubst %.txt,%.xml,$(MANPAGES_TXT))
393 man: $(MANPAGES) $(MANPAGES_HTML)
411 --stringparam man.output.quietly 1 \
412 --stringparam funcsynopsis.style ansi \
413 --stringparam man.th.extra1.suppress 1 \
414 --stringparam man.authors.section.enabled 1 \
415 --stringparam man.copyright.section.enabled 1
417 XSLTPROC_COMMAND_MAN = \
418 $(AM_V_XSLT)$(MKDIR_P) $(dir $@) && \
419 $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
420 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
422 # Let XSLT find its source on Mac OS X
424 export XML_CATALOG_FILES = /usr/local/etc/xml/catalog
427 man/%.xml: man/%.txt man/asciidoc.conf
428 $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \
430 -f $(abs_srcdir)/man/asciidoc.conf \
431 -d manpage -b docbook -o $@ $<
434 $(XSLTPROC_COMMAND_MAN)
436 man/%.html: man/%.txt man/asciidoc.conf
437 $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \
439 -f $(abs_srcdir)/man/asciidoc.conf \
440 -b html5 -a icons -a theme=flask -o $@ $<
443 upload-man: $(MANPAGES_HTML)
444 rsync -avHz --delete --progress $(MANPAGES_HTML) ms@fs01.haj.ipfire.org:/pub/man-pages/$(PACKAGE_NAME)/
446 $(DEBIAN_TARBALL_NAME): dist
447 cp -v $(distdir).tar.xz $@
450 debian: $(DEBIAN_TARBALL_NAME)
451 debuild -i -us -uc -b