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