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