packaging: build binaries with Debian 8

LevelDB now requires C++11 support which is only available
with Debian 8.
master
Oliver Tonnhofer 2017-11-21 14:39:58 +01:00
parent e96cb2541c
commit 4731e99e19
3 changed files with 25 additions and 21 deletions

View File

@ -95,6 +95,7 @@ Installation
There are no official releases, but you find development builds at <http://imposm.org/static/rel/>. There are no official releases, but you find development builds at <http://imposm.org/static/rel/>.
These builds are for x86 64bit Linux and require *no* further dependencies. Download, untar and start `imposm3`. 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 ### Source
@ -109,13 +110,11 @@ You need [Go >=1.6](http://golang.org).
Other dependencies are [libleveldb][], [libgeos][] and [protobuf][]. Other dependencies are [libleveldb][], [libgeos][] and [protobuf][].
Imposm 3 was tested with recent versions of these libraries, but you might succeed with older versions. 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. 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/ [libleveldb]: https://github.com/google/leveldb/
[libhyperleveldb]: https://github.com/rescrv/HyperLevelDB
[libgeos]: http://trac.osgeo.org/geos/ [libgeos]: http://trac.osgeo.org/geos/
[protobuf]: https://code.google.com/p/protobuf/ [protobuf]: https://github.com/google/protobuf
#### Compile #### 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. 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 Usage
----- -----

2
Vagrantfile vendored
View File

@ -12,7 +12,7 @@ Vagrant.configure(2) do |config|
# Every Vagrant development environment requires a box. You can search for # Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search. # 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 # Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs # boxes will only be checked for updates when the user runs

View File

@ -8,9 +8,8 @@ It installs and builds all dependencies, compiles the master
branch of this local repository and creates a .tar.gz with branch of this local repository and creates a .tar.gz with
the imposm3 binary and all 3rd party dependencies. the imposm3 binary and all 3rd party dependencies.
This script is made for Debian 6, so that the resulting binaries This script is made for Debian 8. The resulting binaries
are compatible with older Linux distributions, namely SLES 11, RHEL 6, are compatible with Ubuntu 14.04, SLES 12, Fedora 21.
Ubuntu 10.04 and Debian 6.
'Vagrantfile' defines a working Debian VM that will call this script 'Vagrantfile' defines a working Debian VM that will call this script
during the provision phase. Please install Vagrant and Virtualbox first: during the provision phase. Please install Vagrant and Virtualbox first:
@ -72,23 +71,17 @@ mkdir -p $PREFIX/include
mkdir -p $GOPATH 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
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 exit 1
fi fi
if [ ! -e /usr/bin/git ]; then if [ ! -e /usr/bin/git ]; then
echo "-> installing dependencies" echo "-> installing dependencies"
# squeeze is EOL, use debian-archive
cat <<EOF | sudo tee /etc/apt/sources.list
deb http://ftp.de.debian.org/debian-archive/debian squeeze main
deb-src http://ftp.de.debian.org/debian-archive/debian squeeze main
EOF
sudo apt-get update -y sudo apt-get update -y
sudo apt-get install -y build-essential unzip autoconf libtool git-core chrpath sudo apt-get install -y build-essential unzip autoconf libtool git chrpath curl
fi fi
if [ ! -e $BUILD_BASE/go/bin/go ]; then if [ ! -e $BUILD_BASE/go/bin/go ]; then
@ -103,13 +96,13 @@ if [[ -z "$WITH_HYPERLEVELDB" && ! -e $PREFIX/lib/libleveldb.so ]]; then
echo "-> installing leveldb" echo "-> installing leveldb"
pushd $SRC pushd $SRC
$CURL https://github.com/google/leveldb/archive/master.zip -L -O $CURL https://github.com/google/leveldb/archive/master.zip -L -O
tar zxf master.zip unzip master.zip
pushd leveldb-master pushd leveldb-master
make -j4 make -j4
cp -R out-shared/liblevel* $PREFIX/lib/ cp -R out-shared/liblevel* $PREFIX/lib/
cp -R include/leveldb $PREFIX/include/ cp -R include/leveldb $PREFIX/include/
popd popd
popd $SRC popd
fi fi
if [[ -n "$WITH_HYPERLEVELDB" && ! -e $PREFIX/lib/libhyperleveldb.so ]]; then 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 -j4
make install make install
popd popd
popd $SRC popd
fi fi
if [[ -n "$WITH_HYPERLEVELDB" && ! -e $PREFIX/include/leveldb ]]; then if [[ -n "$WITH_HYPERLEVELDB" && ! -e $PREFIX/include/leveldb ]]; then
@ -221,5 +214,11 @@ pushd $BUILD_BASE
tar zcvf imposm3-$VERSION.tar.gz imposm3-$VERSION tar zcvf imposm3-$VERSION.tar.gz imposm3-$VERSION
mkdir -p /vagrant/dist mkdir -p /vagrant/dist
mv imposm3-$VERSION.tar.gz /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 popd