mpd_0.19.1.bb 2.38 KB
Newer Older
1
SUMMARY = "Music Player Daemon"
Andreas Müller's avatar
Andreas Müller committed
2 3
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
4
HOMEPAGE ="http://www.musicpd.org"
Andreas Müller's avatar
Andreas Müller committed
5

Cristian Iorga's avatar
Cristian Iorga committed
6
DEPENDS = "alsa-lib libsamplerate0 libsndfile1 libvorbis libogg faad2 ffmpeg curl sqlite bzip2 pulseaudio tcp-wrappers openal-soft yajl jack faad2 flac libao fluidsynth libcdio wavpack libopus mpg123 libmms libmodplug boost icu dbus expat zlib"
Andreas Müller's avatar
Andreas Müller committed
7 8

SRC_URI = " \
Cristian Iorga's avatar
Cristian Iorga committed
9
    http://www.musicpd.org/download/${BPN}/0.19/${BP}.tar.xz \
Andreas Müller's avatar
Andreas Müller committed
10 11
    file://mpd.conf.in \
"
Cristian Iorga's avatar
Cristian Iorga committed
12 13
SRC_URI[md5sum] = "d235f6e53e5442b6926c49946a303f8d"
SRC_URI[sha256sum] = "8b3afcd440181c9bd18b229b5974e529d59648344dd371370d6f7d62ec2847c5"
Andreas Müller's avatar
Andreas Müller committed
14

15
inherit autotools useradd systemd
Andreas Müller's avatar
Andreas Müller committed
16 17

EXTRA_OECONF = "enable_bzip2=yes"
18
EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}"
Andreas Müller's avatar
Andreas Müller committed
19

20 21 22
PACKAGECONFIG[mad] = "--enable-mad,--disable-mad,libmad"
PACKAGECONFIG[id3tag] = "--enable-id3,--disable-id3,libid3tag"
PACKAGECONFIG[lame] = "--enable-lame-encoder,--disable-lame-encoder,lame"
23
PACKAGECONFIG[smb] = "--enable-smbclient,--disable-smbclient,samba"
24

Andreas Müller's avatar
Andreas Müller committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
do_install_append() {
    install -d ${D}/${localstatedir}/lib/mpd/music
    chmod 775 ${D}/${localstatedir}/lib/mpd/music
    install -d ${D}/${localstatedir}/lib/mpd/playlists
    chown -R mpd ${D}/${localstatedir}/lib/mpd
    chown mpd:mpd ${D}/${localstatedir}/lib/mpd/music

    install -d ${D}/${sysconfdir}
    install -m 644 ${WORKDIR}/mpd.conf.in ${D}/${sysconfdir}/mpd.conf
    sed -i \
        -e 's|%music_directory%|${localstatedir}/lib/mpd/music|' \
        -e 's|%playlist_directory%|${localstatedir}/lib/mpd/playlists|' \
        -e 's|%db_file%|${localstatedir}/lib/mpd/mpd.db|' \
        -e 's|%log_file%|${localstatedir}/log/mpd.log|' \
        -e 's|%state_file%|${localstatedir}/lib/mpd/state|' \
        ${D}/${sysconfdir}/mpd.conf
41 42 43 44 45 46

    if [ -e ${D}/${systemd_unitdir}/system/mpd.service ] ; then
        sed -i \
            's|^ExecStart=.*|ExecStart=${bindir}/mpd --no-daemon|' \
            ${D}/${systemd_unitdir}/system/mpd.service
    fi
Andreas Müller's avatar
Andreas Müller committed
47 48
}

49 50 51
RPROVIDES_${PN} += "${PN}-systemd"
RREPLACES_${PN} += "${PN}-systemd"
RCONFLICTS_${PN} += "${PN}-systemd"
Ash Charles's avatar
Ash Charles committed
52
SYSTEMD_SERVICE_${PN} = "mpd.service mpd.socket"
53

Andreas Müller's avatar
Andreas Müller committed
54 55 56 57 58 59
USERADD_PACKAGES = "${PN}"
USERADD_PARAM_${PN} = " \
    --system --no-create-home \
    --home ${localstatedir}/lib/mpd \
    --groups audio \
    --user-group mpd"