blob: e91bb5d9789c7c4a4a9ceb6d09f597f017e23f86 [file] [log] [blame]
Andrew Geissler97771a32021-03-05 15:23:11 -06001SUMMARY = "Music Player Daemon"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
4
5LICENSE_FLAGS = "${@bb.utils.contains_any('PACKAGECONFIG', ['ffmpeg', 'aac'], 'commercial', '', d)}"
6
7HOMEPAGE ="http://www.musicpd.org"
8
9inherit meson 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.22.x \
24 file://mpd.conf.in \
25"
26SRCREV = "938728820b11d4544a071994fe3c63c6ab710e8e"
27S = "${WORKDIR}/git"
28
29EXTRA_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)}"
30
31PACKAGECONFIG ??= "aac alsa ao bzip2 daemon ffmpeg fifo flac fluidsynth iso9660 jack libsamplerate httpd mms mpg123 modplug sndfile upnp openal opus oss recorder vorbis wavpack zlib"
32
33PACKAGECONFIG[aac] = "-Dfaad=enabled,-Dfaad=disabled,faad2"
34PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib"
35PACKAGECONFIG[ao] = "-Dao=enabled,-Dao=disabled,libao"
36PACKAGECONFIG[audiofile] = "-Daudiofile=enabled,-Daudiofile=disabled,audiofile"
37PACKAGECONFIG[bzip2] = "-Dbzip2=enabled,-Dbzip2=disabled,bzip2"
38PACKAGECONFIG[cdioparanoia] = "-Dcdio_paranoia=enabled,-Dcdio_paranoia=disabled,libcdio-paranoia"
39PACKAGECONFIG[daemon] = "-Ddaemon=true,-Ddaemon=false"
40PACKAGECONFIG[ffmpeg] = "-Dffmpeg=enabled,-Dffmpeg=disabled,ffmpeg"
41PACKAGECONFIG[fifo] = "-Dfifo=true,-Dfifo=false"
42PACKAGECONFIG[flac] = "-Dflac=enabled,-Dflac=disabled,flac"
43PACKAGECONFIG[fluidsynth] = "-Dfluidsynth=enabled,-Dfluidsynth=disabled,fluidsynth"
44PACKAGECONFIG[httpd] = "-Dhttpd=true,-Dhttpd=false"
45PACKAGECONFIG[id3tag] = "-Did3tag=enabled,-Did3tag=disabled,libid3tag"
46PACKAGECONFIG[iso9660] = "-Diso9660=enabled,-Diso9660=disabled,libcdio"
47PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack"
48PACKAGECONFIG[lame] = "-Dlame=enabled,-Dlame=disabled,lame"
49PACKAGECONFIG[libsamplerate] = "-Dlibsamplerate=enabled,-Dlibsamplerate=disabled,libsamplerate0"
50PACKAGECONFIG[mad] = "-Dmad=enabled,-Dmad=disabled,libmad"
51PACKAGECONFIG[mms] = "-Dmms=enabled,-Dmms=disabled,libmms"
52PACKAGECONFIG[modplug] = "-Dmodplug=enabled,-Dmodplug=disabled,libmodplug"
53PACKAGECONFIG[mpg123] = "-Dmpg123=enabled,-Dmpg123=disabled,mpg123"
54PACKAGECONFIG[openal] = "-Dopenal=enabled,-Dopenal=disabled,openal-soft"
55PACKAGECONFIG[opus] = "-Dopus=enabled,-Dopus=disabled,libopus libogg"
56PACKAGECONFIG[oss] = "-Doss=enabled,-Doss=disabled,"
57PACKAGECONFIG[recorder] = "-Drecorder=true,-Drecorder=false"
58PACKAGECONFIG[smb] = "-Dsmbclient=enabled,-Dsmbclient=disabled,samba"
59PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1"
60PACKAGECONFIG[upnp] = "-Dupnp=enabled,-Dupnp=disabled,libupnp"
61PACKAGECONFIG[vorbis] = "-Dvorbis=enabled,-Dvorbis=disabled,libvorbis libogg"
62PACKAGECONFIG[wavpack] = "-Dwavpack=enabled,-Dwavpack=disabled,wavpack"
63PACKAGECONFIG[zlib] = "-Dzlib=enabled,-Dzlib=disabled,zlib"
64
65do_install_append() {
66 install -o mpd -d \
67 ${D}/${localstatedir}/lib/mpd \
68 ${D}/${localstatedir}/lib/mpd/playlists
69 install -m775 -o mpd -g mpd -d \
70 ${D}/${localstatedir}/lib/mpd/music
71
72 install -d ${D}/${sysconfdir}
73 install -m 644 ${WORKDIR}/mpd.conf.in ${D}/${sysconfdir}/mpd.conf
74 sed -i \
75 -e 's|%music_directory%|${localstatedir}/lib/mpd/music|' \
76 -e 's|%playlist_directory%|${localstatedir}/lib/mpd/playlists|' \
77 -e 's|%db_file%|${localstatedir}/lib/mpd/mpd.db|' \
78 -e 's|%log_file%|${localstatedir}/log/mpd.log|' \
79 -e 's|%state_file%|${localstatedir}/lib/mpd/state|' \
80 ${D}/${sysconfdir}/mpd.conf
81
82 # we don't need the icon
83 rm -rf ${D}${datadir}/icons
84}
85
86RPROVIDES_${PN} += "${PN}-systemd"
87RREPLACES_${PN} += "${PN}-systemd"
88RCONFLICTS_${PN} += "${PN}-systemd"
89SYSTEMD_SERVICE_${PN} = "mpd.socket"
90
91USERADD_PACKAGES = "${PN}"
92USERADD_PARAM_${PN} = " \
93 --system --no-create-home \
94 --home ${localstatedir}/lib/mpd \
95 --groups audio \
96 --user-group mpd"