Don't break setup when no sudo

element
Marcin Kulik 9 years ago
parent 440cc1cb21
commit f8d28b4b7c

@ -2,30 +2,32 @@
set -e set -e
sudo apt-get install -y autoconf libtool pkg-config if sudo apt-get install -y autoconf libtool pkg-config; then
if [ ! -e /usr/local/lib/libtsm.a ]; then
echo "libtsm missing, compiling from source..."
DIR=$(mktemp -d -t tsmXXXXXX)
cd $DIR
git clone git://people.freedesktop.org/~dvdhrm/libtsm .
git checkout libtsm-3
test -f ./configure || NOCONFIGURE=1 ./autogen.sh
./configure --prefix=/usr/local
make
sudo make install
sudo ldconfig
cd -
fi
if [ ! -e /usr/local/lib/libtsm.a ]; then if [ -e /usr/local/lib/libtsm.a ]; then
echo "libtsm missing, compiling from source..." cd src && make && cd -
DIR=$(mktemp -d -t tsmXXXXXX) fi
cd $DIR else
git clone git://people.freedesktop.org/~dvdhrm/libtsm . echo "warning: sudo failed, not compiling libtsm and terminal binary"
git checkout libtsm-3
test -f ./configure || NOCONFIGURE=1 ./autogen.sh
./configure --prefix=/usr/local
make
sudo make install
sudo ldconfig
cd -
fi fi
if [ ! -e config/database.yml ]; then if [ ! -e config/database.yml ]; then
cp config/database.yml.example config/database.yml cp config/database.yml.example config/database.yml
fi fi
if [ -e /usr/local/lib/libtsm.a ]; then
cd src && make && cd -
fi
rm -f log/* rm -f log/*
bundle install bundle install
bundle exec rake db:setup bundle exec rake db:setup

Loading…
Cancel
Save