Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 1 | SUMMARY = "Music Player Daemon" |
| 2 | LICENSE = "GPL-2.0-only" |
| 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" |
| 4 | |
| 5 | HOMEPAGE ="http://www.musicpd.org" |
| 6 | |
| 7 | inherit meson useradd systemd pkgconfig |
| 8 | |
| 9 | DEPENDS += " \ |
| 10 | curl \ |
| 11 | sqlite3 \ |
| 12 | ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \ |
| 13 | yajl \ |
| 14 | boost \ |
| 15 | icu \ |
| 16 | dbus \ |
| 17 | expat \ |
| 18 | fmt \ |
| 19 | " |
| 20 | |
| 21 | SRC_URI = "git://github.com/MusicPlayerDaemon/MPD;branch=v0.23.x;protocol=https \ |
| 22 | file://mpd.conf.in \ |
| 23 | " |
| 24 | SRCREV = "f591193ddaa7f9bcb6c85ff5899517fc7b53e35a" |
| 25 | S = "${WORKDIR}/git" |
| 26 | |
| 27 | EXTRA_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 | |
| 29 | PACKAGECONFIG ??= "${@bb.utils.contains("LICENSE_FLAGS_ACCEPTED", "commercial", "aac", "", d)} \ |
| 30 | alsa ao bzip2 daemon \ |
| 31 | ${@bb.utils.contains("LICENSE_FLAGS_ACCEPTED", "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" |
| 37 | |
| 38 | PACKAGECONFIG[aac] = "-Dfaad=enabled,-Dfaad=disabled,faad2" |
| 39 | PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib" |
| 40 | PACKAGECONFIG[ao] = "-Dao=enabled,-Dao=disabled,libao" |
| 41 | PACKAGECONFIG[audiofile] = "-Daudiofile=enabled,-Daudiofile=disabled,audiofile" |
| 42 | PACKAGECONFIG[bzip2] = "-Dbzip2=enabled,-Dbzip2=disabled,bzip2" |
| 43 | PACKAGECONFIG[cdioparanoia] = "-Dcdio_paranoia=enabled,-Dcdio_paranoia=disabled,libcdio-paranoia" |
| 44 | PACKAGECONFIG[daemon] = "-Ddaemon=true,-Ddaemon=false" |
| 45 | PACKAGECONFIG[ffmpeg] = "-Dffmpeg=enabled,-Dffmpeg=disabled,ffmpeg" |
| 46 | PACKAGECONFIG[fifo] = "-Dfifo=true,-Dfifo=false" |
| 47 | PACKAGECONFIG[flac] = "-Dflac=enabled,-Dflac=disabled,flac" |
| 48 | PACKAGECONFIG[fluidsynth] = "-Dfluidsynth=enabled,-Dfluidsynth=disabled,fluidsynth" |
| 49 | PACKAGECONFIG[httpd] = "-Dhttpd=true,-Dhttpd=false" |
| 50 | PACKAGECONFIG[id3tag] = "-Did3tag=enabled,-Did3tag=disabled,libid3tag" |
| 51 | PACKAGECONFIG[iso9660] = "-Diso9660=enabled,-Diso9660=disabled,libcdio" |
| 52 | PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack" |
| 53 | PACKAGECONFIG[lame] = "-Dlame=enabled,-Dlame=disabled,lame" |
| 54 | PACKAGECONFIG[libsamplerate] = "-Dlibsamplerate=enabled,-Dlibsamplerate=disabled,libsamplerate0" |
| 55 | PACKAGECONFIG[mad] = "-Dmad=enabled,-Dmad=disabled,libmad" |
| 56 | PACKAGECONFIG[mms] = "-Dmms=enabled,-Dmms=disabled,libmms" |
| 57 | PACKAGECONFIG[modplug] = "-Dmodplug=enabled,-Dmodplug=disabled,libmodplug" |
| 58 | PACKAGECONFIG[mpg123] = "-Dmpg123=enabled,-Dmpg123=disabled,mpg123" |
| 59 | PACKAGECONFIG[openal] = "-Dopenal=enabled,-Dopenal=disabled,openal-soft" |
| 60 | PACKAGECONFIG[opus] = "-Dopus=enabled,-Dopus=disabled,libopus libogg" |
| 61 | PACKAGECONFIG[oss] = "-Doss=enabled,-Doss=disabled," |
| 62 | PACKAGECONFIG[recorder] = "-Drecorder=true,-Drecorder=false" |
| 63 | PACKAGECONFIG[smb] = "-Dsmbclient=enabled,-Dsmbclient=disabled,samba" |
| 64 | PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1" |
| 65 | PACKAGECONFIG[upnp] = "-Dupnp=pupnp,-Dupnp=disabled,libupnp" |
| 66 | PACKAGECONFIG[vorbis] = "-Dvorbis=enabled,-Dvorbis=disabled,libvorbis libogg" |
| 67 | PACKAGECONFIG[wavpack] = "-Dwavpack=enabled,-Dwavpack=disabled,wavpack" |
| 68 | PACKAGECONFIG[zlib] = "-Dzlib=enabled,-Dzlib=disabled,zlib" |
| 69 | |
| 70 | do_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 | |
| 91 | RPROVIDES:${PN} += "${PN}-systemd" |
| 92 | RREPLACES:${PN} += "${PN}-systemd" |
| 93 | RCONFLICTS:${PN} += "${PN}-systemd" |
| 94 | SYSTEMD_SERVICE:${PN} = "mpd.socket" |
| 95 | |
| 96 | USERADD_PACKAGES = "${PN}" |
| 97 | USERADD_PARAM:${PN} = " \ |
| 98 | --system --no-create-home \ |
| 99 | --home ${localstatedir}/lib/mpd \ |
| 100 | --groups audio \ |
| 101 | --user-group mpd" |