Skip to content

Instantly share code, notes, and snippets.

@mildred
Last active August 29, 2015 14:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mildred/4e32276fc197395f0f81 to your computer and use it in GitHub Desktop.
Save mildred/4e32276fc197395f0f81 to your computer and use it in GitHub Desktop.
Install geard from source
#!/bin/sh
#See: https://aur.archlinux.org/packages/ge/geard-git/PKGBUILD
set -e
: ${PREFIX:=/usr/local}
mkdir -p $PREFIX/src/geard.go
cd $PREFIX/src/geard.go
export GOPATH="$PWD"
mkdir -p src/github.com/openshift
git clone https://github.com/openshift/geard.git src/github.com/openshift/geard || true
src/github.com/openshift/geard/contrib/build -n -l
sed "s:/usr/bin:$PREFIX/bin:g" src/github.com/openshift/geard/contrib/geard.service >geard.service
set -x
install -d $PREFIX/stow/geard/lib/systemd/system/ $PREFIX/stow/geard/bin/
#for binfile in bin/*; do
# install -Dm755 $binfile $PREFIX/stow/geard/bin/${binfile##*/}
#done
install -Dm755 bin/gear $PREFIX/stow/geard/bin/gear
install -Dm755 bin/switchns $PREFIX/stow/geard/bin/switchns
install -Dm755 bin/sti $PREFIX/stow/geard/bin/sti
install -Dm755 bin/gear-auth-keys-command $PREFIX/stow/geard/sbin/gear-auth-keys-command
install -Dm644 geard.service $PREFIX/stow/geard/lib/systemd/system/
if [ -e /bin/systemctl ] && ! [ -e /usr/bin/systemctl ]; then
ln -sf /bin/systemctl $PREFIX/stow/geard/bin/systemctl
fi
set +x
find $PREFIX/stow/geard
cd $PREFIX/stow
stow -R geard
echo "systemctl enable geard.service"
echo "systemctl start geard.service"
echo "systemctl status geard.service"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment