Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [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 | alsa-lib \ |
| 10 | libsamplerate0 \ |
| 11 | libsndfile1 \ |
| 12 | libvorbis \ |
| 13 | libogg \ |
| 14 | faad2 \ |
| 15 | ffmpeg \ |
| 16 | curl \ |
| 17 | sqlite \ |
| 18 | bzip2 \ |
| 19 | ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \ |
| 20 | tcp-wrappers \ |
| 21 | openal-soft \ |
| 22 | yajl \ |
| 23 | jack \ |
| 24 | faad2 \ |
| 25 | flac \ |
| 26 | libao \ |
| 27 | fluidsynth \ |
| 28 | libcdio \ |
| 29 | wavpack \ |
| 30 | libopus \ |
| 31 | mpg123 \ |
| 32 | libmms \ |
| 33 | libmodplug \ |
| 34 | boost \ |
| 35 | icu \ |
| 36 | dbus \ |
| 37 | expat \ |
| 38 | zlib \ |
| 39 | libupnp \ |
| 40 | " |
| 41 | |
| 42 | # While this item does not require it, it depends on mpg123 which does |
| 43 | LICENSE_FLAGS = "commercial" |
| 44 | |
| 45 | SRC_URI = " \ |
| 46 | http://www.musicpd.org/download/${BPN}/0.20/${BP}.tar.xz \ |
| 47 | file://mpd.conf.in \ |
| 48 | " |
| 49 | SRC_URI[md5sum] = "8dc87ba95473fd738f2aff9bd69cc212" |
| 50 | SRC_URI[sha256sum] = "6a582dc2ae90b94ff3853f9ffd7d80b2c2b5fe2e2c35cb1da0b36f3f3dfad434" |
| 51 | |
| 52 | EXTRA_OECONF = "enable_bzip2=yes" |
| 53 | EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}" |
| 54 | |
| 55 | PACKAGECONFIG[audiofile] = "--enable-audiofile,--disable-audiofile,audiofile" |
| 56 | PACKAGECONFIG[cdioparanoia] = "--enable-cdio-paranoia,--disable-cdio-paranoia,libcdio-paranoia" |
| 57 | PACKAGECONFIG[mad] = "--enable-mad,--disable-mad,libmad" |
| 58 | PACKAGECONFIG[id3tag] = "--enable-id3,--disable-id3,libid3tag" |
| 59 | PACKAGECONFIG[lame] = "--enable-lame-encoder,--disable-lame-encoder,lame" |
| 60 | PACKAGECONFIG[smb] = "--enable-smbclient,--disable-smbclient,samba" |
| 61 | |
| 62 | do_configure_prepend() { |
| 63 | sed -i -e 's|libsystemd-daemon|libsystemd|' ${S}/configure.ac |
| 64 | } |
| 65 | |
| 66 | do_install_append() { |
| 67 | install -d ${D}/${localstatedir}/lib/mpd/music |
| 68 | chmod 775 ${D}/${localstatedir}/lib/mpd/music |
| 69 | install -d ${D}/${localstatedir}/lib/mpd/playlists |
| 70 | chown -R mpd ${D}/${localstatedir}/lib/mpd |
| 71 | chown mpd:mpd ${D}/${localstatedir}/lib/mpd/music |
| 72 | |
| 73 | install -d ${D}/${sysconfdir} |
| 74 | install -m 644 ${WORKDIR}/mpd.conf.in ${D}/${sysconfdir}/mpd.conf |
| 75 | sed -i \ |
| 76 | -e 's|%music_directory%|${localstatedir}/lib/mpd/music|' \ |
| 77 | -e 's|%playlist_directory%|${localstatedir}/lib/mpd/playlists|' \ |
| 78 | -e 's|%db_file%|${localstatedir}/lib/mpd/mpd.db|' \ |
| 79 | -e 's|%log_file%|${localstatedir}/log/mpd.log|' \ |
| 80 | -e 's|%state_file%|${localstatedir}/lib/mpd/state|' \ |
| 81 | ${D}/${sysconfdir}/mpd.conf |
| 82 | |
| 83 | if [ -e ${D}/${systemd_unitdir}/system/mpd.service ] ; then |
| 84 | sed -i \ |
| 85 | 's|^ExecStart=.*|ExecStart=${bindir}/mpd --no-daemon|' \ |
| 86 | ${D}/${systemd_unitdir}/system/mpd.service |
| 87 | fi |
| 88 | } |
| 89 | |
| 90 | RPROVIDES_${PN} += "${PN}-systemd" |
| 91 | RREPLACES_${PN} += "${PN}-systemd" |
| 92 | RCONFLICTS_${PN} += "${PN}-systemd" |
| 93 | SYSTEMD_SERVICE_${PN} = "mpd.socket" |
| 94 | |
| 95 | USERADD_PACKAGES = "${PN}" |
| 96 | USERADD_PARAM_${PN} = " \ |
| 97 | --system --no-create-home \ |
| 98 | --home ${localstatedir}/lib/mpd \ |
| 99 | --groups audio \ |
| 100 | --user-group mpd" |