From 4731e99e19e831f7e50a3288cb9b8a750c6f8ae5 Mon Sep 17 00:00:00 2001 From: Oliver Tonnhofer Date: Tue, 21 Nov 2017 14:39:58 +0100 Subject: [PATCH] packaging: build binaries with Debian 8 LevelDB now requires C++11 support which is only available with Debian 8. --- README.md | 13 +++++++++---- Vagrantfile | 2 +- packaging.sh | 31 +++++++++++++++---------------- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 1112db4..1d2cae6 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ Installation There are no official releases, but you find development builds at . These builds are for x86 64bit Linux and require *no* further dependencies. Download, untar and start `imposm3`. +Imposm 0.5 binaries are compatible with Debian 8, Ubuntu 14.04 and SLES 12 (and newer versions). Older Imposm binaries also support Debian 6, RHEL 6 and SLES 11. ### Source @@ -109,13 +110,11 @@ You need [Go >=1.6](http://golang.org). Other dependencies are [libleveldb][], [libgeos][] and [protobuf][]. Imposm 3 was tested with recent versions of these libraries, but you might succeed with older versions. GEOS >=3.2 is recommended, since it became much more robust when handling invalid geometries. -For best performance use [HyperLevelDB][libhyperleveldb] as an in-place replacement for libleveldb. -[libleveldb]: https://code.google.com/p/leveldb/ -[libhyperleveldb]: https://github.com/rescrv/HyperLevelDB +[libleveldb]: https://github.com/google/leveldb/ [libgeos]: http://trac.osgeo.org/geos/ -[protobuf]: https://code.google.com/p/protobuf/ +[protobuf]: https://github.com/google/protobuf #### Compile @@ -137,6 +136,12 @@ Just copy the `imposm3` binary to your server for deployment. The C/C++ librarie See `packaging.sh` for instruction on how to build binary packages for Linux. +#### LevelDB + +For better performance you can either use [HyperLevelDB][libhyperleveldb] as an in-place replacement for libleveldb or you can use LevelDB >1.21. You need to build Imposm with ``go build -tags="ldbpost121"`` or ``LEVELDB_POST_121=1 make build`` to enable optimizations available with LevelDB 1.21 and higher. + +[libhyperleveldb]: https://github.com/rescrv/HyperLevelDB + Usage ----- diff --git a/Vagrantfile b/Vagrantfile index bdf06af..86f72cb 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -12,7 +12,7 @@ Vagrant.configure(2) do |config| # Every Vagrant development environment requires a box. You can search for # boxes at https://atlas.hashicorp.com/search. - config.vm.box = "puppetlabs/debian-6.0.10-64-nocm" + config.vm.box = "debian/jessie64" # Disable automatic box update checking. If you disable this, then # boxes will only be checked for updates when the user runs diff --git a/packaging.sh b/packaging.sh index aadc8db..e675030 100644 --- a/packaging.sh +++ b/packaging.sh @@ -8,9 +8,8 @@ It installs and builds all dependencies, compiles the master branch of this local repository and creates a .tar.gz with the imposm3 binary and all 3rd party dependencies. -This script is made for Debian 6, so that the resulting binaries -are compatible with older Linux distributions, namely SLES 11, RHEL 6, -Ubuntu 10.04 and Debian 6. +This script is made for Debian 8. The resulting binaries +are compatible with Ubuntu 14.04, SLES 12, Fedora 21. 'Vagrantfile' defines a working Debian VM that will call this script during the provision phase. Please install Vagrant and Virtualbox first: @@ -72,23 +71,17 @@ mkdir -p $PREFIX/include mkdir -p $GOPATH -if ! grep --silent 'Debian GNU/Linux 6.0' /etc/issue; then +if ! grep --silent 'Debian GNU/Linux 8' /etc/issue; then echo - echo "ERROR: This script only works for Debian 6.0 (Squeeze), see above." + echo "ERROR: This script only works for Debian 8.0 (Jessie), see above." exit 1 fi if [ ! -e /usr/bin/git ]; then echo "-> installing dependencies" - # squeeze is EOL, use debian-archive - cat < installing leveldb" pushd $SRC $CURL https://github.com/google/leveldb/archive/master.zip -L -O - tar zxf master.zip + unzip master.zip pushd leveldb-master make -j4 cp -R out-shared/liblevel* $PREFIX/lib/ cp -R include/leveldb $PREFIX/include/ popd - popd $SRC + popd fi if [[ -n "$WITH_HYPERLEVELDB" && ! -e $PREFIX/lib/libhyperleveldb.so ]]; then @@ -123,7 +116,7 @@ if [[ -n "$WITH_HYPERLEVELDB" && ! -e $PREFIX/lib/libhyperleveldb.so ]]; then make -j4 make install popd - popd $SRC + popd fi if [[ -n "$WITH_HYPERLEVELDB" && ! -e $PREFIX/include/leveldb ]]; then @@ -221,5 +214,11 @@ pushd $BUILD_BASE tar zcvf imposm3-$VERSION.tar.gz imposm3-$VERSION mkdir -p /vagrant/dist mv imposm3-$VERSION.tar.gz /vagrant/dist/ - echo "placed final package in: ./dist/imposm3-$VERSION.tar.gz" + + echo "###########################################################################" + echo " Call the following commands to download the created binary packages:" + echo + echo "vagrant ssh-config > .vagrant_ssh_conf" + echo "rsync -a -v -P -e 'ssh -F .vagrant_ssh_conf' default:/vagrant/dist ./dist" + echo "###########################################################################" popd