%bcond_without pulse %bcond_without sqlite Name: mpd Version: 0.17.3 Release: 26.1%{?dist} Summary: The Music Player Daemon License: GPLv2 Group: Applications/Multimedia URL: http://mpd.wikia.com/ Source0: http://downloads.sourceforge.net/musicpd/%{name}-%{version}.tar.bz2 Source1: mpd.service BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: alsa-lib-devel BuildRequires: audiofile-devel BuildRequires: avahi-glib-devel BuildRequires: bzip2-devel BuildRequires: faad2-devel BuildRequires: ffmpeg-devel BuildRequires: flac-devel BuildRequires: fluidsynth-devel BuildRequires: jack-audio-connection-kit-devel BuildRequires: libao-devel BuildRequires: curl-devel BuildRequires: libcdio-devel BuildRequires: libffado-devel BuildRequires: libid3tag-devel BuildRequires: libmad-devel BuildRequires: libmms-devel BuildRequires: libmodplug-devel BuildRequires: musepack-tools-devel BuildRequires: libmusicbrainz-devel BuildRequires: libogg-devel BuildRequires: libsamplerate-devel BuildRequires: libsidplay-devel BuildRequires: libshout-devel BuildRequires: libvorbis-devel BuildRequires: mikmod-devel BuildRequires: mpg123-devel # Network access without authentication should be # enabled for pulse (paprefs) %{?with_pulse:BuildRequires: pulseaudio-libs-devel} %{?with_sqlite:BuildRequires: sqlite-devel} BuildRequires: systemd-units BuildRequires: twolame-devel BuildRequires: wavpack-devel BuildRequires: wildmidi-devel BuildRequires: zlib-devel BuildRequires: zziplib-devel Requires(pre): shadow-utils Requires(post): chkconfig, systemd-units Requires(preun): chkconfig, initscripts, systemd-units Requires(postun): initscripts, systemd-units %description Music Player Daemon (MPD) is a flexible, powerful, server-side application for playing music. Through plugins and libraries it can play a variety of sound files while being controlled by its network protocol. %prep %setup -q # Avoid standard rpaths on lib64 archs: sed -i -e 's|"/lib /usr/lib\b|"/%{_lib} %{_libdir}|' configure %{_bindir}/iconv -f iso8859-1 -t utf8 AUTHORS -o AUTHORS.txt mv AUTHORS.txt AUTHORS %build %configure \ --with-systemdsystemunitdir=%{_unitdir} \ --enable-wildmidi \ --enable-fluidsynth \ --enable-mikmod \ --enable-bzip2 \ %{?with_pulse:--enable-pulse} \ %{!?with_sqlite:--disable-sqlite} \ --enable-zip \ --enable-iso9660 \ --enable-pipe-output \ --enable-lastfm make %{?_smp_mflags} %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} install -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service # conf file mkdir -p %{buildroot}%{_sysconfdir} mkdir -p %{buildroot}%{_initrddir} mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}/playlists mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}/music mkdir -p %{buildroot}%{_datadir}/hal/fdi/policy/20thirdparty touch %{buildroot}%{_localstatedir}/lib/%{name}/log touch %{buildroot}%{_localstatedir}/lib/%{name}/database touch %{buildroot}%{_localstatedir}/lib/%{name}/state install -p -m644 doc/mpdconf.example %{buildroot}%{_sysconfdir}/mpd.conf %{__sed} -i -e "s,~/.mpd,%{_localstatedir}/lib/%{name},g" %{buildroot}%{_sysconfdir}/mpd.conf rm -rf %{buildroot}/%{_docdir}/%{name}/ %clean rm -rf %{buildroot} %pre #creating mpd user getent group %{name} >/dev/null || groupadd -r %{name} getent passwd %{name} >/dev/null || \ /usr/sbin/useradd -r -g %{name} -d %{_localstatedir}/lib/%{name} -s /sbin/nologin \ -c "Music Player Daemon" %{name} exit 0 %if %{with pulse} # add mpd to audio group if [ `/usr/bin/getent group audio` ]; then usermod -aG audio mpd fi # add mpd to pulse-rt group if [ `/usr/bin/getent group pulse-rt` ]; then usermod -aG pulse-rt mpd fi %endif %post # register mpd service if [ $1 -eq 1 ]; then /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi %triggerun -- mpd < 0.16.8 if /sbin/chkconfig --level 3 mpd; then /bin/systemctl enable mpd.service >/dev/null 2>&1 || : fi /sbin/chkconfig --del mpd >/dev/null 2>&1 || : /bin/systemctl try-restart mpd.service >/dev/null 2>&1 || : %preun if [ $1 -eq 0 ]; then /bin/systemctl --no-reload disable mpd.service >/dev/null 2>&1 || : /bin/systemctl stop mpd.service >/dev/null 2>&1 || : fi %postun /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ]; then /bin/systemctl try-restart mpd.service >/dev/null 2>&1 || : fi %files %defattr(-,root,root,-) %doc README UPGRADING NEWS AUTHORS COPYING %{_bindir}/%name %{_unitdir}/mpd.service %config(noreplace) %{_sysconfdir}/mpd.conf %{_mandir}/man1/* %{_mandir}/man5/* %dir %attr(-,mpd,mpd) %{_localstatedir}/lib/%{name} %attr(-,mpd,mpd) %{_localstatedir}/lib/%{name}/playlists %attr(-,mpd,mpd) %{_localstatedir}/lib/%{name}/music %attr(-,mpd,mpd) %ghost %{_localstatedir}/lib/%{name}/log %attr(-,mpd,mpd) %ghost %{_localstatedir}/lib/%{name}/database %attr(-,mpd,mpd) %ghost %{_localstatedir}/lib/%{name}/state %changelog * Fri Feb 08 2013 Paulo Roma 0.17.3-26 - Updated to 0.17.3 * Sun Oct 07 2012 Paulo Roma 0.17.2-25 - Updated to 0.17.2 - Removed Sources 2 and 3. * Mon Jul 30 2012 Paulo Roma 0.17-24 - Updated to 0.17 * Thu Jul 05 2012 Paulo Roma 0.16.8-23 - Updated to 0.16.8 - Using systemd. * Wed Mar 14 2012 Paulo Roma 0.16.7-22 - Updated to 0.16.7 * Fri Dec 09 2011 Paulo Roma 0.16.6-21 - Updated to 0.16.6 * Wed Sep 07 2011 Paulo Roma 0.16.4-20 - Updated to 0.16.4 Fixed ffmpeg bug ... * Mon Jun 27 2011 Paulo Roma 0.16.3-19 - Updated to 0.16.3 - Replaced libmpcdec-devel for musepack-tools-devel. * Sun May 15 2011 Paulo Roma 0.16.2-18 - Updated to 0.16.2 * Sun Jan 23 2011 Paulo Roma 0.16.1-17 - Updated to 0.16.1 - Removed paprefs Req (not available on RHLE6). * Mon Dec 20 2010 Paulo Roma 0.16-16 - Updated to 0.16 - Fixed mpd user creation. - Added BRs mpg123-devel, libffado-devel, and twolame-devel. * Sun Nov 21 2010 Paulo Roma 0.15.15-15 - Updated to 0.15.15 * Mon Nov 15 2010 Paulo Roma 0.15.14-15 - Updated to 0.15.14 * Sun Aug 01 2010 Paulo Roma 0.15.12-14 - Updated to 0.15.12 * Fri Jun 04 2010 Paulo Roma 0.15.10-13 - Updated to 0.15.10 - Changed description. * Sun Apr 11 2010 Paulo Roma 0.15.9-12 - Updated to 0.15.9 * Sat Feb 06 2010 Paulo Roma 0.15.8-12 - Updated to 0.15.8 * Fri Jan 08 2010 Paulo Roma 0.15.7-12 - Updated to 0.15.7 * Wed Dec 03 2009 Paulo Roma 0.15.6-12 - Adding mpd to audio group in Fedora 12. * Wed Dec 02 2009 Paulo Roma 0.15.6-11 - Updated to 0.15.6 - Dropped lastfm patch. - Fedora 12 does not have a pulse-rt group. Using pulse-access. * Sat Nov 07 2009 Paulo Roma 0.15.5-10 - Updated to 0.15.5 * Sun Sep 06 2009 Paulo Roma 0.15.3-10 - Updated to 0.15.3 * Sat Aug 15 2009 Paulo Roma 0.15.1-10 - Updated to 0.15.1 - Added BR sqlite-devel. * Mon Jul 13 2009 Paulo Roma 0.15-9 - Created option --without pulse. - Patched lastfm for F8. * Sat Jul 04 2009 Paulo Roma 0.15-8 - Updated to 0.15 - Removed TODO. - Added BR wildmidi-devel, libmms-devel, libmodplug-devel bzip2-devel, libsidplay-devel, fluidsynth-devel, zziplib-devel, libmusicbrainz-devel, libcdio-devel. - Changed BR avahi-devel for avahi-glib-devel. - Enabled several options in config. * Fri Mar 27 2009 Paulo Roma 0.14.2-7 - Added mpd to pulse-rt group. - Installed 20thirdparty hal rule. - Updated URL. * Sun Mar 22 2009 Paulo Roma 0.14.2-6 - Updated to 0.14.2 - Updated doc. - Added BRs ffmpeg-devel, curl-devel and wavpack-devel. * Tue Jul 01 2008 Paulo Roma 0.13.2-5 - Updated to 0.13.2 - Converted AUTHORS to utf8. - Removed service-default-enabled warning. * Fri Feb 15 2008 Paulo Roma 0.13.1-4 - Updated to 0.13.1 - Removed rpath from binary. - Fixed ownership of status files. - Added missing BRs. - Passing config file for mpd daemon. * Thu Apr 09 2007 Paulo Roma 0.13.0-3 - Updated to 0.13.0 * Thu Apr 09 2007 Paulo Roma 0.12.2-3 - Updated to 0.12.2 * Thu Jan 04 2007 Paulo Roma 0.12.1-3 - Rebuilt to get rid of undefined symbol: AudioSpecificConfig - Removed all livna crap. - Included audio_group.txt * Mon Nov 27 2006 Adrian Reber - 0.12.1-1 - updated to 0.12.1 - added missing Requires - removed deletion of user mpd during %%preun - removed -m (create home) from useradd * Wed Oct 11 2006 Adrian Reber - 0.11.6-6 - rebuilt * Tue Mar 21 2006 Andreas Bierfert - Add missing BR zlib-devel * Thu Mar 09 2006 Andreas Bierfert - switch to new release field * Mon Mar 06 2006 Thorsten Leemhuis - no build time defines anymore so adapt spec completely to livna * Tue Feb 28 2006 Andreas Bierfert - add dist * Sun Nov 28 2004 Aurelien Bompard 0:0.11.5-0.fdr.3 - Apply Adrian Reber's patch to use a system-wide daemon, see bug 2234 * Tue Nov 09 2004 Aurelien Bompard 0:0.11.5-0.fdr.2 - Prepare for FC3 (different BuildRequires) * Fri Nov 05 2004 Aurelien Bompard 0:0.11.5-0.fdr.1 - Initial Fedora package (from Mandrake)