%bcond_without pulse %bcond_without sqlite Name: mpd Version: 0.16.7 Release: 22%{?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.init Source2: audio_group.txt Source3: 95-grant-audio-devices-to-mpd.fdi 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-lib-devel} %{?with_sqlite:BuildRequires: sqlite-devel} BuildRequires: twolame-devel BuildRequires: wavpack-devel BuildRequires: wildmidi-devel BuildRequires: zlib-devel BuildRequires: zziplib-devel Requires(pre): shadow-utils Requires(post): chkconfig Requires(preun): chkconfig /sbin/service Requires(postun): /sbin/service %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 cp %{SOURCE2} $RPM_BUILD_DIR/%{name}-%{version}/audio_group.txt # 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 --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} # 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 install -p -m644 doc/mpdconf.example %{buildroot}%{_sysconfdir}/mpd.conf %{__sed} -i -e "s,~/.mpd,%{_localstatedir}/lib/%{name},g" %{buildroot}%{_sysconfdir}/mpd.conf %{__sed} -e "s,@bindir@,%{_bindir},g;s,@var@,%{_localstatedir},g" %{SOURCE1} > %{buildroot}%{_initrddir}/%{name} %{__sed} -i -e "s,daemon \$mpd,daemon \$mpd %{_sysconfdir}/mpd.conf,g" %{buildroot}%{_initrddir}/%{name} install -p -m644 %{SOURCE3} %{buildroot}%{_datadir}/hal/fdi/policy/20thirdparty 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 /sbin/chkconfig --add %{name} %preun if [ "$1" -eq "0" ]; then /sbin/service %{name} stop > /dev/null 2>&1 || : /sbin/chkconfig --del %{name} fi %postun if [ "$1" -ge "1" ]; then /sbin/service %{name} condrestart > /dev/null 2>&1 || : fi %files %defattr(-,root,root,-) %doc README UPGRADING NEWS AUTHORS COPYING audio_group.txt %{_bindir}/%name %config(noreplace) %{_sysconfdir}/mpd.conf %attr(755,root,root) %{_initrddir}/%{name} %{_datadir}/hal/fdi/policy/20thirdparty/*fdi %{_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 %changelog * 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)