Skip to content

Instantly share code, notes, and snippets.

@till
Created November 15, 2011 22:14
Show Gist options
  • Save till/1368555 to your computer and use it in GitHub Desktop.
Save till/1368555 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Debug:
#set -x
OS=`uname -s`
case $OS in
FreeBSD)
if test ! -f /usr/local/bin/pear
then
if test ! -d /usr/ports
then
portsnap fetch extract
else
portsnap fetch update
fi
cd /usr/ports/devel/pear-PEAR && make install distclean && rehash
fi
if test ! -f /usr/local/bin/git
then
pkg_add -r git && rehash
fi
;;
Linux)
DISTRO=`uname -n`
case $DISTRO in
"debian"|"ubuntu")
apt-get update && apt-get install -y php-pear git
;;
*)
echo "Please add support for $OS/$DISTRO"
exit 2
;;
esac
;;
*)
echo "Unsupported OS $OS"
exit 1
;;
esac
# upgrade to the latest release in case the package managers are behind
pear upgrade-all > /dev/null
if test -d /tmp/pear-core
then
rm -rf /tmp/pear-core
fi
git clone --quiet git://git.php.net/pear-core.git /tmp/pear-core
cd /tmp/pear-core/tests && pear run-tests *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment