configure: drop unused liblzo and bzlib tests
[mplayer/greg.git] / rpm / mplayer.spec
blob2acc2a6ed7cbc3a10957a793b98f8528ad5725a4
1 %define date %(date --iso)
2 %define svnbuild %(date +%Y%m%d)
3 %define codecsdir %{_libdir}/codecs
5 Name: mplayer
6 Version: 1.0
7 Release: 0.%{svnbuild}svn%{?dist}
8 Summary: Movie player playing most video formats and DVDs
10 Group: Applications/Multimedia
11 License: GPL
12 URL: http://www.mplayerhq.hu/
13 Source0: http://www.mplayerhq.hu/MPlayer/releases/mplayer-export-snapshot.tar.bz2
14 Source1: http://www.mplayerhq.hu/MPlayer/skins/Blue-1.7.tar.bz2
15 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
17 BuildRequires: SDL-devel
18 BuildRequires: aalib-devel
19 BuildRequires: alsa-lib-devel
20 BuildRequires: cdparanoia-devel
21 BuildRequires: desktop-file-utils
22 BuildRequires: em8300-devel
23 BuildRequires: enca-devel
24 BuildRequires: faad2-devel
25 BuildRequires: fontconfig-devel
26 BuildRequires: freetype-devel >= 2.0.9
27 BuildRequires: fribidi-devel
28 BuildRequires: giflib-devel
29 BuildRequires: gtk2-devel
30 BuildRequires: ladspa-devel
31 BuildRequires: lame-devel
32 BuildRequires: libGL-devel
33 BuildRequires: libXinerama-devel
34 BuildRequires: libXv-devel
35 BuildRequires: libXvMC-devel
36 BuildRequires: libXxf86dga-devel
37 BuildRequires: libXxf86vm-devel
38 BuildRequires: libcaca-devel
39 BuildRequires: libdca-devel
40 BuildRequires: libdv-devel
41 BuildRequires: libdvdnav-devel
42 BuildRequires: libjpeg-devel
43 BuildRequires: libmpcdec-devel
44 BuildRequires: libtheora-devel
45 BuildRequires: libvorbis-devel
46 BuildRequires: lirc-devel
47 BuildRequires: live-devel
48 BuildRequires: lzo-devel >= 2
49 BuildRequires: speex-devel >= 1.1
50 BuildRequires: xvidcore-devel >= 0.9.2
51 %{?_with_arts:BuildRequires: arts-devel}
52 %{?_with_amr:BuildRequires: amrnb-devel amrwb-devel}
53 %{?_with_directfb:BuildRequires: directfb-devel}
54 %{?_with_esound:BuildRequires: esound-devel}
55 %{?_with_jack:BuildRequires: jack-audio-connection-kit-devel}
56 %{?_with_libmad:BuildRequires: libmad-devel}
57 %{?_with_openal:BuildRequires: openal-devel}
58 %{?_with_samba:BuildRequires: samba-common}
59 %{?_with_svgalib:BuildRequires: svgalib-devel}
60 %{?_with_xmms:BuildRequires: xmms-devel}
61 # for XML docs, SVN only
62 BuildRequires: docbook-dtds
63 BuildRequires: docbook-style-xsl
64 BuildRequires: libxml2
65 BuildRequires: libxslt
67 %description
68 MPlayer is a movie player that plays most MPEG, VOB, AVI, OGG/OGM,
69 VIVO, ASF/WMA/WMV, QT/MOV/MP4, FLI, RM, NuppelVideo, yuv4mpeg, FILM,
70 RoQ, and PVA files. You can also use it to watch VCDs, SVCDs, DVDs,
71 3ivx, RealMedia, and DivX movies.
72 It supports a wide range of output drivers including X11, XVideo, DGA,
73 OpenGL, SVGAlib, fbdev, AAlib, DirectFB etc. There are also nice
74 antialiased shaded subtitles and OSD.
75 Non-default rpmbuild options:
76 --with samba: Enable Samba (smb://) support
77 --with xmms: Enable XMMS input plugin support
78 --with amr: Enable AMR support
79 --with libmad: Enable libmad support
80 --with openal: Enable OpenAL support
81 --with jack: Enable JACK support
82 --with arts: Enable aRts support
83 --with esound: Enable EsounD support
84 --with directfb:Enable DirectFB support
85 --with svgalib: Enable SVGAlib support
87 %package gui
88 Summary: GUI for MPlayer
89 Group: Applications/Multimedia
90 Requires: mplayer = %{version}-%{release}
92 %description gui
93 This package contains a GUI for MPlayer and a default skin for it.
95 %package doc
96 Summary: MPlayer documentation in various languages
97 Group: Documentation
99 %description doc
100 MPlayer documentation in various languages.
103 %prep
104 %setup -q -n mplayer-export-%{date}
106 doconv() {
107 iconv -f $1 -t $2 -o DOCS/man/$3/mplayer.1.utf8 DOCS/man/$3/mplayer.1 && \
108 mv DOCS/man/$3/mplayer.1.utf8 DOCS/man/$3/mplayer.1
110 for lang in de es fr it ; do doconv iso-8859-1 utf-8 $lang ; done
111 for lang in hu pl ; do doconv iso-8859-2 utf-8 $lang ; done
112 for lang in ru ; do doconv koi8-r utf-8 $lang ; done
114 mv DOCS/man/zh DOCS/man/zh_CN
116 %build
117 ./configure \
118 --prefix=%{_prefix} \
119 --bindir=%{_bindir} \
120 --datadir=%{_datadir}/mplayer \
121 --mandir=%{_mandir} \
122 --confdir=%{_sysconfdir}/mplayer \
123 --libdir=%{_libdir} \
124 --codecsdir=%{codecsdir} \
126 --enable-gui \
127 --enable-largefiles \
128 --disable-termcap \
129 --disable-bitmap-font \
130 --enable-lirc \
131 --enable-joystick \
132 %{!?_with_samba:--disable-smb} \
133 --disable-dvdread-internal \
134 --disable-libdvdcss-internal \
135 --enable-menu \
137 %{!?_with_amr:--disable-libamr_nb --disable-libamr_wb} \
138 %{!?_with_libmad:--disable-mad} \
139 %{?_with_xmms:--enable-xmms} \
141 --disable-svga \
142 --enable-xvmc \
143 --%{?_with_directfb:enable}%{!?_with_directfb:disable}-directfb \
144 %{!?_with_svgalib:--disable-svga} \
146 %{!?_with_arts:--disable-arts} \
147 %{!?_with_esound:--disable-esd} \
148 %{!?_with_jack:--disable-jack} \
149 %{!?_with_openal:--disable-openal} \
151 --language=all \
153 %{?_with_xmms:--with-xmmslibdir=%{_libdir}} \
154 --with-xvmclib=XvMCW
156 %{__make}
158 mv -f mplayer gmplayer
159 %{__make} distclean
161 ./configure \
162 --prefix=%{_prefix} \
163 --bindir=%{_bindir} \
164 --datadir=%{_datadir}/mplayer \
165 --mandir=%{_mandir} \
166 --confdir=%{_sysconfdir}/mplayer \
167 --libdir=%{_libdir} \
168 --codecsdir=%{codecsdir} \
170 --enable-largefiles \
171 --disable-termcap \
172 --disable-bitmap-font \
173 --enable-lirc \
174 --enable-joystick \
175 %{!?_with_samba:--disable-smb} \
176 --disable-dvdread-internal \
177 --disable-libdvdcss-internal \
178 --enable-menu \
180 %{!?_with_amr:--disable-libamr_nb --disable-libamr_wb} \
181 %{!?_with_libmad:--disable-mad} \
182 %{?_with_xmms:--enable-xmms} \
184 --disable-svga \
185 --enable-xvmc \
186 --%{?_with_directfb:enable}%{!?_with_directfb:disable}-directfb \
187 %{!?_with_svgalib:--disable-svga} \
189 %{!?_with_arts:--disable-arts} \
190 %{!?_with_esound:--disable-esd} \
191 %{!?_with_jack:--disable-jack} \
192 %{!?_with_openal:--disable-openal} \
194 --language=all \
196 %{?_with_xmms:--with-xmmslibdir=%{_libdir}} \
197 --with-xvmclib=XvMCW
199 %{__make}
201 # build HTML documentation from XML files
202 pushd DOCS/xml
203 %{__make} html-chunked
204 popd
206 %install
207 rm -rf $RPM_BUILD_ROOT doc
209 make install DESTDIR=$RPM_BUILD_ROOT STRIPBINARIES=no
210 install -pm 755 TOOLS/midentify.sh $RPM_BUILD_ROOT%{_bindir}/
212 # Clean up documentation
213 mkdir doc
214 cp -pR DOCS/* doc/
215 rm -r doc/man doc/xml doc/README
216 mv doc/HTML/* doc/
217 rm -rf doc/HTML
219 # Default config files
220 install -Dpm 644 etc/example.conf \
221 $RPM_BUILD_ROOT%{_sysconfdir}/mplayer/mplayer.conf
222 # use Nimbus Sans L font for OSD (via fontconfig)
223 echo "fontconfig=yes" >>$RPM_BUILD_ROOT%{_sysconfdir}/mplayer/mplayer.conf
224 echo "font=\"Sans\"" >>$RPM_BUILD_ROOT%{_sysconfdir}/mplayer/mplayer.conf
226 install -pm 644 etc/{input,menu}.conf $RPM_BUILD_ROOT%{_sysconfdir}/mplayer/
228 # GUI mplayer
229 install -pm 755 g%{name} $RPM_BUILD_ROOT%{_bindir}/
231 # Default skin
232 install -dm 755 $RPM_BUILD_ROOT%{_datadir}/mplayer/skins
233 tar xjC $RPM_BUILD_ROOT%{_datadir}/mplayer/skins --exclude=.svn -f %{SOURCE1}
234 ln -s Blue $RPM_BUILD_ROOT%{_datadir}/mplayer/skins/default
236 # Icons
237 install -dm 755 $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps
238 install -pm 644 etc/mplayer.xpm \
239 $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps
241 # Desktop file
242 desktop-file-install \
243 --dir $RPM_BUILD_ROOT%{_datadir}/applications \
244 etc/%{name}.desktop
246 # Codec dir
247 install -dm 755 $RPM_BUILD_ROOT%{codecsdir}
250 %post gui
251 gtk-update-icon-cache -qf %{_datadir}/icons/hicolor &>/dev/null || :
252 update-desktop-database &>/dev/null || :
255 %postun gui
256 gtk-update-icon-cache -qf %{_datadir}/icons/hicolor &>/dev/null || :
257 update-desktop-database &>/dev/null || :
260 %clean
261 rm -rf $RPM_BUILD_ROOT
264 %files
265 %defattr(-, root, root, -)
266 %doc AUTHORS Changelog LICENSE README
267 %dir %{_sysconfdir}/mplayer
268 %config(noreplace) %{_sysconfdir}/mplayer/mplayer.conf
269 %config(noreplace) %{_sysconfdir}/mplayer/input.conf
270 %config(noreplace) %{_sysconfdir}/mplayer/menu.conf
271 %{_bindir}/midentify.sh
272 %{_bindir}/mplayer
273 %dir %{codecsdir}/
274 %dir %{_datadir}/mplayer/
275 %{_mandir}/man1/mplayer.1*
276 %lang(cs) %{_mandir}/cs/man1/mplayer.1*
277 %lang(de) %{_mandir}/de/man1/mplayer.1*
278 %lang(es) %{_mandir}/es/man1/mplayer.1*
279 %lang(fr) %{_mandir}/fr/man1/mplayer.1*
280 %lang(hu) %{_mandir}/hu/man1/mplayer.1*
281 %lang(it) %{_mandir}/it/man1/mplayer.1*
282 %lang(pl) %{_mandir}/pl/man1/mplayer.1*
283 %lang(ru) %{_mandir}/ru/man1/mplayer.1*
284 %lang(zh_CN) %{_mandir}/zh_CN/man1/mplayer.1*
286 %files gui
287 %defattr(-, root, root, -)
288 %{_bindir}/gmplayer
289 %{_datadir}/applications/*mplayer.desktop
290 %{_datadir}/icons/hicolor/32x32/apps/mplayer.xpm
291 %{_datadir}/mplayer/skins/
293 %files doc
294 %defattr(-, root, root, -)
295 %doc doc/en/ doc/tech/
296 %lang(cs) %doc doc/cs/
297 %lang(de) %doc doc/de/
298 %lang(es) %doc doc/es/
299 %lang(fr) %doc doc/fr/
300 %lang(hu) %doc doc/hu/
301 %lang(pl) %doc doc/pl/
302 %lang(ru) %doc doc/ru/
303 %lang(zh_CN) %doc doc/zh_CN/
306 %changelog
307 * Sat Oct 06 2007 Dominik Mierzejewski <rpm at greysector.net>
308 - adapted livna specfile for inclusion in SVN