blob: 6c6ad423754b04f927066dff813266eb11cc0ba4 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001SUMMARY = "Music Player Daemon"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
4HOMEPAGE ="http://www.musicpd.org"
5
6inherit autotools useradd systemd pkgconfig
7
8DEPENDS += " \
9 curl \
10 sqlite3 \
11 ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \
12 yajl \
13 boost \
14 icu \
15 dbus \
16 expat \
17"
18
19SRC_URI = " \
20 git://github.com/MusicPlayerDaemon/MPD;branch=v0.20.x \
21 file://mpd.conf.in \
22"
23SRCREV = "9274bc15bc41bbe490fde847f8422468cc20375d"
24S = "${WORKDIR}/git"
25
26EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}"
27
28PACKAGECONFIG ??= "alsa ao bzip2 daemon ffmpeg fifo flac fluidsynth iso9660 jack libsamplerate libwrap httpd mms mpg123 modplug sndfile upnp openal opus oss recorder vorbis wavpack zlib"
29PACKAGECONFIG += "${@bb.utils.contains('LICENSE_FLAGS', 'commercial', 'aac', '', d)}"
30
31PACKAGECONFIG[aac] = "--enable-aac,--disable-aac,faad2"
32PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
33PACKAGECONFIG[ao] = "--enable-ao,--disable-ao,libao"
34PACKAGECONFIG[audiofile] = "--enable-audiofile,--disable-audiofile,audiofile"
35PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
36PACKAGECONFIG[cdioparanoia] = "--enable-cdio-paranoia,--disable-cdio-paranoia,libcdio-paranoia"
37PACKAGECONFIG[daemon] = "--enable-daemon,--disable-daemon"
38PACKAGECONFIG[ffmpeg] = "--enable-ffmpeg,--disable-ffmpeg,ffmpeg"
39PACKAGECONFIG[fifo] = "--enable-fifo,--disable-fifo"
40PACKAGECONFIG[flac] = "--enable-flac,--disable-flac,flac"
41PACKAGECONFIG[fluidsynth] = "--enable-fluidsynth,--disable-fluidsynth,fluidsynth"
42PACKAGECONFIG[httpd] = "--enable-httpd-output,--disable-httpd-output"
43PACKAGECONFIG[id3tag] = "--enable-id3,--disable-id3,libid3tag"
44PACKAGECONFIG[iso9660] = "--enable-iso9660,--disable-iso9660,libcdio"
45PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
46PACKAGECONFIG[lame] = "--enable-lame-encoder,--disable-lame-encoder,lame"
47PACKAGECONFIG[libsamplerate] = "--enable-lsr,--disable-lsr,libsamplerate0"
48PACKAGECONFIG[libwrap] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
49PACKAGECONFIG[mad] = "--enable-mad,--disable-mad,libmad"
50PACKAGECONFIG[mms] = "--enable-mms,--disable-mms,libmms"
51PACKAGECONFIG[modplug] = "--enable-modplug,--disable-modplug,libmodplug"
52PACKAGECONFIG[mpg123] = "--enable-mpg123,--disable-mpg123,mpg123"
53PACKAGECONFIG[openal] = "--enable-openal,--disable-openal,openal-soft"
54PACKAGECONFIG[opus] = "--enable-opus,--disable-opus,libopus libogg"
55PACKAGECONFIG[oss] = "--enable-oss,--disable-oss,"
56PACKAGECONFIG[recorder] = "--enable-recorder-output,--disable-recorder-output"
57PACKAGECONFIG[smb] = "--enable-smbclient,--disable-smbclient,samba"
58PACKAGECONFIG[sndfile] = "--enable-sndfile,--disable-sndfile,libsndfile1"
59PACKAGECONFIG[upnp] = "--enable-upnp,--disable-upnp,libupnp"
60PACKAGECONFIG[vorbis] = "--enable-vorbis,--disable-vorbis,libvorbis libogg"
61PACKAGECONFIG[wavpack] = "--enable-wavpack,--disable-wavpack,wavpack"
62PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib"
63
64do_configure_prepend() {
65 sed -i -e 's|libsystemd-daemon|libsystemd|' ${S}/configure.ac
66}
67
68do_install_append() {
69 install -o mpd -d \
70 ${D}/${localstatedir}/lib/mpd \
71 ${D}/${localstatedir}/lib/mpd/playlists
72 install -m775 -o mpd -g mpd -d \
73 ${D}/${localstatedir}/lib/mpd/music
74
75 install -d ${D}/${sysconfdir}
76 install -m 644 ${WORKDIR}/mpd.conf.in ${D}/${sysconfdir}/mpd.conf
77 sed -i \
78 -e 's|%music_directory%|${localstatedir}/lib/mpd/music|' \
79 -e 's|%playlist_directory%|${localstatedir}/lib/mpd/playlists|' \
80 -e 's|%db_file%|${localstatedir}/lib/mpd/mpd.db|' \
81 -e 's|%log_file%|${localstatedir}/log/mpd.log|' \
82 -e 's|%state_file%|${localstatedir}/lib/mpd/state|' \
83 ${D}/${sysconfdir}/mpd.conf
84
85 # we don't need the icon
86 rm -rf ${D}${datadir}/icons
87}
88
89RPROVIDES_${PN} += "${PN}-systemd"
90RREPLACES_${PN} += "${PN}-systemd"
91RCONFLICTS_${PN} += "${PN}-systemd"
92SYSTEMD_SERVICE_${PN} = "mpd.socket"
93
94USERADD_PACKAGES = "${PN}"
95USERADD_PARAM_${PN} = " \
96 --system --no-create-home \
97 --home ${localstatedir}/lib/mpd \
98 --groups audio \
99 --user-group mpd"