4 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
5 AM_MAKEFLAGS = --no-print-directory
10 OS = $(shell uname -s)
17 -include $(top_builddir)/config.h \
18 -DSYSCONFDIR=\""$(sysconfdir)"\" \
21 AM_CFLAGS = ${my_CFLAGS} \
27 # leaving a space here to work around automake's conditionals
29 AM_LDFLAGS += -Wl,-dead_strip
40 pythondir = $(prefix)/lib/python3/dist-packages
41 pyexecdir = $(prefix)/lib/python$(PYTHON_VERSION)/lib-dynload
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 databasedir = $(localstatedir)/lib/location
58 pkgconfigdir = $(libdir)/pkgconfig
60 # Overwrite Python path
61 pkgpythondir = $(pythondir)/location
66 @INTLTOOL_POLICY_RULE@
68 # ------------------------------------------------------------------------------
70 AM_V_ASCIIDOC = $(AM_V_ASCIIDOC_$(V))
71 AM_V_ASCIIDOC_ = $(AM_V_ASCIIDOC_$(AM_DEFAULT_VERBOSITY))
72 AM_V_ASCIIDOC_0 = @echo " ASCIIDOC" $@;
74 AM_V_XSLT = $(AM_V_XSLT_$(V))
75 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
76 AM_V_XSLT_0 = @echo " XSLT " $@;
78 # ------------------------------------------------------------------------------
81 update-po: po/POTFILES.in
82 $(MAKE) -C po update-po
84 po/POTFILES.in: Makefile
85 find $(abs_srcdir)/src | \
86 grep -E "\.(in|py)$$" | sed -e "s@$(abs_srcdir)/@@g" | sort > $@
89 examples/private-key.pem \
90 examples/public-key.pem \
91 examples/python/create-database.py \
92 examples/python/read-database.py
94 pkginclude_HEADERS = \
103 src/loc/stringpool.h \
110 src_libloc_la_SOURCES = \
120 EXTRA_DIST += src/libloc.sym
122 src_libloc_la_CFLAGS = \
127 src_libloc_la_LDFLAGS = \
129 -version-info $(LIBLOC_CURRENT):$(LIBLOC_REVISION):$(LIBLOC_AGE)
131 if HAVE_LD_VERSION_SCRIPT
132 src_libloc_la_LDFLAGS += -Wl,--version-script=$(top_srcdir)/src/libloc.sym
134 src_libloc_la_LDFLAGS += -export-symbols $(top_srcdir)/src/libloc.sym
137 src_libloc_la_LIBADD = \
141 src_libloc_la_DEPENDENCIES = \
142 ${top_srcdir}/src/libloc.sym
153 dist_pkgpython_PYTHON = \
154 src/python/__init__.py \
155 src/python/database.py \
156 src/python/downloader.py \
157 src/python/export.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) CC="$(CC)" LD="$(LD)" 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 \
247 src/python/location-importer
250 src/python/location.in \
251 src/python/location-importer.in
254 src/python/location \
255 src/python/location-importer
257 # ------------------------------------------------------------------------------
260 systemdsystemunit_DATA = \
261 src/systemd/location-update.service \
262 src/systemd/location-update.timer
265 $(systemdsystemunit_DATA)
268 $(systemdsystemunitdir)
272 src/systemd/location-update.service.in \
273 src/systemd/location-update.timer.in
275 # ------------------------------------------------------------------------------
277 dist_database_DATA = \
280 # ------------------------------------------------------------------------------
285 -DABS_SRCDIR=\"$(abs_srcdir)\"
289 src/test-stringpool \
299 testdata.db: examples/python/create-database.py
300 PYTHONPATH=$(abs_builddir)/src/python/.libs \
301 ABS_SRCDIR="$(abs_srcdir)" \
306 src/test-stringpool \
313 src_test_libloc_SOURCES = \
316 src_test_libloc_CFLAGS = \
319 src_test_libloc_LDADD = \
322 src_test_as_SOURCES = \
325 src_test_as_CFLAGS = \
328 src_test_as_LDADD = \
331 src_test_country_SOURCES = \
334 src_test_country_CFLAGS = \
337 src_test_country_LDADD = \
340 src_test_network_SOURCES = \
343 src_test_network_CFLAGS = \
346 src_test_network_LDADD = \
349 src_test_stringpool_SOURCES = \
350 src/test-stringpool.c
352 src_test_stringpool_CFLAGS = \
355 src_test_stringpool_LDADD = \
358 src_test_database_SOURCES = \
361 src_test_database_CFLAGS = \
364 src_test_database_LDADD = \
367 src_test_signature_SOURCES = \
370 src_test_signature_CFLAGS = \
373 src_test_signature_LDADD = \
376 # ------------------------------------------------------------------------------
381 MANPAGES_TXT = $(patsubst %.8,%.txt,$(MANPAGES))
382 MANPAGES_HTML = $(patsubst %.txt,%.html,$(MANPAGES_TXT))
383 MANPAGES_XML = $(patsubst %.txt,%.xml,$(MANPAGES_TXT))
386 man: $(MANPAGES) $(MANPAGES_HTML)
404 --stringparam man.output.quietly 1 \
405 --stringparam funcsynopsis.style ansi \
406 --stringparam man.th.extra1.suppress 1 \
407 --stringparam man.authors.section.enabled 1 \
408 --stringparam man.copyright.section.enabled 1
410 XSLTPROC_COMMAND_MAN = \
411 $(AM_V_XSLT)$(MKDIR_P) $(dir $@) && \
412 $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
413 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
415 # Let XSLT find its source on Mac OS X
417 export XML_CATALOG_FILES = /usr/local/etc/xml/catalog
420 man/%.xml: man/%.txt man/asciidoc.conf
421 $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \
423 -f $(abs_srcdir)/man/asciidoc.conf \
424 -d manpage -b docbook -o $@ $<
427 $(XSLTPROC_COMMAND_MAN)
429 man/%.html: man/%.txt man/asciidoc.conf
430 $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \
432 -f $(abs_srcdir)/man/asciidoc.conf \
433 -b html5 -a icons -a theme=flask -o $@ $<
436 upload-man: $(MANPAGES_HTML)
437 rsync -avHz --delete --progress $(MANPAGES_HTML) ms@fs01.haj.ipfire.org:/pub/man-pages/$(PACKAGE_NAME)/
445 debian/location.install \
446 debian/location.manpages \
447 debian/location-perl.install \
448 debian/location-python.install \
449 debian/libloc0.install \
450 debian/libloc-dev.install \
456 $(SHELL) debian/build.sh $(PACKAGE_NAME)-$(PACKAGE_VERSION) $(distdir).tar.xz