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