--- /dev/null
+[submodule "osm2pgsql"]
+ path = osm2pgsql
+ url = https://github.com/openstreetmap/osm2pgsql.git
+ ignore = all
--- /dev/null
+Nominatim was written by Brian Quinion.
--- /dev/null
+ACLOCAL_AMFLAGS = -I osm2pgsql/m4
+
+SUBDIRS = osm2pgsql module nominatim
+
+install:
+ @echo Nominatim needs to be executed directly from this directory. No install necessary.
--- /dev/null
+Nominatim
+=========
+
+Nominatim (from the Latin, 'by name') is a tool to search OpenStreetMap data
+by name and address (geocoding) and to generate synthetic addresses of
+OSM points (reverse geocoding). An instance with up-to-date data can be found
+at http://nominatim.openstreetmap.org. Nominatim is also used as one of the
+sources for the Search box on the OpenStreetMap home page and powers the search
+on the MapQuest Open Initiative websites.
+
+Documentation
+=============
+
+More information about Nominatim, including usage and installation instructions,
+can be found in the OSM wiki at:
+
+http://wiki.openstreetmap.org/wiki/Nominatim
+
+Installation
+============
+
+The following instructions is a quick guide to installation. A more detailed guide
+how to set up your own instance of Nominatim can be found in the wiki:
+
+http://wiki.openstreetmap.org/wiki/Nominatim/Installation
+
+Installation steps:
+
+0. If checking out from git run:
+
+ ./autogen.sh
+
+1. Compile Nominatim:
+
+ ./configure [--enable-64bit-ids]
+ make
+
+2. Get OSM data and import:
+
+ ./utils/setup.php --osm-file <your planet file> --all
+
+3. Point your webserver to the ./website directory.
+
+License
+=======
+
+The source code is available under a GPLv2 license.
+
+Contact and Bugreports
+======================
+
+For questions you can join the geocoding mailinglist, see
+http://lists.openstreetmap.org/listinfo/geocoding
+
+Bugs may be reported on the github project site:
+https://github.com/twain47/Nominatim
--- /dev/null
+#!/bin/sh
+autoreconf -vfi
--- /dev/null
+AC_INIT(Nominatim,1.9)
+if git rev-parse HEAD 2>/dev/null >/dev/null; then
+ AC_SUBST([PACKAGE_VERSION], [$PACKAGE_VERSION-git-`git rev-parse --short HEAD`])
+fi
+
+dnl Required autoconf version
+AC_PREREQ(2.61)
+
+AM_INIT_AUTOMAKE([1.9.6 dist-bzip2 std-options check-news])
+
+dnl Additional macro definitions are in here
+AC_CONFIG_MACRO_DIR([osm2pgsql/m4])
+
+dnl Generate configuration header file
+AC_CONFIG_HEADER(nominatim/config.h)
+
+
+dnl Find C compiler
+AC_PROG_CC
+
+dnl Find C++ compiler
+AC_PROG_CXX
+
+dnl pthread
+AX_PTHREAD([], [AC_MSG_ERROR([pthread library required])])
+
+dnl Check for Geos library
+AX_LIB_GEOS
+if test "x$GEOS_VERSION" = "x"
+then
+ AC_MSG_ERROR([required library not found]);
+fi
+
+dnl Check for Proj library
+AX_LIB_PROJ
+if test "$HAVE_PROJ" = "no"
+then
+ AC_MSG_ERROR([required library not found]);
+fi
+
+
+dnl Check for PostgresSQL client library
+AX_LIB_POSTGRESQL(8.4)
+if test "x$POSTGRESQL_VERSION" = "x"
+then
+ AC_MSG_ERROR([postgresql client library not found])
+fi
+if test ! -f "$POSTGRESQL_PGXS"
+then
+ AC_MSG_ERROR([postgresql server development library not found])
+fi
+
+dnl Check for bzip2 library
+AX_LIB_BZIP2
+if test "$HAVE_BZIP2" = "no"
+then
+ AC_MSG_ERROR([required library not found]);
+fi
+
+dnl Check for libxml2 library
+AM_PATH_XML2
+
+AC_CONFIG_SUBDIRS([osm2pgsql])
+
+AC_OUTPUT(Makefile nominatim/Makefile module/Makefile)
+++ /dev/null
-MODULES = nominatim
-PGXS := $(shell pg_config --pgxs)
-include $(PGXS)
-
-all:
- chmod 755 nominatim.so
--- /dev/null
+MODULES = nominatim
+PGXS := @POSTGRESQL_PGXS@
+include $(PGXS)
+
+all:
+ chmod 755 nominatim.so
+
+install:
+ @echo Library does not need to be installed.
--- /dev/null
+bin_PROGRAMS = nominatim
+
+nominatim_SOURCES = export.c geometry.cpp import.c index.c input.c nominatim.c postgresql.c sprompt.c
+
+AM_CFLAGS = @PTHREAD_CFLAGS@ @POSTGRESQL_CFLAGS@ @XML_CPPFLAGS@ @BZIP2_CFLAGS@ @GEOS_CFLAGS@ @PROJ_CFLAGS@ -DVERSION='"@PACKAGE_VERSION@"'
+AM_CPPFLAGS = @PTHREAD_CFLAGS@ @POSTGRESQL_CFLAGS@ @XML_CPPFLAGS@ @BZIP2_CFLAGS@ @GEOS_CFLAGS@ @PROJ_CFLAGS@
+
+AM_LDFLAGS = @PTHREAD_CFLAGS@ @POSTGRESQL_LDFLAGS@ @POSTGRESQL_LIBS@ @XML_LIBS@ @BZIP2_LDFLAGS@ @BZIP2_LIBS@ @GEOS_LDFLAGS@ @GEOS_LIBS@ @PROJ_LDFLAGS@ @PROJ_LIBS@ -lz
+
+++ /dev/null
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-sysconfdir = @sysconfdir@
-datarootdir = @datarootdir@
-datadir = @datadir@
-
-PACKAGE = @PACKAGE_NAME@
-VERSION = @PACKAGE_VERSION@
-SVN:=$(shell svnversion)
-DATADIR = $(datadir)/$(PACKAGE)
-
-
-CC = @CC@
-CXX = @CXX@
-
-CFLAGS += -g -O2 -Wall -Wextra
-CFLAGS += $(shell xml2-config --cflags)
-CFLAGS += $(shell geos-config --cflags)
-CFLAGS += -I$(shell pg_config --includedir)
-CFLAGS += -DVERSION=\"$(VERSION)-$(SVN)\"
-CFLAGS += -DHAVE_PTHREAD
-CFLAGS += -DNOMINATIM_DATADIR=\"$(DATADIR)\"
-
-LDFLAGS += $(shell xml2-config --libs)
-LDFLAGS += $(shell geos-config --libs)
-LDFLAGS += -L$(shell pg_config --libdir) -lpq
-LDFLAGS += -lbz2 -lz
-LDFLAGS += -g -lproj
-LDFLAGS += -lstdc++
-LDFLAGS += -lpthread
-
-SRCS:=$(wildcard *.c) $(wildcard *.cpp)
-OBJS:=$(SRCS:.c=.o)
-OBJS:=$(OBJS:.cpp=.o)
-DEPS:=$(SRCS:.c=.d)
-DEPS:=$(DEPS:.cpp=.d)
-
-APPS:=nominatim
-DATA:=default.style
-
-.PHONY: all clean $(PACKAGE).spec
-
-all: $(APPS)
-
-clean:
- rm -f $(APPS) $(OBJS) $(DEPS)
- rm -f $(PACKAGE)-*.tar.bz2
- rm -f nominatim.spec
-
-clean-all: clean
- rm -rf autom4te.cache
- rm -f config.h
- rm -f config.log
- rm -f config.status
- rm -f configure
- rm -f Makefile
-
-install: $(APPS)
- mkdir -p $(DESTDIR)$(bindir)
- install -m 0755 $(APPS) $(DESTDIR)$(bindir)
- mkdir -p $(DESTDIR)$(DATADIR)
- install -m 0644 $(DATA) $(DESTDIR)$(DATADIR)
-
-%.d: %.c
- @set -e; rm -f $@; \
- $(CC) -MM $(CFLAGS) $< > $@.$$$$; \
- sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
- rm -f $@.$$$$
-
--include $(DEPS)
-
-nominatim: $(OBJS)
- $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
-
-$(PACKAGE).spec: $(PACKAGE).spec.in
- sed -e "s/@PACKAGE@/$(PACKAGE)/g; s/@VERSION@/$(VERSION)/g; s/@SVN@/$(SVN)/g;" $^ > $@
-
-$(PACKAGE)-$(VERSION).tar.bz2: $(PACKAGE).spec
- rm -fR tmp
- mkdir -p tmp/nominatim
- cp -p Makefile *.[ch] *.cpp README.txt nominatim-svn.sh tmp/nominatim
- cp -p nominatim.spec tmp/
- tar cjf $@ -C tmp .
- rm -fR tmp
-
-rpm: $(PACKAGE)-$(VERSION).tar.bz2
- rpmbuild -ta $^
+++ /dev/null
-#!/bin/sh
-autoconf
+++ /dev/null
-/* config.h.in. Generated from configure.ac by autoheader. */
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
+++ /dev/null
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(nominatim, 0.1)
-
-dnl Generate configuration header file
-AC_CONFIG_HEADER(config.h)
-
-dnl Find C compiler
-AC_PROG_CC
-
-dnl Find C++ compiler
-AC_PROG_CXX
-
-dnl Generate Makefile
-AC_OUTPUT(Makefile)
-
+++ /dev/null
-#!/bin/sh
-
-DATE=$(date +%Y%m%d)
-MODULE="$(basename $0 -svn.sh)"
-SVNROOT=http://svn.openstreetmap.org/applications/utils/nominatim/
-
-set -x
-rm -rf $MODULE
-
-svn export $SVNROOT $MODULE/
-
-## tar it up
-tar cjf $MODULE-${DATE}svn.tar.bz2 $MODULE
-
-## cleanup
-rm -rf $MODULE
-
--- /dev/null
+Subproject commit a5809fdaec5e52c00a97bcdfc48b8e13acffadd2