Created
April 11, 2013 15:13
-
-
Save ghoulmann/5364200 to your computer and use it in GitHub Desktop.
Scripted installation of despotify on Raspberry Pi running Raspbian. Confirmed to work on Ubuntu Precise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
#use bash, be verbose | |
HOSTNAME=despotify | |
SVN_TARGET="/tmp/spotify" | |
#Check for Root | |
function check_for_root () | |
{ | |
LUID=$(id -u) | |
if [[ $LUID -ne 0 ]]; then | |
echo "$0 must be run as root" | |
exit 1 | |
fi | |
} | |
install() | |
{ | |
apt-get update | |
DEBIAN_FRONTEND=noninteractive apt-get -y \ | |
-o DPkg::Options::=--force-confdef \ | |
-o DPkg::Options::=--force-confold \ | |
install $@ | |
} | |
set_hostname() | |
{ | |
echo "$HOSTNAME" > /etc/hostname | |
sed -i "s|127.0.1.1 \(.*\)|127.0.1.1 $HOSTNAME|" /etc/hosts | |
} | |
get_from_svn() | |
{ | |
svn co https://despotify.svn.sourceforge.net/svnroot/despotify/src $SVN_TARGET | |
} | |
check_for_root | |
#set_hostname | |
install libssl-dev \ | |
zlib1g-dev \ | |
libvorbis-dev \ | |
libexpat1-dev \ | |
libncursesw5-dev \ | |
gstreamer0.10-plugins-base \ | |
libgstreamer0.10-dev \ | |
libtool \ | |
subversion \ | |
libao-dev | |
get_from_svn | |
cd $SVN_TARGET && make && make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment