]>
Commit | Line | Data |
---|---|---|
1 | # TODO: | |
2 | # - add logrotate | |
3 | # | |
4 | # Conditional build: | |
5 | %bcond_without mod # MOD support via libmikmod | |
6 | %bcond_without pulseaudio # PulseAudio support | |
7 | %bcond_without audiofile # Audiofile support (WAV and others) | |
8 | ||
9 | Summary: Music Player Daemon | |
10 | Summary(pl.UTF-8): Music Player Daemon - demon odtwarzający muzykę | |
11 | Name: mpd | |
12 | Version: 0.23.9 | |
13 | Release: 1 | |
14 | License: GPL v2+ | |
15 | Group: Applications/Multimedia | |
16 | Source0: https://www.musicpd.org/download/mpd/0.23/%{name}-%{version}.tar.xz | |
17 | # Source0-md5: aeb8382c5d7795ed8dfd02fe14f81f06 | |
18 | Source1: %{name}.conf | |
19 | Source2: %{name}.init | |
20 | Source3: %{name}.sysconfig | |
21 | Source4: %{name}.tmpfiles | |
22 | URL: http://www.musicpd.org/ | |
23 | BuildRequires: OpenAL-devel | |
24 | BuildRequires: adplug-devel | |
25 | BuildRequires: alsa-lib-devel >= 0.9.0 | |
26 | %{?with_audiofile:BuildRequires: audiofile-devel >= 0.3} | |
27 | BuildRequires: avahi-devel | |
28 | BuildRequires: boost-devel >= 1.58 | |
29 | BuildRequires: bzip2-devel | |
30 | BuildRequires: curl-devel >= 7.33 | |
31 | BuildRequires: dbus-devel | |
32 | BuildRequires: doxygen | |
33 | BuildRequires: expat-devel | |
34 | BuildRequires: faad2-devel >= 2.6.1-5 | |
35 | BuildRequires: ffmpeg-devel >= 2.4.0 | |
36 | BuildRequires: flac-devel >= 1.2.0 | |
37 | BuildRequires: fluidsynth-devel >= 1.1 | |
38 | BuildRequires: game-music-emu-devel | |
39 | BuildRequires: gcc >= 6:8 | |
40 | BuildRequires: glib2-devel >= 1:2.28.0 | |
41 | BuildRequires: jack-audio-connection-kit-devel >= 0.100 | |
42 | BuildRequires: lame-libs-devel | |
43 | BuildRequires: libao-devel >= 0.8.3 | |
44 | BuildRequires: libcdio-devel | |
45 | BuildRequires: libcdio-paranoia-devel >= 0.93 | |
46 | BuildRequires: libchromaprint-devel | |
47 | BuildRequires: libfmt-devel | |
48 | BuildRequires: libicu-devel >= 50 | |
49 | BuildRequires: libid3tag-devel | |
50 | BuildRequires: libmad-devel | |
51 | %{?with_mod:BuildRequires: libmikmod-devel >= 3.2} | |
52 | BuildRequires: libmms-devel >= 0.4 | |
53 | BuildRequires: libmodplug-devel | |
54 | BuildRequires: libmpdclient-devel >= 2.11 | |
55 | BuildRequires: libmpg123-devel >= 1.28.0 | |
56 | BuildRequires: libnfs-devel >= 1.11 | |
57 | BuildRequires: libogg-devel | |
58 | BuildRequires: libopenmpt-devel >= 0.5 | |
59 | BuildRequires: libsamplerate-devel >= 0.1.3 | |
60 | BuildRequires: libshout-devel >= 2.4.6 | |
61 | BuildRequires: libsidplayfp-devel >= 1.8 | |
62 | BuildRequires: libsmbclient-devel >= 0.2 | |
63 | BuildRequires: libsndfile-devel | |
64 | BuildRequires: libstdc++-devel | |
65 | BuildRequires: libupnp-devel >= 1.8 | |
66 | BuildRequires: liburing-devel | |
67 | BuildRequires: libvorbis-devel | |
68 | BuildRequires: meson >= 0.56.0 | |
69 | BuildRequires: musepack-devel | |
70 | BuildRequires: ninja | |
71 | BuildRequires: opus-devel | |
72 | BuildRequires: pcre-devel | |
73 | BuildRequires: pipewire-devel >= 0.3 | |
74 | BuildRequires: pkgconfig >= 1:0.9.0 | |
75 | %{?with_pulseaudio:BuildRequires: pulseaudio-devel >= 0.9.16} | |
76 | BuildRequires: rpm-build >= 4.6 | |
77 | BuildRequires: rpmbuild(macros) >= 2.011 | |
78 | BuildRequires: shine-devel >= 3.1 | |
79 | BuildRequires: soxr-devel | |
80 | BuildRequires: sphinx-pdg | |
81 | BuildRequires: sqlite3-devel >= 3.7.3 | |
82 | BuildRequires: systemd-devel | |
83 | BuildRequires: tar >= 1:1.22 | |
84 | BuildRequires: twolame-devel | |
85 | BuildRequires: wavpack-devel | |
86 | BuildRequires: wildmidi-devel | |
87 | BuildRequires: xmlto | |
88 | BuildRequires: xz | |
89 | BuildRequires: yajl-devel >= 2.0 | |
90 | BuildRequires: zlib-devel | |
91 | BuildRequires: zziplib-devel >= 0.13 | |
92 | Requires(post,preun,postun): systemd-units >= 1:250.1 | |
93 | Requires: alsa-lib >= 0.9.0 | |
94 | %{?with_audiofile:Requires: audiofile >= 0.3} | |
95 | Requires: curl-libs >= 7.33 | |
96 | Requires: faad2-libs >= 2.6.1-5 | |
97 | Requires: ffmpeg-libs >= 2.4.0 | |
98 | Requires: flac >= 1.2.0 | |
99 | Requires: fluidsynth >= 1.1 | |
100 | Requires: glib2 >= 1:2.28.0 | |
101 | Requires: jack-audio-connection-kit-libs >= 0.100 | |
102 | Requires: libao >= 0.8.3 | |
103 | Requires: libcdio-paranoia >= 0.93 | |
104 | Requires: libicu >= 50 | |
105 | %{?with_mod:Requires: libmikmod >= 3.2} | |
106 | Requires: libmms >= 0.4 | |
107 | Requires: libmpdclient >= 2.11 | |
108 | Requires: libmpg123 >= 1.28.0 | |
109 | Requires: libnfs >= 1.11 | |
110 | Requires: libopenmpt >= 0.5 | |
111 | Requires: libsamplerate >= 0.1.3 | |
112 | Requires: libshout >= 2.4.6 | |
113 | Requires: libsidplayfp >= 1.8 | |
114 | Requires: libsmbclient >= 0.2 | |
115 | Requires: libupnp >= 1.8 | |
116 | Requires: pipewire-libs >= 0.3 | |
117 | %{?with_pulseaudio:Requires: pulseaudio-libs >= 0.9.16} | |
118 | Requires: shine >= 3.1 | |
119 | Requires: sqlite3 >= 3.7.3 | |
120 | Requires: systemd-units >= 1:250.1 | |
121 | Requires: yajl >= 2.0 | |
122 | Requires: zziplib >= 0.13 | |
123 | Suggests: %{name}-icons | |
124 | Provides: group(mpd) | |
125 | Provides: user(mpd) | |
126 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
127 | ||
128 | %description | |
129 | Music Player Daemon (MPD) allows remote access for playing music (MP3, | |
130 | Ogg Vorbis, FLAC, AAC, Mod, and wave files) and managing playlists. | |
131 | MPD is designed for integrating a computer into a stereo system that | |
132 | provides control for music playback over a local network. It is also | |
133 | makes a great desktop music player, especially if you are a console | |
134 | junkie, like frontend options, or restart X often. | |
135 | ||
136 | %description -l hu.UTF-8 | |
137 | Music Player Daemon (MPD)-vel lehetővé válik távoli zenelejátszás | |
138 | (MP3, Ogg Vorbis, FLAC, AAC, Mod és wav fájlok) és lejátszási listák | |
139 | menedzselése. Az MPD a számítógépben egy zenelejátszó, amelyet | |
140 | irányíthatsz helyi hálózaton keresztül. Egyben egy zseniális desktop | |
141 | zenelejátszó is, különösen a konzol-mániásoknak, vagy azoknak, akik | |
142 | sűrűn indítják újra az X-et. | |
143 | ||
144 | %description -l pl.UTF-8 | |
145 | Music Player Daemon (MPD) pozwala na zdalny dostęp do odtwarzania | |
146 | muzyki (plików MP3, Ogg Vorbis, FLAC, AAC, Mod i wave) oraz | |
147 | zarządzania playlistami. MPD jest zaprojektowany do integrowania | |
148 | komputera w system stereo umożliwiający sterowanie odtwarzaniem muzyki | |
149 | w sieci lokalnej. Służy także za dobry odtwarzacz muzyki dla | |
150 | komputerów biurkowych, zwłaszcza dla miłośników konsoli, różnych opcji | |
151 | frontendów albo często restartujących X. | |
152 | ||
153 | %package doc | |
154 | Summary: Documentation for Music Player Daemon (MPD) | |
155 | Summary(fr.UTF-8): Documentation pour Music Player Daemon (MPD) | |
156 | Summary(it.UTF-8): Documentazione di Music Player Daemon (MPD) | |
157 | Summary(pl.UTF-8): Podręcznik dla Music Player Daemon (MPD) | |
158 | Group: Documentation | |
159 | Obsoletes: mpd-apidocs < 0.21 | |
160 | ||
161 | %description doc | |
162 | Documentation for Music Player Daemon (MPD). | |
163 | ||
164 | %description doc -l fr.UTF-8 | |
165 | Documentation pour Music Player Daemon (MPD). | |
166 | ||
167 | %description doc -l it.UTF-8 | |
168 | Documentazione di Music Player Daemon (MPD). | |
169 | ||
170 | %description doc -l pl.UTF-8 | |
171 | Dokumentacja do Music Player Daemon (MPD). | |
172 | ||
173 | %package icons | |
174 | Summary: Icon files for Music Player Daemon (MPD) | |
175 | Summary(pl.UTF-8): Pliki ikon dla Music Player Daemon (MPD) | |
176 | Group: Applications | |
177 | Requires(post,postun): gtk-update-icon-cache | |
178 | Requires: hicolor-icon-theme | |
179 | BuildArch: noarch | |
180 | ||
181 | %description icons | |
182 | Documentation for Music Player Daemon (MPD). | |
183 | ||
184 | %description icons -l pl.UTF-8 | |
185 | Pliki ikon dla Music Player Daemon (MPD). | |
186 | ||
187 | %prep | |
188 | %setup -q | |
189 | ||
190 | %build | |
191 | %meson build \ | |
192 | -Dpulse=%{?with_pulseaudio:enabled}%{!?with_pulseaudio:disabled} \ | |
193 | -Dmikmod=%{?with_mod:enabled}%{!?with_mod:disabled} \ | |
194 | -Dadplug=enabled \ | |
195 | -Dalsa=enabled \ | |
196 | -Dao=enabled \ | |
197 | -Daudiofile=%{?with_audiofile:enabled}%{!?with_audiofile:disabled} \ | |
198 | -Dbzip2=enabled \ | |
199 | -Dcdio_paranoia=enabled \ | |
200 | -Dcurl=enabled \ | |
201 | -Ddatabase=true \ | |
202 | -Ddocumentation=enabled \ | |
203 | -Ddsd=true \ | |
204 | -Dexpat=enabled \ | |
205 | -Dffmpeg=enabled \ | |
206 | -Dfifo=true \ | |
207 | -Dflac=enabled \ | |
208 | -Dfluidsynth=enabled \ | |
209 | -Dgme=enabled \ | |
210 | -Dhttpd=true \ | |
211 | -Dicu=enabled \ | |
212 | -Did3tag=enabled \ | |
213 | -Dinotify=true \ | |
214 | -Dio_uring=enabled \ | |
215 | -Dipv6=enabled \ | |
216 | -Diso9660=enabled \ | |
217 | -Djack=enabled \ | |
218 | -Dlame=enabled \ | |
219 | -Dlibmpdclient=enabled \ | |
220 | -Dmad=enabled \ | |
221 | -Dmikmod=enabled \ | |
222 | -Dmms=enabled \ | |
223 | -Dmodplug=enabled \ | |
224 | -Dmpcdec=disabled \ | |
225 | -Dnfs=enabled \ | |
226 | -Dopenal=enabled \ | |
227 | -Dopus=enabled \ | |
228 | -Doss=enabled \ | |
229 | -Dpipe=true \ | |
230 | -Drecorder=true \ | |
231 | -Dsidplay=enabled \ | |
232 | -Dshine=enabled \ | |
233 | -Dshout=enabled \ | |
234 | -Dsmbclient=enabled \ | |
235 | -Dsndfile=enabled \ | |
236 | -Dsoundcloud=enabled \ | |
237 | -Dsoxr=enabled \ | |
238 | -Dsqlite=enabled \ | |
239 | -Ddaemon=true \ | |
240 | -Dsystemd=enabled \ | |
241 | -Dtcp=true \ | |
242 | -Dtwolame=enabled \ | |
243 | -Dupnp=pupnp \ | |
244 | -Dvorbis=enabled \ | |
245 | -Dvorbisenc=enabled \ | |
246 | -Dwave_encoder=true \ | |
247 | -Dwavpack=enabled \ | |
248 | -Dwildmidi=enabled \ | |
249 | -Dzlib=enabled \ | |
250 | -Dzzip=enabled \ | |
251 | -Dzeroconf=avahi \ | |
252 | -Dsystemd_system_unit_dir=%{systemdunitdir} \ | |
253 | -Dsystemd_user_unit_dir=%{systemduserunitdir} | |
254 | %ninja_build -C build | |
255 | ||
256 | %install | |
257 | rm -rf $RPM_BUILD_ROOT | |
258 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig}} \ | |
259 | $RPM_BUILD_ROOT{/var/lib/mpd/playlists,/var/log/mpd,/var/run/mpd} \ | |
260 | $RPM_BUILD_ROOT%{systemdtmpfilesdir} | |
261 | ||
262 | %ninja_install -C build | |
263 | ||
264 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir} | |
265 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mpd | |
266 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/mpd | |
267 | cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf | |
268 | ||
269 | touch $RPM_BUILD_ROOT/var/lib/mpd/mpd.db | |
270 | touch $RPM_BUILD_ROOT/var/lib/mpd/mpdstate | |
271 | touch $RPM_BUILD_ROOT/var/lib/mpd/sticker.sql | |
272 | touch $RPM_BUILD_ROOT/var/log/mpd/mpd.log | |
273 | ||
274 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/mpd | |
275 | ||
276 | %clean | |
277 | rm -rf $RPM_BUILD_ROOT | |
278 | ||
279 | %pre | |
280 | %groupadd -g 204 mpd | |
281 | %useradd -u 204 -r -d /var/lib/mpd -s /bin/false -c "Music Player Daemon (MPD) user" -G audio -g mpd mpd | |
282 | ||
283 | %post | |
284 | for f in mpd.log; do | |
285 | if [ ! -f /var/log/%{name}/$f ]; then | |
286 | touch /var/log/%{name}/$f | |
287 | chown mpd:mpd /var/log/%{name}/$f | |
288 | chmod 644 /var/log/%{name}/$f | |
289 | fi | |
290 | done | |
291 | /sbin/chkconfig --add mpd | |
292 | %systemd_post %{name}.service %{name}.socket | |
293 | %systemd_user_post %{name}.service %{name}.socket | |
294 | ||
295 | %post icons | |
296 | %update_icon_cache hicolor | |
297 | ||
298 | %preun | |
299 | if [ "$1" = "0" ]; then | |
300 | %service mpd stop | |
301 | /sbin/chkconfig --del mpd | |
302 | fi | |
303 | %systemd_preun %{name}.service %{name}.socket | |
304 | %systemd_user_preun %{name}.service %{name}.socket | |
305 | ||
306 | %postun | |
307 | if [ "$1" = "0" ]; then | |
308 | %userremove mpd | |
309 | %groupremove mpd | |
310 | fi | |
311 | %systemd_reload | |
312 | ||
313 | %postun icons | |
314 | %update_icon_cache hicolor | |
315 | ||
316 | %triggerpostun -- %{name} < 0.16.6-1 | |
317 | %systemd_trigger %{name}.service | |
318 | ||
319 | %files | |
320 | %defattr(644,root,root,755) | |
321 | %doc AUTHORS NEWS README.md doc/mpdconf.example | |
322 | %attr(755,root,root) %{_bindir}/* | |
323 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mpd.conf | |
324 | %attr(754,root,root) /etc/rc.d/init.d/mpd | |
325 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mpd | |
326 | %{systemdtmpfilesdir}/%{name}.conf | |
327 | %{systemdunitdir}/mpd.service | |
328 | %{systemdunitdir}/mpd.socket | |
329 | %{systemduserunitdir}/mpd.service | |
330 | %{systemduserunitdir}/mpd.socket | |
331 | %dir %attr(770,root,mpd) /var/lib/%{name} | |
332 | %dir %attr(770,root,mpd) /var/lib/%{name}/playlists | |
333 | %dir %attr(751,root,root) /var/log/%{name} | |
334 | %dir %attr(770,root,mpd) /var/run/%{name} | |
335 | %attr(644,mpd,mpd) %ghost /var/lib/%{name}/mpd.db | |
336 | %attr(644,mpd,mpd) %ghost /var/lib/%{name}/mpdstate | |
337 | %attr(644,mpd,mpd) %ghost /var/lib/%{name}/sticker.sql | |
338 | %attr(644,mpd,mpd) %ghost /var/log/%{name}/mpd.log | |
339 | %{_mandir}/man1/mpd.1* | |
340 | %{_mandir}/man5/mpd.conf.5* | |
341 | ||
342 | %files doc | |
343 | %defattr(644,root,root,755) | |
344 | %doc build/doc/html | |
345 | ||
346 | %files icons | |
347 | %defattr(644,root,root,755) | |
348 | %{_iconsdir}/hicolor/scalable/apps/mpd.svg |