2013-09-06 14:22:16 +00:00
|
|
|
geodatadir = $(pkgdatadir)
|
|
|
|
geodata_DATA = geodata.xml
|
|
|
|
|
|
|
|
EXTRA_DIST = geodata.xml
|
|
|
|
|
|
|
|
MAINTAINERCLEANFILES = geodata.xml
|
|
|
|
|
2013-09-09 20:56:09 +00:00
|
|
|
countryInfoURL = "http://download.geonames.org/export/dump/countryInfo.txt"
|
|
|
|
timeZonesURL = "http://download.geonames.org/export/dump/timeZones.txt"
|
|
|
|
allCountriesURL = "http://download.geonames.org/export/dump/allCountries.zip"
|
|
|
|
|
|
|
|
countryInfo.txt:
|
|
|
|
@-if test -x $(WGET); then \
|
|
|
|
$(WGET) $(countryInfoURL); \
|
|
|
|
else \
|
|
|
|
if test -x $(CURL); then \
|
|
|
|
$(CURL) $(countryInfoURL) > "$@" ; \
|
|
|
|
else \
|
|
|
|
echo "wget and curl could not be found in your PATH."; \
|
|
|
|
echo "One of them is needed to create geodata.xml!"; \
|
|
|
|
fi; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
timeZones.txt:
|
|
|
|
@-if test -x $(WGET); then \
|
|
|
|
$(WGET) $(timeZonesURL); \
|
|
|
|
else \
|
|
|
|
if test -x $(CURL); then \
|
|
|
|
$(CURL) $(timeZonesURL) > "$@" ; \
|
|
|
|
else \
|
|
|
|
echo "wget and curl could not be found in your PATH."; \
|
|
|
|
echo "One of them is needed to create geodata.xml!"; \
|
|
|
|
fi; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
allCountries.zip:
|
|
|
|
@-if test -x $(WGET); then \
|
|
|
|
$(WGET) $(allCountriesURL); \
|
|
|
|
else \
|
|
|
|
if test -x $(CURL); then \
|
|
|
|
$(CURL) $(allCountriesURL) > "$@" ; \
|
|
|
|
else \
|
|
|
|
echo "wget and curl could not be found in your PATH."; \
|
|
|
|
echo "One of them is needed to create geodata.xml!"; \
|
|
|
|
fi; \
|
|
|
|
fi;
|
|
|
|
|
2014-09-21 10:40:34 +00:00
|
|
|
allCountries.txt: allCountries.zip
|
2013-09-09 20:56:09 +00:00
|
|
|
$(AM_V_GEN) if test -x $(UNZIP); then \
|
2014-09-21 10:48:16 +00:00
|
|
|
$(UNZIP) -o allCountries.zip && test -f allCountries.txt && touch allCountries.txt; \
|
2013-09-09 20:56:09 +00:00
|
|
|
else \
|
|
|
|
echo "unzip could not be found in your PATH."; \
|
|
|
|
echo "It is needed to create geodata.xml!"; \
|
2014-09-21 10:48:16 +00:00
|
|
|
fi;
|
2014-09-21 10:40:34 +00:00
|
|
|
|
|
|
|
cities.txt: allCountries.txt
|
2014-09-21 10:48:16 +00:00
|
|
|
$(AM_V_GEN) $(AWK) -f geonames_process.awk allCountries.txt > $@
|
2013-09-09 20:56:09 +00:00
|
|
|
|
|
|
|
geodata.xml: countryInfo.txt timeZones.txt cities.txt
|
2013-09-06 14:22:16 +00:00
|
|
|
$(AM_V_GEN) if test -x "$(PERL)"; then \
|
|
|
|
if test "x$(have_geonames_perl_modules)" = "xyes" -o "x$(I_HAVE_PERL_MODULES)" = "xyes"; then \
|
|
|
|
$(PERL) geonames_process.pl; \
|
|
|
|
else \
|
|
|
|
echo "XML::Writer and IO::File perl modules are required to process geonames data."; \
|
|
|
|
echo "configure reported they are not installed. If you are sure they are,"; \
|
|
|
|
echo "set the I_HAVE_PERL_MODULES environment variable to yes"; \
|
|
|
|
fi; \
|
|
|
|
else \
|
|
|
|
echo "perl5 is required to create geodata.xml!"; \
|
|
|
|
fi
|