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