Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | SUMMARY = "Music Player Daemon" |
| 2 | LICENSE = "GPLv2" |
| 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" |
| 4 | HOMEPAGE ="http://www.musicpd.org" |
| 5 | |
| 6 | inherit autotools useradd systemd pkgconfig |
| 7 | |
| 8 | DEPENDS += " \ |
| 9 | curl \ |
| 10 | sqlite3 \ |
| 11 | ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \ |
| 12 | yajl \ |
| 13 | boost \ |
| 14 | icu \ |
| 15 | dbus \ |
| 16 | expat \ |
| 17 | " |
| 18 | |
| 19 | SRC_URI = " \ |
| 20 | git://github.com/MusicPlayerDaemon/MPD;branch=v0.20.x \ |
| 21 | file://mpd.conf.in \ |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 22 | file://0001-StringBuffer-Include-cstddef-for-size_t.patch \ |
| 23 | file://0002-Include-stdexcept-for-runtime_error.patch \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 24 | " |
| 25 | SRCREV = "9274bc15bc41bbe490fde847f8422468cc20375d" |
| 26 | S = "${WORKDIR}/git" |
| 27 | |
| 28 | EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}" |
| 29 | |
| 30 | PACKAGECONFIG ??= "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 Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame] | 31 | PACKAGECONFIG_append = " ${@bb.utils.contains('LICENSE_FLAGS', 'commercial', 'aac', '', d)}" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 32 | |
| 33 | PACKAGECONFIG[aac] = "--enable-aac,--disable-aac,faad2" |
| 34 | PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib" |
| 35 | PACKAGECONFIG[ao] = "--enable-ao,--disable-ao,libao" |
| 36 | PACKAGECONFIG[audiofile] = "--enable-audiofile,--disable-audiofile,audiofile" |
| 37 | PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2" |
| 38 | PACKAGECONFIG[cdioparanoia] = "--enable-cdio-paranoia,--disable-cdio-paranoia,libcdio-paranoia" |
| 39 | PACKAGECONFIG[daemon] = "--enable-daemon,--disable-daemon" |
| 40 | PACKAGECONFIG[ffmpeg] = "--enable-ffmpeg,--disable-ffmpeg,ffmpeg" |
| 41 | PACKAGECONFIG[fifo] = "--enable-fifo,--disable-fifo" |
| 42 | PACKAGECONFIG[flac] = "--enable-flac,--disable-flac,flac" |
| 43 | PACKAGECONFIG[fluidsynth] = "--enable-fluidsynth,--disable-fluidsynth,fluidsynth" |
| 44 | PACKAGECONFIG[httpd] = "--enable-httpd-output,--disable-httpd-output" |
| 45 | PACKAGECONFIG[id3tag] = "--enable-id3,--disable-id3,libid3tag" |
| 46 | PACKAGECONFIG[iso9660] = "--enable-iso9660,--disable-iso9660,libcdio" |
| 47 | PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack" |
| 48 | PACKAGECONFIG[lame] = "--enable-lame-encoder,--disable-lame-encoder,lame" |
| 49 | PACKAGECONFIG[libsamplerate] = "--enable-lsr,--disable-lsr,libsamplerate0" |
| 50 | PACKAGECONFIG[libwrap] = "--enable-libwrap,--disable-libwrap,tcp-wrappers" |
| 51 | PACKAGECONFIG[mad] = "--enable-mad,--disable-mad,libmad" |
| 52 | PACKAGECONFIG[mms] = "--enable-mms,--disable-mms,libmms" |
| 53 | PACKAGECONFIG[modplug] = "--enable-modplug,--disable-modplug,libmodplug" |
| 54 | PACKAGECONFIG[mpg123] = "--enable-mpg123,--disable-mpg123,mpg123" |
| 55 | PACKAGECONFIG[openal] = "--enable-openal,--disable-openal,openal-soft" |
| 56 | PACKAGECONFIG[opus] = "--enable-opus,--disable-opus,libopus libogg" |
| 57 | PACKAGECONFIG[oss] = "--enable-oss,--disable-oss," |
| 58 | PACKAGECONFIG[recorder] = "--enable-recorder-output,--disable-recorder-output" |
| 59 | PACKAGECONFIG[smb] = "--enable-smbclient,--disable-smbclient,samba" |
| 60 | PACKAGECONFIG[sndfile] = "--enable-sndfile,--disable-sndfile,libsndfile1" |
| 61 | PACKAGECONFIG[upnp] = "--enable-upnp,--disable-upnp,libupnp" |
| 62 | PACKAGECONFIG[vorbis] = "--enable-vorbis,--disable-vorbis,libvorbis libogg" |
| 63 | PACKAGECONFIG[wavpack] = "--enable-wavpack,--disable-wavpack,wavpack" |
| 64 | PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib" |
| 65 | |
| 66 | do_configure_prepend() { |
| 67 | sed -i -e 's|libsystemd-daemon|libsystemd|' ${S}/configure.ac |
| 68 | } |
| 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" |