]> git.pld-linux.org Git - packages/mpd.git/blob - mpd.spec
d1ce4d6be9c382a35e11a5107282b91b0bd6a919
[packages/mpd.git] / mpd.spec
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 URL:            http://www.musicpd.org/
24 BuildRequires:  OpenAL-devel
25 BuildRequires:  adplug-devel
26 BuildRequires:  alsa-lib-devel >= 0.9.0
27 %{?with_audiofile:BuildRequires:        audiofile-devel >= 0.3}
28 BuildRequires:  avahi-devel
29 BuildRequires:  boost-devel >= 1.58
30 BuildRequires:  bzip2-devel
31 BuildRequires:  curl-devel >= 7.33
32 BuildRequires:  dbus-devel
33 BuildRequires:  doxygen
34 BuildRequires:  expat-devel
35 BuildRequires:  faad2-devel >= 2.6.1-5
36 BuildRequires:  ffmpeg-devel >= 2.4.0
37 BuildRequires:  flac-devel >= 1.2.0
38 BuildRequires:  fluidsynth-devel >= 1.1
39 BuildRequires:  game-music-emu-devel
40 BuildRequires:  gcc >= 6:8
41 BuildRequires:  glib2-devel >= 1:2.28.0
42 BuildRequires:  jack-audio-connection-kit-devel >= 0.100
43 BuildRequires:  lame-libs-devel
44 BuildRequires:  libao-devel >= 0.8.3
45 BuildRequires:  libcdio-devel
46 BuildRequires:  libcdio-paranoia-devel >= 0.93
47 BuildRequires:  libchromaprint-devel
48 BuildRequires:  libfmt-devel
49 BuildRequires:  libicu-devel >= 50
50 BuildRequires:  libid3tag-devel
51 BuildRequires:  libmad-devel
52 %{?with_mod:BuildRequires:      libmikmod-devel >= 3.2}
53 BuildRequires:  libmms-devel >= 0.4
54 BuildRequires:  libmodplug-devel
55 BuildRequires:  libmpdclient-devel >= 2.11
56 BuildRequires:  libmpg123-devel >= 1.28.0
57 BuildRequires:  libnfs-devel >= 1.11
58 BuildRequires:  libogg-devel
59 BuildRequires:  libopenmpt-devel >= 0.5
60 BuildRequires:  libsamplerate-devel >= 0.1.3
61 BuildRequires:  libshout-devel
62 BuildRequires:  libsidplayfp-devel >= 1.8
63 BuildRequires:  libsmbclient-devel >= 0.2
64 BuildRequires:  libsndfile-devel
65 BuildRequires:  libstdc++-devel
66 BuildRequires:  libupnp-devel >= 1.8
67 BuildRequires:  liburing-devel
68 BuildRequires:  libvorbis-devel
69 BuildRequires:  meson >= 0.56.0
70 BuildRequires:  musepack-devel
71 BuildRequires:  ninja
72 BuildRequires:  opus-devel
73 BuildRequires:  pcre-devel
74 BuildRequires:  pipewire-devel >= 0.3
75 BuildRequires:  pkgconfig >= 1:0.9.0
76 %{?with_pulseaudio:BuildRequires:       pulseaudio-devel >= 0.9.16}
77 BuildRequires:  rpmbuild(macros) >= 1.736
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,postun):  gtk-update-icon-cache
93 Requires(post,preun,postun):    systemd-units >= 38
94 Requires:       alsa-lib >= 0.9.0
95 %{?with_audiofile:Requires:     audiofile >= 0.3}
96 Requires:       curl-libs >= 7.33
97 Requires:       faad2-libs >= 2.6.1-5
98 Requires:       ffmpeg-libs >= 2.4.0
99 Requires:       flac >= 1.2.0
100 Requires:       fluidsynth >= 1.1
101 Requires:       glib2 >= 1:2.28.0
102 Requires:       hicolor-icon-theme
103 Requires:       jack-audio-connection-kit-libs >= 0.100
104 Requires:       libao >= 0.8.3
105 Requires:       libcdio-paranoia >= 0.93
106 Requires:       libicu >= 50
107 %{?with_mod:Requires:   libmikmod >= 3.2}
108 Requires:       libmms >= 0.4
109 Requires:       libmpdclient >= 2.11
110 Requires:       libmpg123 >= 1.28.0
111 Requires:       libnfs >= 1.11
112 Requires:       libopenmpt >= 0.5
113 Requires:       libsamplerate >= 0.1.3
114 Requires:       libsidplayfp >= 1.8
115 Requires:       libsmbclient >= 0.2
116 Requires:       libupnp >= 1.8
117 Requires:       pipewire-libs >= 0.3
118 %{?with_pulseaudio:Requires:    pulseaudio-libs >= 0.9.16}
119 Requires:       shine >= 3.1
120 Requires:       sqlite3 >= 3.7.3
121 Requires:       systemd-units >= 38
122 Requires:       yajl >= 2.0
123 Requires:       zziplib >= 0.13
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 %prep
174 %setup -q
175 %patch0 -p1
176
177 %build
178 %meson build \
179         -Dpulse=%{?with_pulseaudio:enabled}%{!?with_pulseaudio:disabled} \
180         -Dmikmod=%{?with_mod:enabled}%{!?with_mod:disabled} \
181         -Dadplug=enabled \
182         -Dalsa=enabled \
183         -Dao=enabled \
184         -Daudiofile=%{?with_audiofile:enabled}%{!?with_audiofile:disabled} \
185         -Dbzip2=enabled \
186         -Dcdio_paranoia=enabled \
187         -Dcurl=enabled \
188         -Ddatabase=true \
189         -Ddocumentation=enabled \
190         -Ddsd=true \
191         -Dexpat=enabled \
192         -Dffmpeg=enabled \
193         -Dfifo=true \
194         -Dflac=enabled \
195         -Dfluidsynth=enabled \
196         -Dgme=enabled \
197         -Dhttpd=true \
198         -Dicu=enabled \
199         -Did3tag=enabled \
200         -Dinotify=true \
201         -Dio_uring=enabled \
202         -Dipv6=enabled \
203         -Diso9660=enabled \
204         -Djack=enabled \
205         -Dlame=enabled \
206         -Dlibmpdclient=enabled \
207         -Dmad=enabled \
208         -Dmikmod=enabled \
209         -Dmms=enabled \
210         -Dmodplug=enabled \
211         -Dmpcdec=disabled \
212         -Dnfs=enabled \
213         -Dopenal=enabled \
214         -Dopus=enabled \
215         -Doss=enabled \
216         -Dpipe=true \
217         -Drecorder=true \
218         -Dsidplay=enabled \
219         -Dshine=enabled \
220         -Dshout=enabled \
221         -Dsmbclient=enabled \
222         -Dsndfile=enabled \
223         -Dsoundcloud=enabled \
224         -Dsoxr=enabled \
225         -Dsqlite=enabled \
226         -Ddaemon=true \
227         -Dsystemd=enabled \
228         -Dtcp=true \
229         -Dtwolame=enabled \
230         -Dupnp=pupnp \
231         -Dvorbis=enabled \
232         -Dvorbisenc=enabled \
233         -Dwave_encoder=true \
234         -Dwavpack=enabled \
235         -Dwildmidi=enabled \
236         -Dzlib=enabled \
237         -Dzzip=enabled \
238         -Dzeroconf=avahi \
239         -Dsystemd_system_unit_dir=%{systemdunitdir} \
240         -Dsystemd_user_unit_dir=%{systemduserunitdir}
241 %ninja_build -C build
242
243 %install
244 rm -rf $RPM_BUILD_ROOT
245 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig}} \
246         $RPM_BUILD_ROOT{/var/lib/mpd/playlists,/var/log/mpd,/var/run/mpd} \
247         $RPM_BUILD_ROOT%{systemdtmpfilesdir}
248
249 %ninja_install -C build
250
251 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}
252 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mpd
253 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/mpd
254 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
255
256 touch $RPM_BUILD_ROOT/var/lib/mpd/mpd.db
257 touch $RPM_BUILD_ROOT/var/lib/mpd/mpdstate
258 touch $RPM_BUILD_ROOT/var/lib/mpd/sticker.sql
259 touch $RPM_BUILD_ROOT/var/log/mpd/mpd.log
260
261 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/mpd
262
263 %clean
264 rm -rf $RPM_BUILD_ROOT
265
266 %pre
267 %groupadd -g 204 mpd
268 %useradd -u 204 -r -d /var/lib/mpd -s /bin/false -c "Music Player Daemon (MPD) user" -G audio -g mpd mpd
269
270 %post
271 for f in mpd.log; do
272         if [ ! -f /var/log/%{name}/$f ]; then
273                 touch /var/log/%{name}/$f
274                 chown mpd:mpd /var/log/%{name}/$f
275                 chmod 644 /var/log/%{name}/$f
276         fi
277 done
278 /sbin/chkconfig --add mpd
279 %systemd_post %{name}.service %{name}.socket
280 %update_icon_cache hicolor
281
282 %preun
283 if [ "$1" = "0" ]; then
284         %service mpd stop
285         /sbin/chkconfig --del mpd
286 fi
287 %systemd_preun %{name}.service %{name}.socket
288
289 %postun
290 if [ "$1" = "0" ]; then
291         %userremove mpd
292         %groupremove mpd
293 fi
294 %systemd_reload
295 %update_icon_cache hicolor
296
297 %triggerpostun -- %{name} < 0.16.6-1
298 %systemd_trigger %{name}.service
299
300 %files
301 %defattr(644,root,root,755)
302 %doc AUTHORS NEWS README.md doc/mpdconf.example
303 %attr(755,root,root) %{_bindir}/*
304 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mpd.conf
305 %attr(754,root,root) /etc/rc.d/init.d/mpd
306 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mpd
307 %{systemdtmpfilesdir}/%{name}.conf
308 %{systemdunitdir}/mpd.service
309 %{systemdunitdir}/mpd.socket
310 %{systemduserunitdir}/mpd.service
311 %{systemduserunitdir}/mpd.socket
312 %dir %attr(770,root,mpd) /var/lib/%{name}
313 %dir %attr(770,root,mpd) /var/lib/%{name}/playlists
314 %dir %attr(751,root,root) /var/log/%{name}
315 %dir %attr(770,root,mpd) /var/run/%{name}
316 %attr(644,mpd,mpd) %ghost /var/lib/%{name}/mpd.db
317 %attr(644,mpd,mpd) %ghost /var/lib/%{name}/mpdstate
318 %attr(644,mpd,mpd) %ghost /var/lib/%{name}/sticker.sql
319 %attr(644,mpd,mpd) %ghost /var/log/%{name}/mpd.log
320 %{_iconsdir}/hicolor/scalable/apps/mpd.svg
321 %{_mandir}/man1/mpd.1*
322 %{_mandir}/man5/mpd.conf.5*
323
324 %files doc
325 %defattr(644,root,root,755)
326 %doc build/doc/html
This page took 0.071135 seconds and 2 git commands to generate.