# Conditional build:
%bcond_without mod # enable MOD support
%bcond_without pulseaudio # disable PulseAudio support
+%bcond_without audiofile # Audiofile support (WAV and others)
Summary: Music Player Daemon
Summary(hu.UTF-8): Music Player Daemon
Summary(pl.UTF-8): Music Player Daemon - demon odtwarzajÄ…cy muzykÄ™
Name: mpd
-Version: 0.16.3
-Release: 4
+Version: 0.17.2
+Release: 1
License: GPL v2+
Group: Applications/Multimedia
Source0: http://downloads.sourceforge.net/musicpd/%{name}-%{version}.tar.bz2
-# Source0-md5: 6e708c02b0e8c288aec855eecf441a5a
+# Source0-md5: 52a5e9ccd37dc94231e80083dcb82d91
Source1: %{name}.conf
Source2: %{name}.init
Source3: %{name}.sysconfig
+Source4: %{name}.tmpfiles
URL: http://www.musicpd.org/
-Patch0: %{name}-ffmpeg_sigsegv.patch
BuildRequires: OpenAL-devel
BuildRequires: alsa-lib-devel >= 0.9.0
-BuildRequires: audiofile-devel >= 0.1.7
+%{?with_audiofile:BuildRequires: audiofile-devel >= 0.1.7}
BuildRequires: avahi-glib-devel
BuildRequires: bzip2-devel
BuildRequires: curl-devel
BuildRequires: libogg-devel
BuildRequires: libsamplerate-devel >= 0.0.15
BuildRequires: libshout-devel
+BuildRequires: libsidplay2-devel >= 2.1.1-5
BuildRequires: libvorbis-devel
BuildRequires: pkgconfig >= 1:0.9.0
%{?with_pulseaudio:BuildRequires: pulseaudio-devel}
+BuildRequires: rpmbuild(macros) >= 1.629-2
BuildRequires: sqlite3-devel
BuildRequires: twolame-devel
BuildRequires: wavpack-devel
BuildRequires: xmlto
BuildRequires: zlib-devel
BuildRequires: zziplib-devel
+Requires(post,preun,postun): systemd-units >= 38
+Requires: systemd-units >= 38
Provides: group(mpd)
Provides: user(mpd)
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%prep
%setup -q
-%patch0 -p1
%build
# ac_cv_* hacks to avoid unwanted linking
ac_cv_lib_nsl_gethostbyname=no \
%{!?with_pulseaudio:--disable-pulse} \
%{?with_mod:--enable-mikmod} \
- --disable-sidplay \
+ --enable-sidplay \
--enable-alsa \
--enable-ao \
- --enable-audiofile \
+ %{?with_audiofile:--enable-audiofile} \
--enable-bzip2 \
--enable-cue \
--enable-curl \
--enable-wildmidi \
--enable-zzip \
--with-zeroconf=avahi \
- --without-tremor
+ --without-tremor \
+ --with-systemdsystemunitdir=%{systemdunitdir}
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig}} \
- $RPM_BUILD_ROOT{/var/lib/mpd/playlists,/var/log/mpd,/var/run/mpd}
+ $RPM_BUILD_ROOT{/var/lib/mpd/playlists,/var/log/mpd,/var/run/mpd} \
+ $RPM_BUILD_ROOT%{systemdtmpfilesdir}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}
install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mpd
cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/mpd
+install %{SOURCE4} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
touch $RPM_BUILD_ROOT/var/lib/mpd/mpd.db
touch $RPM_BUILD_ROOT/var/lib/mpd/mpdstate
%pre
%groupadd -g 204 mpd
-%useradd -u 204 -r -d /home/services/mpd -s /bin/false -c "Music Player Daemon (MPD) user" -G audio -g mpd mpd
+%useradd -u 204 -r -d /var/lib/mpd -s /bin/false -c "Music Player Daemon (MPD) user" -G audio -g mpd mpd
%post
for f in mpd.log; do
fi
done
/sbin/chkconfig --add mpd
+%systemd_post %{name}.service
%preun
if [ "$1" = "0" ]; then
%service mpd stop
/sbin/chkconfig --del mpd
fi
+%systemd_preun %{name}.service
%postun
if [ "$1" = "0" ]; then
%userremove mpd
%groupremove mpd
fi
+%systemd_reload
+
+%triggerpostun -- %{name} < 0.16.6-1
+%systemd_trigger %{name}.service
%files
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mpd.conf
%attr(754,root,root) /etc/rc.d/init.d/mpd
%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mpd
+%{systemdtmpfilesdir}/%{name}.conf
+%{systemdunitdir}/mpd.service
%dir %attr(770,root,mpd) /var/lib/%{name}
%dir %attr(770,root,mpd) /var/lib/%{name}/playlists
%dir %attr(751,root,root) /var/log/%{name}