1 |
%define build_plf 0 |
2 |
%if "%{?distro_section}" == "tainted" |
3 |
%define build_plf 1 |
4 |
%endif |
5 |
|
6 |
Name: mpd |
7 |
Version: 0.17.3 |
8 |
Release: %mkrel 5 |
9 |
|
10 |
Summary: MPD, the Music Player Daemon |
11 |
License: GPLv2+ |
12 |
Group: Sound/Players |
13 |
Url: http://www.musicpd.org/ |
14 |
Source0: http://downloads.sourceforge.net/musicpd/%{name}-%{version}.tar.bz2 |
15 |
Source1: %{name}.conf |
16 |
Source2: %{name}.init |
17 |
Source3: %{name}.logrotate |
18 |
Source4: README.urpmi |
19 |
|
20 |
Requires(post): systemd >= %{systemd_required_version} |
21 |
Requires(post): rpm-helper >= 0.24.8-1 |
22 |
Requires(preun): rpm-helper >= 0.24.8-1 |
23 |
BuildRequires: pkgconfig(alsa) >= 0.9.0 |
24 |
BuildRequires: pkgconfig(ao) |
25 |
BuildRequires: pkgconfig(audiofile) >= 0.1.7 |
26 |
BuildRequires: pkgconfig(avahi-client) |
27 |
BuildRequires: pkgconfig(avahi-glib) |
28 |
BuildRequires: pkgconfig(flac) >= 1.1 |
29 |
BuildRequires: pkgconfig(fluidsynth) >= 1.1 |
30 |
BuildRequires: pkgconfig(glib-2.0) >= 2.16 |
31 |
BuildRequires: pkgconfig(gthread-2.0) |
32 |
BuildRequires: pkgconfig(id3tag) |
33 |
BuildRequires: pkgconfig(jack) >= 0.100 |
34 |
BuildRequires: pkgconfig(libavcodec) >= 52.20 |
35 |
BuildRequires: pkgconfig(libavformat) >= 52.31 |
36 |
BuildRequires: pkgconfig(libavutil) >= 49.15 |
37 |
BuildRequires: pkgconfig(libcdio_paranoia) |
38 |
BuildRequires: pkgconfig(libcurl) |
39 |
BuildRequires: pkgconfig(libffado) |
40 |
BuildRequires: pkgconfig(libiso9660) |
41 |
BuildRequires: pkgconfig(libmms) >= 0.4 |
42 |
BuildRequires: pkgconfig(libmodplug) |
43 |
BuildRequires: pkgconfig(libmpg123) |
44 |
BuildRequires: pkgconfig(libpulse) |
45 |
BuildRequires: pkgconfig(libsidplay2) |
46 |
BuildRequires: pkgconfig(libsidutils) |
47 |
BuildRequires: pkgconfig(libsoup-2.4) |
48 |
BuildRequires: pkgconfig(libsystemd-daemon) |
49 |
BuildRequires: pkgconfig(mad) |
50 |
BuildRequires: pkgconfig(ogg) |
51 |
BuildRequires: pkgconfig(openal) |
52 |
BuildRequires: pkgconfig(samplerate) >= 0.0.15 |
53 |
BuildRequires: pkgconfig(shout) |
54 |
BuildRequires: pkgconfig(sndfile) |
55 |
BuildRequires: pkgconfig(sqlite3) |
56 |
BuildRequires: pkgconfig(vorbis) |
57 |
BuildRequires: pkgconfig(vorbisenc) |
58 |
BuildRequires: pkgconfig(vorbisfile) |
59 |
BuildRequires: pkgconfig(wavpack) |
60 |
BuildRequires: pkgconfig(yajl) >= 2.0 |
61 |
BuildRequires: pkgconfig(zziplib) >= 0.13 |
62 |
BuildRequires: libmpcdec-devel |
63 |
%if %build_plf |
64 |
BuildRequires: libfaad2-devel |
65 |
BuildRequires: lame-devel |
66 |
%endif |
67 |
|
68 |
%description |
69 |
Music Player Daemon (MPD) allows remote access for playing music (MP3, Ogg |
70 |
Vorbis, FLAC, Mod, and wave files) and managing playlists. MPD is designed |
71 |
for integrating a computer into a stereo system that provides control for music |
72 |
playback over a local network. It is also makes a great desktop music player, |
73 |
especially if your a console junkie, like frontend options, or restart X often. |
74 |
%if %build_plf |
75 |
This package is in the 'tainted' section because it is built with AAC support |
76 |
of libfaad2. |
77 |
%endif |
78 |
|
79 |
%prep |
80 |
%setup -q |
81 |
|
82 |
%build |
83 |
%configure2_5x --with-systemdsystemunitdir=%_unitdir |
84 |
%make |
85 |
|
86 |
%install |
87 |
%makeinstall_std |
88 |
|
89 |
mkdir -p %{buildroot}/var/lib/mpd |
90 |
touch %{buildroot}/%{_localstatedir}/lib/mpd/mpd.db |
91 |
touch %{buildroot}/%{_localstatedir}/lib/mpd/mpdstate |
92 |
mkdir -p %{buildroot}/var/log/mpd |
93 |
touch %{buildroot}/var/log/mpd/mpd.log |
94 |
touch %{buildroot}/var/log/mpd/mpd.error |
95 |
mkdir -p %{buildroot}/%{_localstatedir}/lib/mpd/playlists |
96 |
mkdir -p %{buildroot}/%{_localstatedir}/lib/mpd/music |
97 |
|
98 |
install -D %{SOURCE1} %{buildroot}/etc/mpd.conf |
99 |
install -D %{SOURCE2} %{buildroot}/%{_initrddir}/%{name} |
100 |
install -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} |
101 |
install %{SOURCE4} doc/README.urpmi |
102 |
rm -rf %{buildroot}/%{_docdir}/mpd |
103 |
|
104 |
mkdir -p %{buildroot}%{_tmpfilesdir} |
105 |
cat <<EOF > %{buildroot}%{_tmpfilesdir}/%{name}.conf |
106 |
d /run/mpd 0755 mpd audio |
107 |
EOF |
108 |
|
109 |
%pre |
110 |
%_pre_useradd %name %{_localstatedir}/lib/%{name} /bin/false |
111 |
usermod -g audio %{name} |
112 |
|
113 |
%post |
114 |
%_tmpfilescreate %{name} |
115 |
if [ $1 -eq 1 ] |
116 |
then |
117 |
%create_ghostfile %{_localstatedir}/lib/mpd/mpd.db mpd audio 644 |
118 |
%create_ghostfile %{_localstatedir}/lib/mpd/mpdstate mpd audio 644 |
119 |
%create_ghostfile /var/log/mpd/mpd.log mpd audio 644 |
120 |
%create_ghostfile /var/log/mpd/mpd.error mpd audio 644 |
121 |
fi |
122 |
#echo If you want to run mpd as a service, please read |
123 |
#echo /usr/share/doc/mpd-%%{version}/README.MDK |
124 |
%_post_service %{name} |
125 |
|
126 |
%preun |
127 |
%_preun_service %{name} |
128 |
|
129 |
%postun |
130 |
%_postun_userdel %{name} |
131 |
|
132 |
%files |
133 |
%doc README UPGRADING AUTHORS NEWS doc/mpdconf.example doc/*.urpmi |
134 |
%{_bindir}/%{name} |
135 |
%{_mandir}/man1/* |
136 |
%{_mandir}/man5/* |
137 |
%{_unitdir}/* |
138 |
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} |
139 |
%attr(-,mpd,root) %config(noreplace) %{_sysconfdir}/%{name}.conf |
140 |
%config(noreplace) %{_initrddir}/%{name} |
141 |
%{_tmpfilesdir}/%{name}.conf |
142 |
%defattr(644,mpd,audio) |
143 |
%attr(755,mpd,audio) %dir %{_localstatedir}/lib/mpd |
144 |
%attr(755,mpd,audio) %dir %{_localstatedir}/lib/mpd/music |
145 |
%attr(755,mpd,audio) %dir %{_localstatedir}/lib/mpd/playlists |
146 |
%ghost %{_localstatedir}/lib/mpd/mpd.db |
147 |
%ghost %{_localstatedir}/lib/mpd/mpdstate |
148 |
%attr(755,mpd,audio) %dir /var/log/mpd |
149 |
%ghost /var/log/mpd/mpd.log |
150 |
%ghost /var/log/mpd/mpd.error |