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