summaryrefslogtreecommitdiffstats
path: root/mpd-git/PKGBUILD
blob: b607e5a5deaeb13ea10d15f262881b468140dd06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Contributor: Slash <demodevil5[at]yahoo[dot]com>

pkgname=mpd-git
pkgver=20100111
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
}