]> git.pld-linux.org Git - packages/mpd.git/blob - mpd.spec
up to 0.20.22
[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.20.22
13 Release:        1
14 License:        GPL v2+
15 Group:          Applications/Multimedia
16 Source0:        http://www.musicpd.org/download/mpd/0.20/%{name}-%{version}.tar.xz
17 # Source0-md5:  6acee2bc5b30f6c97fdaf46682b0116c
18 Source1:        %{name}.conf
19 Source2:        %{name}.init
20 Source3:        %{name}.sysconfig
21 Source4:        %{name}.tmpfiles
22 Patch0:         %{name}-mpcsv8.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:  autoconf >= 2.60
29 BuildRequires:  automake >= 1:1.11
30 BuildRequires:  avahi-devel
31 BuildRequires:  boost-devel >= 1.54
32 BuildRequires:  bzip2-devel
33 BuildRequires:  curl-devel >= 7.18
34 BuildRequires:  dbus-devel
35 BuildRequires:  doxygen
36 BuildRequires:  expat-devel
37 BuildRequires:  faad2-devel >= 2.6.1-5
38 BuildRequires:  ffmpeg-devel >= 0.8.0
39 BuildRequires:  flac-devel >= 1.2.0
40 BuildRequires:  fluidsynth-devel >= 1.1
41 BuildRequires:  game-music-emu-devel
42 BuildRequires:  gcc >= 6:4.7
43 BuildRequires:  glib2-devel >= 1:2.28.0
44 BuildRequires:  jack-audio-connection-kit-devel >= 0.100
45 BuildRequires:  lame-libs-devel
46 BuildRequires:  libao-devel >= 0.8.3
47 BuildRequires:  libcdio-devel
48 BuildRequires:  libcdio-paranoia-devel
49 BuildRequires:  libcue-devel
50 BuildRequires:  libicu-devel
51 BuildRequires:  libid3tag-devel
52 BuildRequires:  libmad-devel
53 %{?with_mod:BuildRequires:      libmikmod-devel >= 3.1.7}
54 BuildRequires:  libmms-devel >= 0.4
55 BuildRequires:  libmodplug-devel
56 BuildRequires:  libmpdclient-devel >= 2.2
57 BuildRequires:  libmpg123-devel
58 BuildRequires:  libnfs-devel
59 BuildRequires:  libogg-devel
60 BuildRequires:  libsamplerate-devel >= 0.1.3
61 BuildRequires:  libshout-devel
62 BuildRequires:  libsidplay2-devel >= 2.1.1-5
63 BuildRequires:  libsmbclient-devel >= 0.2
64 BuildRequires:  libsndfile-devel
65 BuildRequires:  libstdc++-devel >= 0.2
66 BuildRequires:  libupnp-devel
67 BuildRequires:  libvorbis-devel
68 BuildRequires:  libwrap-devel
69 BuildRequires:  musepack-devel
70 BuildRequires:  opus-devel
71 BuildRequires:  pkgconfig >= 1:0.9.0
72 %{?with_pulseaudio:BuildRequires:       pulseaudio-devel >= 0.9.16}
73 BuildRequires:  rpmbuild(macros) >= 1.629-2
74 BuildRequires:  shine-devel >= 3.1
75 BuildRequires:  soxr-devel
76 BuildRequires:  sqlite3-devel >= 3.7.3
77 BuildRequires:  systemd-devel
78 BuildRequires:  twolame-devel
79 BuildRequires:  wavpack-devel
80 BuildRequires:  wildmidi-devel
81 BuildRequires:  xmlto
82 BuildRequires:  yajl-devel >= 2.0
83 BuildRequires:  zlib-devel
84 BuildRequires:  zziplib-devel >= 0.13
85 Requires(post,postun):  gtk-update-icon-cache
86 Requires(post,preun,postun):    systemd-units >= 38
87 Requires:       alsa-lib >= 0.9.0
88 %{?with_audiofile:Requires:     audiofile >= 0.3}
89 Requires:       curl-libs >= 7.18
90 Requires:       faad2-libs >= 2.6.1-5
91 Requires:       ffmpeg-libs >= 0.8.0
92 Requires:       flac >= 1.2.0
93 Requires:       fluidsynth >= 1.1
94 Requires:       glib2 >= 1:2.28.0
95 Requires:       hicolor-icon-theme
96 Requires:       jack-audio-connection-kit-libs >= 0.100
97 Requires:       libao >= 0.8.3
98 %{?with_mod:Requires:   libmikmod >= 3.1.7}
99 Requires:       libmms >= 0.4
100 Requires:       libmpdclient >= 2.2
101 Requires:       libsamplerate >= 0.1.3
102 Requires:       libsidplay2 >= 2.1.1-5
103 Requires:       libsmbclient >= 0.2
104 %{?with_pulseaudio:Requires:    pulseaudio-libs >= 0.9.16}
105 Requires:       shine >= 3.1
106 Requires:       sqlite3 >= 3.7.3
107 Requires:       systemd-units >= 38
108 Requires:       yajl >= 2.0
109 Requires:       zziplib >= 0.13
110 Provides:       group(mpd)
111 Provides:       user(mpd)
112 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
113
114 %description
115 Music Player Daemon (MPD) allows remote access for playing music (MP3,
116 Ogg Vorbis, FLAC, AAC, Mod, and wave files) and managing playlists.
117 MPD is designed for integrating a computer into a stereo system that
118 provides control for music playback over a local network. It is also
119 makes a great desktop music player, especially if you are a console
120 junkie, like frontend options, or restart X often.
121
122 %description -l hu.UTF-8
123 Music Player Daemon (MPD)-vel lehetővé válik távoli zenelejátszás
124 (MP3, Ogg Vorbis, FLAC, AAC, Mod és wav fájlok) és lejátszási listák
125 menedzselése. Az MPD a számítógépben egy zenelejátszó, amelyet
126 irányíthatsz helyi hálózaton keresztül. Egyben egy zseniális desktop
127 zenelejátszó is, különösen a konzol-mániásoknak, vagy azoknak, akik
128 sűrűn indítják újra az X-et.
129
130 %description -l pl.UTF-8
131 Music Player Daemon (MPD) pozwala na zdalny dostęp do odtwarzania
132 muzyki (plików MP3, Ogg Vorbis, FLAC, AAC, Mod i wave) oraz
133 zarządzania playlistami. MPD jest zaprojektowany do integrowania
134 komputera w system stereo umożliwiający sterowanie odtwarzaniem muzyki
135 w sieci lokalnej. Służy także za dobry odtwarzacz muzyki dla
136 komputerów biurkowych, zwłaszcza dla miłośników konsoli, różnych opcji
137 frontendów albo często restartujących X.
138
139 %package apidocs
140 Summary:        MPD API documentation
141 Summary(pl.UTF-8):      Dokumentacja API biblioteki API
142 Group:          Documentation
143 %if "%{_rpmversion}" >= "5"
144 BuildArch:      noarch
145 %endif
146
147 %description apidocs
148 API and internal documentation for MPD library.
149
150 %description apidocs -l pl.UTF-8
151 Dokumentacja API biblioteki MPD.
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
160 %description doc
161 Documentation for Music Player Daemon (MPD).
162
163 %description doc -l fr.UTF-8
164 Documentation pour Music Player Daemon (MPD).
165
166 %description doc -l it.UTF-8
167 Documentazione di Music Player Daemon (MPD).
168
169 %description doc -l pl.UTF-8
170 Dokumentacja do Music Player Daemon (MPD).
171
172 %prep
173 %setup -q
174 %patch0 -p1
175
176 %build
177 %{__aclocal} -I m4
178 %{__autoconf}
179 %{__autoheader}
180 %{__automake}
181 # ac_cv_* hacks to avoid unwanted linking
182 GME_CFLAGS="-I/usr/include/gme" GME_LIBS="-lgme" \
183 %configure \
184         ac_cv_lib_iconv_main=no \
185         ac_cv_lib_nsl_gethostbyname=no \
186         %{!?with_pulseaudio:--disable-pulse} \
187         %{?with_mod:--enable-mikmod} \
188         --enable-adplug \
189         --enable-alsa \
190         --enable-ao \
191         %{?with_audiofile:--enable-audiofile} \
192         --enable-bzip2 \
193         --enable-cdio-paranoia \
194         --enable-curl \
195         --enable-database \
196         --enable-documentation \
197         --enable-dsd \
198         --enable-expat \
199         --enable-ffmpeg \
200         --enable-fifo \
201         --enable-flac \
202         --enable-fluidsynth \
203         --enable-gme \
204         --enable-httpd-output \
205         --enable-icu \
206         --enable-id3 \
207         --enable-inotify \
208         --enable-ipv6 \
209         --enable-iso9660 \
210         --enable-jack \
211         --enable-lame-encoder \
212         --enable-libmpdclient \
213         --enable-libwrap \
214         --enable-lsr \
215         --enable-mad \
216         --enable-mikmod \
217         --enable-mms \
218         --enable-modplug \
219         --enable-mpc \
220         --enable-nfs \
221         --enable-openal \
222         --enable-opus \
223         --enable-oss \
224         --enable-pipe-output \
225         --enable-recorder-output \
226         --enable-sidplay \
227         --enable-shine-encoder \
228         --enable-shout \
229         --enable-smbclient \
230         --enable-sndfile \
231         --enable-soundcloud \
232         --enable-soxr \
233         --enable-sqlite \
234         --enable-systemd-daemon \
235         --enable-tcp \
236         --enable-twolame-encoder \
237         --enable-upnp \
238         --enable-un \
239         --enable-vorbis \
240         --enable-vorbis-encoder \
241         --enable-wave-encoder \
242         --enable-wavpack \
243         --enable-wildmidi \
244         --enable-zlib \
245         --enable-zzip \
246         --with-zeroconf=avahi \
247         --without-tremor \
248         --with-systemdsystemunitdir=%{systemdunitdir} \
249         --with-systemduserunitdir=%{systemduserunitdir}
250 %{__make}
251
252 %install
253 rm -rf $RPM_BUILD_ROOT
254 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig}} \
255         $RPM_BUILD_ROOT{/var/lib/mpd/playlists,/var/log/mpd,/var/run/mpd} \
256         $RPM_BUILD_ROOT%{systemdtmpfilesdir}
257
258 %{__make} install \
259         DESTDIR=$RPM_BUILD_ROOT
260
261 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}
262 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mpd
263 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/mpd
264 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
265
266 touch $RPM_BUILD_ROOT/var/lib/mpd/mpd.db
267 touch $RPM_BUILD_ROOT/var/lib/mpd/mpdstate
268 touch $RPM_BUILD_ROOT/var/lib/mpd/sticker.sql
269 touch $RPM_BUILD_ROOT/var/log/mpd/mpd.log
270
271 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/mpd
272
273 %clean
274 rm -rf $RPM_BUILD_ROOT
275
276 %pre
277 %groupadd -g 204 mpd
278 %useradd -u 204 -r -d /var/lib/mpd -s /bin/false -c "Music Player Daemon (MPD) user" -G audio -g mpd mpd
279
280 %post
281 for f in mpd.log; do
282         if [ ! -f /var/log/%{name}/$f ]; then
283                 touch /var/log/%{name}/$f
284                 chown mpd:mpd /var/log/%{name}/$f
285                 chmod 644 /var/log/%{name}/$f
286         fi
287 done
288 /sbin/chkconfig --add mpd
289 %systemd_post %{name}.service %{name}.socket
290 %update_icon_cache hicolor
291
292 %preun
293 if [ "$1" = "0" ]; then
294         %service mpd stop
295         /sbin/chkconfig --del mpd
296 fi
297 %systemd_preun %{name}.service %{name}.socket
298
299 %postun
300 if [ "$1" = "0" ]; then
301         %userremove mpd
302         %groupremove mpd
303 fi
304 %systemd_reload
305 %update_icon_cache hicolor
306
307 %triggerpostun -- %{name} < 0.16.6-1
308 %systemd_trigger %{name}.service
309
310 %files
311 %defattr(644,root,root,755)
312 %doc AUTHORS NEWS README.md doc/mpdconf.example
313 %attr(755,root,root) %{_bindir}/*
314 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mpd.conf
315 %attr(754,root,root) /etc/rc.d/init.d/mpd
316 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mpd
317 %{systemdtmpfilesdir}/%{name}.conf
318 %{systemdunitdir}/mpd.service
319 %{systemdunitdir}/mpd.socket
320 %{systemduserunitdir}/mpd.service
321 %dir %attr(770,root,mpd) /var/lib/%{name}
322 %dir %attr(770,root,mpd) /var/lib/%{name}/playlists
323 %dir %attr(751,root,root) /var/log/%{name}
324 %dir %attr(770,root,mpd) /var/run/%{name}
325 %attr(644,mpd,mpd) %ghost /var/lib/%{name}/mpd.db
326 %attr(644,mpd,mpd) %ghost /var/lib/%{name}/mpdstate
327 %attr(644,mpd,mpd) %ghost /var/lib/%{name}/sticker.sql
328 %attr(644,mpd,mpd) %ghost /var/log/%{name}/mpd.log
329 %{_iconsdir}/hicolor/scalable/apps/mpd.svg
330 %{_mandir}/man1/mpd.1*
331 %{_mandir}/man5/mpd.conf.5*
332
333 %files doc
334 %defattr(644,root,root,755)
335 %doc doc/user/*
336
337 %files apidocs
338 %defattr(644,root,root,755)
339 %doc doc/api doc/developer doc/protocol
This page took 0.057453 seconds and 3 git commands to generate.