summaryrefslogtreecommitdiffstats
path: root/mpd-git
diff options
context:
space:
mode:
authorFlorian Pritz <f-p@gmx.at>2009-05-05 14:03:15 +0200
committerFlorian Pritz <f-p@gmx.at>2009-05-05 14:03:15 +0200
commitaed08f01f8e6b0de458181975c14efe8b89c418f (patch)
tree3f73ca7d67c1098486ec780134d93a7888d0af0f /mpd-git
parentd0233c8e0b47beedff2c9ece475db86e1a6a9653 (diff)
downloadaur-packages-aed08f01f8e6b0de458181975c14efe8b89c418f.tar.gz
aur-packages-aed08f01f8e6b0de458181975c14efe8b89c418f.tar.xz
forgot to update some time
Diffstat (limited to 'mpd-git')
-rw-r--r--mpd-git/PKGBUILD103
-rw-r--r--mpd-git/mpd.init42
-rw-r--r--mpd-git/mpd.install27
3 files changed, 172 insertions, 0 deletions
diff --git a/mpd-git/PKGBUILD b/mpd-git/PKGBUILD
new file mode 100644
index 0000000..0364c8b
--- /dev/null
+++ b/mpd-git/PKGBUILD
@@ -0,0 +1,103 @@
+# Contributor: Slash <demodevil5[at]yahoo[dot]com>
+
+pkgname=mpd-git
+pkgver=20090425
+pkgrel=1
+pkgdesc="music daemon that plays mp3, flac, aac, mod, wav, mpc and ogg files"
+url="http://musicpd.org"
+depends=(
+ 'alsa-lib' 'audiofile' 'curl' 'faad2>=2.6.1' 'ffmpeg' 'flac>=1.1.3' 'glib2'
+ 'libao' 'libcdio' 'libid3tag' 'libmad' 'libmikmod' 'libmodplug'
+ 'libmpcdec>=1.2.5' 'libsamplerate' 'libshout' 'wavpack' 'zziplib'
+)
+makedepends=('autoconf' 'automake' 'git' 'libtool' 'pkgconfig')
+optdepends=(
+ 'avahi: Support for Avahi Zeroconf Backend'
+ 'jack-audio-connection-kit: Support for JACK Audio'
+ 'libao-pulse: Support for the PulseAudio Sound Server'
+ 'libcue: Support for embedded cuesheets'
+ 'libmms: Support for MMS Protocol'
+ 'sqlite3: Support for SQLite Database'
+)
+license=('GPL')
+arch=('i686' 'x86_64')
+conflicts=('mpd')
+provides=('mpd')
+replaces=('mpd-svn')
+install=mpd.install
+source=('mpd.init' 'mpd.install')
+md5sums=('b1fd15de359db08e4b9ae4b199640f0e'
+ '332e0a4569ace3a5854070625a04f788')
+
+_gitroot="git://git.musicpd.org/master/mpd.git"
+_gitname="mpd"
+
+build() {
+ cd $srcdir
+
+ msg "Connecting to GIT server..."
+
+ if [ -d $srcdir/$_gitname ] ; then
+ cd $_gitname && git pull origin
+ msg "The local files are updated."
+ else
+ git clone $_gitroot
+ fi
+
+ msg "GIT checkout done or server timeout"
+ msg "Starting make..."
+
+ # Copy Latest files to Build Directory
+ cp -r $srcdir/$_gitname $srcdir/$_gitname-build
+ cd $srcdir/$_gitname-build
+
+ # Configure Source
+ ./autogen.sh \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --enable-ao \
+ --enable-bzip2 \
+ --enable-iso9660 \
+ --enable-lastfm \
+ --enable-modplug \
+ --enable-zip \
+ --disable-jack \
+ --disable-pulse \
+ --with-zeroconf=no \
+ --enable-lsr
+ #--enable-cue \
+ #--enable-sqlite \
+ #--enable-mms \
+ #--enable-mvp \
+
+ # Build Source
+ make || return 1
+
+ # Install Source
+ make prefix=$pkgdir/usr install
+
+ # Remove Build Directory
+ rm -r $srcdir/$_gitname-build/
+
+ # Create Directories
+ install -d $pkgdir/var/{log/mpd,run/mpd,lib/mpd/playlists}
+
+ # Install init Script
+ install -D -m755 $srcdir/mpd.init \
+ $pkgdir/etc/rc.d/mpd
+
+ # Install Sample Config
+ install -D -m644 $srcdir/mpd/doc/mpdconf.example \
+ $pkgdir/etc/mpd.conf.example
+
+ # Modify Sample Config with Proper Directories and User Settings
+ /bin/sed -i 's|music_directory.*$|#music_directory "path_to_your_music_collection"|1' $pkgdir/etc/mpd.conf.example
+ /bin/sed -i 's|playlist_directory.*$|playlist_directory "/var/lib/mpd/playlists"|1' $pkgdir/etc/mpd.conf.example
+ /bin/sed -i 's|db_file.*$|db_file "/var/lib/mpd/mpd.db"|1' $pkgdir/etc/mpd.conf.example
+ /bin/sed -i 's|log_file.*$|log_file "/var/log/mpd/mpd.log"|1' $pkgdir/etc/mpd.conf.example
+ /bin/sed -i 's|error_file.*$|error_file "/var/log/mpd/mpd.error"|1' $pkgdir/etc/mpd.conf.example
+ /bin/sed -i 's|#pid_file.*$|pid_file "/var/run/mpd/mpd.pid"|1' $pkgdir/etc/mpd.conf.example
+ /bin/sed -i 's|#state_file.*$|state_file "/var/lib/mpd/mpdstate"|1' $pkgdir/etc/mpd.conf.example
+ /bin/sed -i 's|#user.*$|user "mpd"|1' $pkgdir/etc/mpd.conf.example
+}
+
diff --git a/mpd-git/mpd.init b/mpd-git/mpd.init
new file mode 100644
index 0000000..76ec1c0
--- /dev/null
+++ b/mpd-git/mpd.init
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy "Starting Music Player Daemon"
+ /usr/bin/mpd /etc/mpd.conf &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon mpd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Music Player Daemon"
+ /usr/bin/mpd --kill /etc/mpd.conf &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon mpd
+ stat_done
+ fi
+ ;;
+ create-db)
+ stat_busy "Creating mpd's database ..."
+ logpath="/var/log/mpd/mpd.db-creation"
+ /usr/bin/mpd --create-db /etc/mpd.conf > $logpath \
+ && stat_busy "Output written to $logpath"
+ stat_done
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart|create-db}"
+esac
+exit 0
diff --git a/mpd-git/mpd.install b/mpd-git/mpd.install
new file mode 100644
index 0000000..b9d6851
--- /dev/null
+++ b/mpd-git/mpd.install
@@ -0,0 +1,27 @@
+# arg 1: the new package version
+post_install() {
+ echo "==> mpd: Create a config under /etc/mpd.conf before using MPD (Example: /etc/mpd.conf.example)"
+ groupadd -g 45 mpd &>/dev/null
+ useradd -u 45 -g mpd -d /var/lib/mpd -s /bin/true mpd &>/dev/null
+ gpasswd -a mpd audio &>/dev/null
+ chown mpd:mpd -R /var/{lib,log,run}/mpd
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ echo "==> mpd: upgrade from 0.11 -> 0.12: configuration file syntax changed, "
+ echo "==> mpd: make sure to update your configuration file! See example conf: /etc/mpd.conf.example"
+ echo "==> mpd: If you install any of the optional dependencies, you will have to rebuild this package."
+ post_install $1
+}
+
+# arg 1: the old package version
+pre_remove() {
+ userdel mpd &>/dev/null
+}
+
+op=$1
+shift
+
+$op $*