2015-04-14 12:36:29 +00:00
|
|
|
#! /usr/bin/env bash
|
2014-11-04 14:36:49 +00:00
|
|
|
|
|
|
|
FAKE_ROOT=/home/vagrant/fake.root
|
|
|
|
|
2016-02-28 19:40:26 +00:00
|
|
|
SRC_VERSION=$1
|
|
|
|
|
2014-11-04 16:51:45 +00:00
|
|
|
mkdir -p ~/github
|
|
|
|
|
2014-11-04 14:36:49 +00:00
|
|
|
cd ~/github
|
|
|
|
if ! test -d lnav; then
|
|
|
|
git clone git://github.com/tstack/lnav.git
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd ~/github/lnav
|
|
|
|
git pull
|
2016-02-28 19:40:26 +00:00
|
|
|
|
|
|
|
if test -n "$SRC_VERSION"; then
|
|
|
|
git checkout $SRC_VERSION
|
|
|
|
fi
|
|
|
|
|
2015-04-05 22:44:51 +00:00
|
|
|
saved_PATH=${PATH}
|
2015-04-17 07:48:46 +00:00
|
|
|
export PATH=${FAKE_ROOT}/bin:${PATH}
|
|
|
|
saved_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
|
|
|
|
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${FAKE_ROOT}/lib
|
2015-04-05 22:44:51 +00:00
|
|
|
./autogen.sh
|
|
|
|
export PATH=${saved_PATH}
|
2015-04-17 07:48:46 +00:00
|
|
|
export LD_LIBRARY_PATH=${saved_LD_LIBRARY_PATH}
|
2014-11-04 14:36:49 +00:00
|
|
|
|
|
|
|
rm -rf ~/github/lbuild
|
|
|
|
mkdir -p ~/github/lbuild
|
|
|
|
|
|
|
|
cd ~/github/lbuild
|
|
|
|
|
2015-04-14 12:36:29 +00:00
|
|
|
OS=$(uname -s)
|
|
|
|
if test x"${OS}" != x"FreeBSD"; then
|
|
|
|
../lnav/configure \
|
|
|
|
LDFLAGS="-L${FAKE_ROOT}/lib" \
|
2016-07-29 03:03:43 +00:00
|
|
|
CC="gcc48" \
|
|
|
|
CXX="g++48" \
|
2015-10-15 02:52:22 +00:00
|
|
|
CPPFLAGS="-I${FAKE_ROOT}/include" \
|
|
|
|
PATH="${FAKE_ROOT}/bin:${PATH}"
|
2015-04-14 12:36:29 +00:00
|
|
|
else
|
|
|
|
../lnav/configure \
|
|
|
|
LDFLAGS="-L${FAKE_ROOT}/lib" \
|
2015-10-15 02:52:22 +00:00
|
|
|
CPPFLAGS="-I${FAKE_ROOT}/include" \
|
|
|
|
PATH="${FAKE_ROOT}/bin:${PATH}"
|
2015-04-14 12:36:29 +00:00
|
|
|
fi
|
|
|
|
|
2014-11-04 14:36:49 +00:00
|
|
|
make -j2 && strip -o /vagrant/lnav src/lnav
|
2016-02-28 19:40:26 +00:00
|
|
|
|
2016-07-29 03:23:13 +00:00
|
|
|
if test x"${OS}" != x"FreeBSD"; then
|
|
|
|
mkdir instdir
|
|
|
|
make install-strip DESTDIR=$PWD/instdir
|
|
|
|
(cd instdir/ && zip -r /vagrant/lnav-linux.zip .)
|
|
|
|
fi
|