vo_glamo: sub.h was moved to sub directory in c9026cb3210205b07e2e068467a18ee40f9259a3
[mplayer/glamo.git] / rpm / mplayer.spec
blob9730a46a1714d2d92a33ffde4a0f121c9288cb56
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 --disable-faad-internal \
138 --disable-tremor-internal \
139 %{!?_with_amr:--disable-libamr_nb --disable-libamr_wb} \
140 %{!?_with_libmad:--disable-mad} \
141 %{?_with_xmms:--enable-xmms} \
143 --disable-svga \
144 --enable-xvmc \
145 --%{?_with_directfb:enable}%{!?_with_directfb:disable}-directfb \
146 %{!?_with_svgalib:--disable-svga} \
148 %{!?_with_arts:--disable-arts} \
149 %{!?_with_esound:--disable-esd} \
150 %{!?_with_jack:--disable-jack} \
151 %{!?_with_openal:--disable-openal} \
153 --language=all \
155 %{?_with_xmms:--with-xmmslibdir=%{_libdir}} \
156 --with-xvmclib=XvMCW
158 %{__make}
160 mv -f mplayer gmplayer
161 %{__make} distclean
163 ./configure \
164 --prefix=%{_prefix} \
165 --bindir=%{_bindir} \
166 --datadir=%{_datadir}/mplayer \
167 --mandir=%{_mandir} \
168 --confdir=%{_sysconfdir}/mplayer \
169 --libdir=%{_libdir} \
170 --codecsdir=%{codecsdir} \
172 --enable-largefiles \
173 --disable-termcap \
174 --disable-bitmap-font \
175 --enable-lirc \
176 --enable-joystick \
177 %{!?_with_samba:--disable-smb} \
178 --disable-dvdread-internal \
179 --disable-libdvdcss-internal \
180 --enable-menu \
182 --disable-faad-internal \
183 --disable-tremor-internal \
184 %{!?_with_amr:--disable-libamr_nb --disable-libamr_wb} \
185 %{!?_with_libmad:--disable-mad} \
186 %{?_with_xmms:--enable-xmms} \
188 --disable-svga \
189 --enable-xvmc \
190 --%{?_with_directfb:enable}%{!?_with_directfb:disable}-directfb \
191 %{!?_with_svgalib:--disable-svga} \
193 %{!?_with_arts:--disable-arts} \
194 %{!?_with_esound:--disable-esd} \
195 %{!?_with_jack:--disable-jack} \
196 %{!?_with_openal:--disable-openal} \
198 --language=all \
200 %{?_with_xmms:--with-xmmslibdir=%{_libdir}} \
201 --with-xvmclib=XvMCW
203 %{__make}
205 # build HTML documentation from XML files
206 pushd DOCS/xml
207 %{__make} html-chunked
208 popd
210 %install
211 rm -rf $RPM_BUILD_ROOT doc
213 make install DESTDIR=$RPM_BUILD_ROOT STRIPBINARIES=no
214 install -pm 755 TOOLS/midentify.sh $RPM_BUILD_ROOT%{_bindir}/
216 # Clean up documentation
217 mkdir doc
218 cp -pR DOCS/* doc/
219 rm -r doc/man doc/xml doc/README
220 mv doc/HTML/* doc/
221 rm -rf doc/HTML
223 # Default config files
224 install -Dpm 644 etc/example.conf \
225 $RPM_BUILD_ROOT%{_sysconfdir}/mplayer/mplayer.conf
226 # use Nimbus Sans L font for OSD (via fontconfig)
227 echo "fontconfig=yes" >>$RPM_BUILD_ROOT%{_sysconfdir}/mplayer/mplayer.conf
228 echo "font=\"Sans\"" >>$RPM_BUILD_ROOT%{_sysconfdir}/mplayer/mplayer.conf
230 install -pm 644 etc/{input,menu}.conf $RPM_BUILD_ROOT%{_sysconfdir}/mplayer/
232 # GUI mplayer
233 install -pm 755 g%{name} $RPM_BUILD_ROOT%{_bindir}/
235 # Default skin
236 install -dm 755 $RPM_BUILD_ROOT%{_datadir}/mplayer/skins
237 tar xjC $RPM_BUILD_ROOT%{_datadir}/mplayer/skins --exclude=.svn -f %{SOURCE1}
238 ln -s Blue $RPM_BUILD_ROOT%{_datadir}/mplayer/skins/default
240 # Icons
241 install -dm 755 $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps
242 install -pm 644 etc/mplayer.xpm \
243 $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps
245 # Desktop file
246 desktop-file-install \
247 --dir $RPM_BUILD_ROOT%{_datadir}/applications \
248 etc/%{name}.desktop
250 # Codec dir
251 install -dm 755 $RPM_BUILD_ROOT%{codecsdir}
254 %post gui
255 gtk-update-icon-cache -qf %{_datadir}/icons/hicolor &>/dev/null || :
256 update-desktop-database &>/dev/null || :
259 %postun gui
260 gtk-update-icon-cache -qf %{_datadir}/icons/hicolor &>/dev/null || :
261 update-desktop-database &>/dev/null || :
264 %clean
265 rm -rf $RPM_BUILD_ROOT
268 %files
269 %defattr(-, root, root, -)
270 %doc AUTHORS Changelog LICENSE README
271 %dir %{_sysconfdir}/mplayer
272 %config(noreplace) %{_sysconfdir}/mplayer/mplayer.conf
273 %config(noreplace) %{_sysconfdir}/mplayer/input.conf
274 %config(noreplace) %{_sysconfdir}/mplayer/menu.conf
275 %{_bindir}/midentify.sh
276 %{_bindir}/mplayer
277 %dir %{codecsdir}/
278 %dir %{_datadir}/mplayer/
279 %{_mandir}/man1/mplayer.1*
280 %lang(cs) %{_mandir}/cs/man1/mplayer.1*
281 %lang(de) %{_mandir}/de/man1/mplayer.1*
282 %lang(es) %{_mandir}/es/man1/mplayer.1*
283 %lang(fr) %{_mandir}/fr/man1/mplayer.1*
284 %lang(hu) %{_mandir}/hu/man1/mplayer.1*
285 %lang(it) %{_mandir}/it/man1/mplayer.1*
286 %lang(pl) %{_mandir}/pl/man1/mplayer.1*
287 %lang(ru) %{_mandir}/ru/man1/mplayer.1*
288 %lang(zh_CN) %{_mandir}/zh_CN/man1/mplayer.1*
290 %files gui
291 %defattr(-, root, root, -)
292 %{_bindir}/gmplayer
293 %{_datadir}/applications/*mplayer.desktop
294 %{_datadir}/icons/hicolor/32x32/apps/mplayer.xpm
295 %{_datadir}/mplayer/skins/
297 %files doc
298 %defattr(-, root, root, -)
299 %doc doc/en/ doc/tech/
300 %lang(cs) %doc doc/cs/
301 %lang(de) %doc doc/de/
302 %lang(es) %doc doc/es/
303 %lang(fr) %doc doc/fr/
304 %lang(hu) %doc doc/hu/
305 %lang(pl) %doc doc/pl/
306 %lang(ru) %doc doc/ru/
307 %lang(zh_CN) %doc doc/zh_CN/
310 %changelog
311 * Sat Oct 06 2007 Dominik Mierzejewski <rpm at greysector.net>
312 - adapted livna specfile for inclusion in SVN