blob: b1fa96e1beeca5f29cce7d9e2ded8194ae468356 [file] [log] [blame]
Andrew Geissler97771a32021-03-05 15:23:11 -06001SUMMARY = "Music Player Daemon"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
4
Andrew Geissler97771a32021-03-05 15:23:11 -06005HOMEPAGE ="http://www.musicpd.org"
6
7inherit meson useradd systemd pkgconfig
8
9DEPENDS += " \
10 curl \
11 sqlite3 \
12 ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \
13 yajl \
14 boost \
15 icu \
16 dbus \
17 expat \
18"
19
20SRC_URI = " \
21 git://github.com/MusicPlayerDaemon/MPD;branch=v0.22.x \
22 file://mpd.conf.in \
23"
24SRCREV = "938728820b11d4544a071994fe3c63c6ab710e8e"
25S = "${WORKDIR}/git"
26
27EXTRA_OEMESON += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '-Dsystemd=enabled -Dsystemd_system_unit_dir=${systemd_system_unitdir} -Dsystemd_user_unit_dir=${systemd_system_unitdir}', '-Dsystemd=disabled', d)}"
28
Andrew Geissler32b11992021-03-31 13:37:05 -050029PACKAGECONFIG ??= "${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "aac", "", d)} \
30 alsa ao bzip2 daemon \
31 ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "ffmpeg aac", "", d)} \
32 fifo flac fluidsynth iso9660 \
33 jack libsamplerate httpd \
34 mms mpg123 modplug sndfile \
35 upnp openal opus oss recorder \
36 vorbis wavpack zlib"
Andrew Geissler97771a32021-03-05 15:23:11 -060037
38PACKAGECONFIG[aac] = "-Dfaad=enabled,-Dfaad=disabled,faad2"
39PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib"
40PACKAGECONFIG[ao] = "-Dao=enabled,-Dao=disabled,libao"
41PACKAGECONFIG[audiofile] = "-Daudiofile=enabled,-Daudiofile=disabled,audiofile"
42PACKAGECONFIG[bzip2] = "-Dbzip2=enabled,-Dbzip2=disabled,bzip2"
43PACKAGECONFIG[cdioparanoia] = "-Dcdio_paranoia=enabled,-Dcdio_paranoia=disabled,libcdio-paranoia"
44PACKAGECONFIG[daemon] = "-Ddaemon=true,-Ddaemon=false"
45PACKAGECONFIG[ffmpeg] = "-Dffmpeg=enabled,-Dffmpeg=disabled,ffmpeg"
46PACKAGECONFIG[fifo] = "-Dfifo=true,-Dfifo=false"
47PACKAGECONFIG[flac] = "-Dflac=enabled,-Dflac=disabled,flac"
48PACKAGECONFIG[fluidsynth] = "-Dfluidsynth=enabled,-Dfluidsynth=disabled,fluidsynth"
49PACKAGECONFIG[httpd] = "-Dhttpd=true,-Dhttpd=false"
50PACKAGECONFIG[id3tag] = "-Did3tag=enabled,-Did3tag=disabled,libid3tag"
51PACKAGECONFIG[iso9660] = "-Diso9660=enabled,-Diso9660=disabled,libcdio"
52PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack"
53PACKAGECONFIG[lame] = "-Dlame=enabled,-Dlame=disabled,lame"
54PACKAGECONFIG[libsamplerate] = "-Dlibsamplerate=enabled,-Dlibsamplerate=disabled,libsamplerate0"
55PACKAGECONFIG[mad] = "-Dmad=enabled,-Dmad=disabled,libmad"
56PACKAGECONFIG[mms] = "-Dmms=enabled,-Dmms=disabled,libmms"
57PACKAGECONFIG[modplug] = "-Dmodplug=enabled,-Dmodplug=disabled,libmodplug"
58PACKAGECONFIG[mpg123] = "-Dmpg123=enabled,-Dmpg123=disabled,mpg123"
59PACKAGECONFIG[openal] = "-Dopenal=enabled,-Dopenal=disabled,openal-soft"
60PACKAGECONFIG[opus] = "-Dopus=enabled,-Dopus=disabled,libopus libogg"
61PACKAGECONFIG[oss] = "-Doss=enabled,-Doss=disabled,"
62PACKAGECONFIG[recorder] = "-Drecorder=true,-Drecorder=false"
63PACKAGECONFIG[smb] = "-Dsmbclient=enabled,-Dsmbclient=disabled,samba"
64PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1"
65PACKAGECONFIG[upnp] = "-Dupnp=enabled,-Dupnp=disabled,libupnp"
66PACKAGECONFIG[vorbis] = "-Dvorbis=enabled,-Dvorbis=disabled,libvorbis libogg"
67PACKAGECONFIG[wavpack] = "-Dwavpack=enabled,-Dwavpack=disabled,wavpack"
68PACKAGECONFIG[zlib] = "-Dzlib=enabled,-Dzlib=disabled,zlib"
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"