blob: 818b9271f917a14680be1c75dd66b49c8da394a2 [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 \
Brad Bishope42b3e32020-01-15 22:08:42 -050022 file://0001-StringBuffer-Include-cstddef-for-size_t.patch \
23 file://0002-Include-stdexcept-for-runtime_error.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080024"
25SRCREV = "9274bc15bc41bbe490fde847f8422468cc20375d"
26S = "${WORKDIR}/git"
27
28EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}"
29
30PACKAGECONFIG ??= "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"
Andrew Geissler89770b02020-06-13 10:40:47 -050031PACKAGECONFIG_append = " ${@bb.utils.contains('LICENSE_FLAGS', 'commercial', 'aac', '', d)}"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080032
33PACKAGECONFIG[aac] = "--enable-aac,--disable-aac,faad2"
34PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
35PACKAGECONFIG[ao] = "--enable-ao,--disable-ao,libao"
36PACKAGECONFIG[audiofile] = "--enable-audiofile,--disable-audiofile,audiofile"
37PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
38PACKAGECONFIG[cdioparanoia] = "--enable-cdio-paranoia,--disable-cdio-paranoia,libcdio-paranoia"
39PACKAGECONFIG[daemon] = "--enable-daemon,--disable-daemon"
40PACKAGECONFIG[ffmpeg] = "--enable-ffmpeg,--disable-ffmpeg,ffmpeg"
41PACKAGECONFIG[fifo] = "--enable-fifo,--disable-fifo"
42PACKAGECONFIG[flac] = "--enable-flac,--disable-flac,flac"
43PACKAGECONFIG[fluidsynth] = "--enable-fluidsynth,--disable-fluidsynth,fluidsynth"
44PACKAGECONFIG[httpd] = "--enable-httpd-output,--disable-httpd-output"
45PACKAGECONFIG[id3tag] = "--enable-id3,--disable-id3,libid3tag"
46PACKAGECONFIG[iso9660] = "--enable-iso9660,--disable-iso9660,libcdio"
47PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
48PACKAGECONFIG[lame] = "--enable-lame-encoder,--disable-lame-encoder,lame"
49PACKAGECONFIG[libsamplerate] = "--enable-lsr,--disable-lsr,libsamplerate0"
50PACKAGECONFIG[libwrap] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
51PACKAGECONFIG[mad] = "--enable-mad,--disable-mad,libmad"
52PACKAGECONFIG[mms] = "--enable-mms,--disable-mms,libmms"
53PACKAGECONFIG[modplug] = "--enable-modplug,--disable-modplug,libmodplug"
54PACKAGECONFIG[mpg123] = "--enable-mpg123,--disable-mpg123,mpg123"
55PACKAGECONFIG[openal] = "--enable-openal,--disable-openal,openal-soft"
56PACKAGECONFIG[opus] = "--enable-opus,--disable-opus,libopus libogg"
57PACKAGECONFIG[oss] = "--enable-oss,--disable-oss,"
58PACKAGECONFIG[recorder] = "--enable-recorder-output,--disable-recorder-output"
59PACKAGECONFIG[smb] = "--enable-smbclient,--disable-smbclient,samba"
60PACKAGECONFIG[sndfile] = "--enable-sndfile,--disable-sndfile,libsndfile1"
61PACKAGECONFIG[upnp] = "--enable-upnp,--disable-upnp,libupnp"
62PACKAGECONFIG[vorbis] = "--enable-vorbis,--disable-vorbis,libvorbis libogg"
63PACKAGECONFIG[wavpack] = "--enable-wavpack,--disable-wavpack,wavpack"
64PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib"
65
66do_configure_prepend() {
67 sed -i -e 's|libsystemd-daemon|libsystemd|' ${S}/configure.ac
68}
69
70do_install_append() {
71 install -o mpd -d \
72 ${D}/${localstatedir}/lib/mpd \
73 ${D}/${localstatedir}/lib/mpd/playlists
74 install -m775 -o mpd -g mpd -d \
75 ${D}/${localstatedir}/lib/mpd/music
76
77 install -d ${D}/${sysconfdir}
78 install -m 644 ${WORKDIR}/mpd.conf.in ${D}/${sysconfdir}/mpd.conf
79 sed -i \
80 -e 's|%music_directory%|${localstatedir}/lib/mpd/music|' \
81 -e 's|%playlist_directory%|${localstatedir}/lib/mpd/playlists|' \
82 -e 's|%db_file%|${localstatedir}/lib/mpd/mpd.db|' \
83 -e 's|%log_file%|${localstatedir}/log/mpd.log|' \
84 -e 's|%state_file%|${localstatedir}/lib/mpd/state|' \
85 ${D}/${sysconfdir}/mpd.conf
86
87 # we don't need the icon
88 rm -rf ${D}${datadir}/icons
89}
90
91RPROVIDES_${PN} += "${PN}-systemd"
92RREPLACES_${PN} += "${PN}-systemd"
93RCONFLICTS_${PN} += "${PN}-systemd"
94SYSTEMD_SERVICE_${PN} = "mpd.socket"
95
96USERADD_PACKAGES = "${PN}"
97USERADD_PARAM_${PN} = " \
98 --system --no-create-home \
99 --home ${localstatedir}/lib/mpd \
100 --groups audio \
101 --user-group mpd"