]> git.pld-linux.org Git - packages/ffmpeg.git/blame - ffmpeg.spec
- va, vpx, doc bconds
[packages/ffmpeg.git] / ffmpeg.spec
CommitLineData
94447fde 1# TODO
328d1431 2# - libnut enabled no (http://www.nut-container.org/)
197f4211 3#
2b3b2117 4# Conditional build:
0b43f655 5%bcond_with nonfree # non free options of package
294c9b1e
JB
6%bcond_without autoreqdep # don't care about package name deps generated by rpm
7%bcond_without imlib2 # don't build imlib2 vhook module
64f8f109
ER
8%bcond_without va # VAAPI (Video Acceleration API)
9%bcond_without vpx # VP8, a high-quality video codec
10%bcond_without doc # don't build docs
314ef0df 11
85f7cea1 12Summary: FFmpeg is a very fast video and audio converter
adcc0f76 13Summary(pl.UTF-8): Koder audio/wideo czasu rzeczywistego oraz serwer strumieni
9fc4ad22 14Name: ffmpeg
e012ee1c
ER
15Version: 0.6.1
16Release: 1
9cf4d8a4 17# LGPL or GPL, chosen at configure time (GPL version is more featured)
48610c64 18# (postprocessing, ac3, xvid, x264, faad)
0b43f655 19License: GPL v3+ with LGPL v3+ parts
fde29260 20Group: Applications/Multimedia
aed8e8c9 21Source0: http://ffmpeg.mplayerhq.hu/releases/%{name}-%{version}.tar.bz2
e012ee1c 22# Source0-md5: 4f5d732d25eedfb072251b5314ba2093
fde29260
ER
23Source1: ffserver.init
24Source2: ffserver.sysconfig
38cf6de3 25Source3: ffserver.conf
0b43f655 26Patch0: %{name}-bug-803.patch
3a7b84be 27Patch1: %{name}-gsm.patch
5cb3acd0 28Patch2: faadbin-libfaadname.patch
3b92027a 29# vhook is gone. this patch needs different approach
75231f25 30#PatchX: imagewidth.patch
143b0ced
AM
31# http://webm.googlecode.com/files/ffmpeg-0.6_libvpx-0.9.1.diff.gz
32Patch3: ffmpeg-0.6_libvpx-0.9.1.diff
85f7cea1 33URL: http://www.ffmpeg.org/
2a60eebe 34BuildRequires: SDL-devel
7ca51e4c 35BuildRequires: dirac-devel >= 1.0.0
e380e18a 36BuildRequires: faac-devel
b959c224 37BuildRequires: faad2-devel
2a60eebe 38BuildRequires: freetype-devel
4bee03f0
JB
39%ifarch ppc
40# require version with altivec support fixed
41BuildRequires: gcc >= 5:3.3.2-3
42%endif
15c15700 43%{?with_imlib2:BuildRequires: imlib2-devel >= 1.3.0}
e380e18a 44BuildRequires: lame-libs-devel
6382c99d 45BuildRequires: libdc1394-devel
f1669449 46BuildRequires: libgsm-devel
94447fde 47BuildRequires: libraw1394-devel
9042663c 48BuildRequires: libtheora-devel >= 1.0-0.beta3
4814ac84 49BuildRequires: libtool >= 2:1.4d-3
64f8f109 50%{?with_va:BuildRequires: libva-devel >= 1.0.3}
0b43f655 51BuildRequires: libvdpau-devel
e380e18a 52BuildRequires: libvorbis-devel
64f8f109 53%{?with_vpx:BuildRequires: libvpx-devel >= 0.9.1}
d1ecc96e 54# X264_BUILD >= 83
1e2bbb41 55BuildRequires: libx264-devel >= 0.1.3-1.20100424_2245.1
0b43f655
AM
56BuildRequires: opencore-amr-devel
57BuildRequires: openjpeg-devel >= 1.3-2
17a2d1a8 58BuildRequires: speex-devel >= 1:1.2-rc1
e1fe03f7 59%ifarch %{ix86}
60%ifnarch i386 i486
76243dbd
JB
61BuildRequires: nasm
62%endif
e1fe03f7 63%endif
136f0f45 64BuildRequires: perl-Encode
1463656a 65BuildRequires: perl-tools-pod
ef3c0513 66BuildRequires: pkgconfig
db8052c8 67BuildRequires: rpmbuild(macros) >= 1.470
126fb805 68BuildRequires: schroedinger-devel
64f8f109
ER
69%{?with_doc:BuildRequires: tetex}
70%{?with_doc:BuildRequires: texi2html}
71%{?with_doc:BuildRequires: texinfo}
46f2a56b 72BuildRequires: xvid-devel >= 1:1.1.0
33a1c0f3 73BuildRequires: zlib-devel
57ebb8ad 74%{?with_autoreqdep:BuildConflicts: libpostproc}
54ec280e 75Requires: %{name}-libs = %{version}-%{release}
839e806f 76Requires: xvid >= 1:1.1.0
af49d6ab 77Obsoletes: libpostproc
539b540f 78BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
9fc4ad22 79
2a60eebe
JB
80%define _noautoreqdep libGL.so.1 libGLU.so.1
81
c01d7857
PS
82%define specflags -fno-strict-aliasing
83
84# -fomit-frame-pointer is always needed on x86 due to lack of registers (-fPIC takes one)
85%define specflags_ia32 -fomit-frame-pointer
86# -mmmx is needed to enable <mmintrin.h> code.
87%define specflags_i586 -mmmx
88%define specflags_i686 -mmmx
1162803a 89%define specflags_ppc -fPIC
c01d7857 90
9fc4ad22 91%description
85f7cea1
ER
92FFmpeg is a complete solution to record, convert and stream audio and
93video. It is a command line tool to convert one video file format to
94another. It also supports grabbing and encoding in real time from a TV
95card.
9fc4ad22 96
cdb7b42e 97%description -l pl.UTF-8
fda3e16d 98ffmpeg jest bardzo szybkim koderem audio/wideo w czasie rzeczywistym
cdb7b42e
JR
99oraz serwerem strumieni multimedialnych. ffmpeg potrafi zrzucać dane
100ze standardowego urządzenia Video4Linux i przekonwertować je w kilka
101formatów plików bazujących na kodowaniu DCT/kompensacji ruchu. Dźwięk
102jest kompresowany do strumienia MPEG audio layer 2 lub używając
fda3e16d 103strumienia kompatybilnego z AC3.
9fc4ad22 104
54ec280e
PG
105%package libs
106Summary: ffmpeg libraries
adcc0f76 107Summary(pl.UTF-8): Biblioteki ffmpeg
54ec280e 108Group: Libraries
e871e90b 109Suggests: faad2-libs
54ec280e
PG
110
111%description libs
85f7cea1
ER
112This package contains:
113- the codec library from the ffmpeg project. It supports most existing
114 encoding formats (MPEG, DivX, MPEG4, AC3, DV...),
115- demuxer library from the ffmpeg project. It supports most existing
116 file formats (AVI, MPEG, OGG, Matroska, ASF...),
117- video postprocessing library from the ffmpeg project.
54ec280e 118
cdb7b42e
JR
119%description libs -l pl.UTF-8
120Ten pakiet zawiera biblioteki współdzielone ffmpeg.
54ec280e 121
af49d6ab
JB
122%package devel
123Summary: ffmpeg header files
adcc0f76 124Summary(pl.UTF-8): Pliki nagłówkowe ffmpeg
af49d6ab 125Group: Development/Libraries
54ec280e 126Requires: %{name}-libs = %{version}-%{release}
33a1c0f3 127# for libavcodec:
926ffa9a 128Requires: dirac-devel
33a1c0f3 129Requires: faac-devel
96182eea 130Requires: faad2-devel
33a1c0f3 131Requires: lame-libs-devel
bf479bc6 132Requires: libgsm-devel
95e2cf29 133Requires: libraw1394-devel
3e95d354 134Requires: libtheora-devel >= 1.0-0.alpha7
33a1c0f3 135Requires: libvorbis-devel
7bf6921d 136Requires: libx264-devel >= 0.1.2-1.20060828_2245.1
46f2a56b 137Requires: xvid-devel >= 1:1.1.0
33a1c0f3 138Requires: zlib-devel
8152d6a2 139Obsoletes: libpostproc-devel
af49d6ab
JB
140
141%description devel
142ffmpeg header files.
143
cdb7b42e
JR
144%description devel -l pl.UTF-8
145Pliki nagłówkowe ffmpeg.
af49d6ab
JB
146
147%package static
148Summary: ffmpeg static libraries
adcc0f76 149Summary(pl.UTF-8): Statyczne biblioteki ffmpeg
af49d6ab
JB
150Group: Development/Libraries
151Requires: %{name}-devel = %{version}-%{release}
152
153%description static
154ffmpeg static libraries (libavcodec and libavformat).
155
cdb7b42e 156%description static -l pl.UTF-8
af49d6ab
JB
157Statyczne biblioteki ffmpeg (libavcodec i libavformat).
158
2a60eebe
JB
159%package ffplay
160Summary: FFplay - SDL-based media player
adcc0f76 161Summary(pl.UTF-8): FFplay - odtwarzacz mediów oparty na SDL
2a60eebe 162Group: Applications/Multimedia
54ec280e 163Requires: %{name}-libs = %{version}-%{release}
2a60eebe
JB
164
165%description ffplay
166FFplay is a very simple and portable media player using the FFmpeg
167libraries and the SDL library. It is mostly used as a test bench for
168the various APIs of FFmpeg.
169
cdb7b42e
JR
170%description ffplay -l pl.UTF-8
171FFplay to bardzo prosty i przenośny odtwarzacz mediów używający
172bibliotek FFmpeg oraz biblioteki SDL. Jest używany głównie do
173testowania różnych API FFmpeg.
2a60eebe 174
fde29260
ER
175%package ffserver
176Summary: FFserver video server
adcc0f76 177Summary(pl.UTF-8): FFserver - serwer strumieni obrazu
fde29260 178Group: Daemons
593d3a64 179Requires(post,preun): /sbin/chkconfig
67103923 180Requires: %{name}-libs = %{version}-%{release}
2305d791 181Requires: rc-scripts >= 0.4.0.10
fde29260
ER
182
183%description ffserver
184FFserver is a streaming server for both audio and video. It supports
185several live feeds, streaming from files and time shifting on live
186feeds (you can seek to positions in the past on each live feed,
187provided you specify a big enough feed storage in ffserver.conf).
188
cdb7b42e
JR
189%description ffserver -l pl.UTF-8
190FFserver to serwer strumieni dla dźwięku i obrazu. Obsługuje kilka
191źródeł na żywo, przekazywanie strumieni z plików i przesuwanie w
192czasie dla źródeł na żywo (można przeskakiwać na położenia w
193przeszłości dla każdego źródła na żywo, pod warunkiem odpowiednio
194dużej przestrzeni na dane skonfigurowanej w ffserver.conf).
4e0bd1da 195
9fc4ad22 196%prep
aed8e8c9 197%setup -q
f1669449 198%patch0 -p1
3a7b84be 199%patch1 -p0
5cb3acd0 200%patch2 -p1
143b0ced 201%patch3 -p0
9fc4ad22 202
9d4f8977
ER
203# package the grep result for mplayer, the result formatted as ./mplayer/configure
204cat <<EOF > ffmpeg-avconfig
2b2445b7
ER
205#! /bin/sh
206_libavdecoders_all="`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
207_libavencoders_all="`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
208_libavparsers_all="`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
209_libavbsfs_all="`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
210_libavdemuxers_all="`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
211_libavmuxers_all="`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
212_libavprotocols_all="`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
213EOF
9d4f8977 214cat <<'EOF' >> ffmpeg-avconfig
2b2445b7
ER
215
216case "$1" in
217--decoders)
218 echo $_libavdecoders_all
219 ;;
220--encoders)
221 echo $_libavencoders_all
222 ;;
223--parsers)
224 echo $_libavparsers_all
225 ;;
226--bsfs)
227 echo $_libavbsfs_all
228 ;;
229--demuxers)
230 echo $_libavdemuxers_all
231 ;;
232--muxers)
233 echo $_libavmuxers_all
234 ;;
235--protocols)
236 echo $_libavprotocols_all
237 ;;
238*)
239 cat <<USAGE
240Usage: $0 [OPTION]
241Options:
242 --decoders
243 --encoders
244 --parsers
245 --bsfs
246 --demuxers
247 --muxers
248 --protocols
249USAGE
250 exit 1;;
251esac
252
253exit 0
254EOF
255
9fc4ad22 256%build
05e1eb2f
JB
257# notes:
258# - it's not autoconf configure
d0a0ec26 259# - --disable-debug, --disable-optimizations, tune=generic causes not to override our optflags
2080d1d3 260./configure \
b4680d0b 261 --arch=%{_target_base_arch} \
539b540f 262 --prefix=%{_prefix} \
9cf4d8a4 263 --libdir=%{_libdir} \
d81dfa95 264 --shlibdir=%{_libdir} \
2a60eebe 265 --mandir=%{_mandir} \
126fb805 266 --cc="%{__cc}" \
314ef0df 267 --extra-cflags="-D_GNU_SOURCE=1 %{rpmcppflags} %{rpmcflags}" \
1162803a 268 --extra-ldflags="%{rpmcflags} %{rpmldflags}" \
126fb805
JB
269 --disable-debug \
270 --disable-optimizations \
6382c99d 271 --disable-stripping \
314ef0df 272 --enable-avfilter \
126fb805 273 --enable-gpl \
0b43f655 274 --enable-version3 \
32243b76
ER
275 --enable-libdc1394 \
276 --enable-libdirac \
15c15700 277 --enable-libfaad \
e871e90b 278 --enable-libfaadbin \
f3692243 279 --enable-libgsm \
15c15700 280 --enable-libmp3lame \
126fb805 281 --enable-libschroedinger \
da99dcf2 282 --enable-libspeex \
126fb805
JB
283 --enable-libtheora \
284 --enable-libvorbis \
64f8f109 285 %{?with_vpx:--enable-libvpx} \
126fb805
JB
286 --enable-libx264 \
287 --enable-libxvid \
0b43f655
AM
288 --enable-libopencore-amrnb \
289 --enable-libopencore-amrwb \
290 --enable-libopenjpeg \
6382c99d 291 --enable-postproc \
d7493de8 292 --enable-pthreads \
9cf4d8a4 293 --enable-shared \
6382c99d 294 --enable-swscale \
0b43f655 295 --enable-vdpau \
75231f25 296 --enable-x11grab \
7a286645 297%ifnarch %{ix86} %{x8664}
e1fe03f7 298 --disable-mmx \
299%endif
300%ifarch i386 i486
05e1eb2f 301 --disable-mmx \
b524cd99 302%endif
0b43f655 303%if %{with nonfree}
48610c64 304 --enable-nonfree \
0b43f655 305 --enable-libfaac \
76243dbd 306%endif
75231f25 307 --enable-runtime-cpudetect
2305d791 308
da99dcf2
AM
309# force oldscaler build
310sed -i -e 's|#define.*CONFIG_OLDSCALER.*0|#define CONFIG_OLDSCALER 1|g' config.h
311
873cd1c3 312%{__make}
9fc4ad22
AM
313
314%install
315rm -rf $RPM_BUILD_ROOT
38cf6de3 316install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir},/etc/{sysconfig,rc.d/init.d}} \
38baa0f1 317 $RPM_BUILD_ROOT%{_includedir}/ffmpeg \
38cf6de3 318 $RPM_BUILD_ROOT/var/{cache,log}/ffserver
9fc4ad22 319
539b540f 320%{__make} install \
9cf4d8a4 321 DESTDIR=$RPM_BUILD_ROOT
539b540f 322
544421b2
ER
323cp -a config.h $RPM_BUILD_ROOT%{_includedir}/ffmpeg
324cp -a libavutil/intreadwrite.h $RPM_BUILD_ROOT%{_includedir}/libavutil
325cp -a libavutil/bswap.h $RPM_BUILD_ROOT%{_includedir}/libavutil
326cp -a libavutil/common.h $RPM_BUILD_ROOT%{_includedir}/libavutil
327cp -a libavutil/mem.h $RPM_BUILD_ROOT%{_includedir}/libavutil
328for a in libavutil/*/bswap.h; do
329 install -D $a $RPM_BUILD_ROOT%{_includedir}/$a
330done
9d4f8977
ER
331cp -a libavformat/riff.h $RPM_BUILD_ROOT%{_includedir}/libavformat
332cp -a libavformat/avio.h $RPM_BUILD_ROOT%{_includedir}/libavformat
544421b2 333
fde29260
ER
334install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ffserver
335install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ffserver
38cf6de3 336install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/ffserver.conf
539b540f 337mv -f $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/ffserver
9fc4ad22 338
2b2445b7
ER
339# install as ffmpeg-avconfig to avoid with possible programs looking for
340# ffmpeg-config and expecting --libs output from it which is not implemented
341# simple to do (by querying pkgconfig), but why?
9d4f8977 342install ffmpeg-avconfig $RPM_BUILD_ROOT%{_bindir}/ffmpeg-avconfig
2b2445b7 343
9fc4ad22
AM
344%clean
345rm -rf $RPM_BUILD_ROOT
346
3146af55
KK
347%post libs -p /sbin/ldconfig
348%postun libs -p /sbin/ldconfig
539b540f 349
38cf6de3
ER
350%pre ffserver
351%groupadd -g 167 ffserver
352%useradd -g ffserver -u 167 ffserver
353
593d3a64
ER
354%post ffserver
355/sbin/chkconfig --add ffserver
356%service ffserver restart
357
38cf6de3 358%preun ffserver
593d3a64
ER
359if [ "$1" = 0 ]; then
360 %service ffserver stop
361 /sbin/chkconfig --del ffserver
362fi
363
38cf6de3
ER
364%postun ffserver
365if [ "$1" = 0 ]; then
366 %userremove ffserver
367 %groupremove ffserver
368fi
369
9fc4ad22
AM
370%files
371%defattr(644,root,root,755)
64f8f109 372%doc Changelog README %{?with_doc:doc/*.html} doc/TODO
2a60eebe 373%attr(755,root,root) %{_bindir}/ffmpeg
3a7b84be 374%attr(755,root,root) %{_bindir}/ffprobe
da99dcf2
AM
375%dir %{_datadir}/ffmpeg
376%{_datadir}/ffmpeg/*.ffpreset
64f8f109
ER
377%{?with_doc:%{_mandir}/man1/ffmpeg.1*}
378%{?with_doc:%{_mandir}/man1/ffprobe.1*}
54ec280e
PG
379
380%files libs
381%defattr(644,root,root,755)
f50f7d7c 382%attr(755,root,root) %{_libdir}/libavcodec.so.*.*.*
314ef0df 383%attr(755,root,root) %ghost %{_libdir}/libavcodec.so.52
d0a0ec26 384%attr(755,root,root) %{_libdir}/libavdevice.so.*.*.*
314ef0df
ER
385%attr(755,root,root) %ghost %{_libdir}/libavdevice.so.52
386%attr(755,root,root) %{_libdir}/libavfilter.so.*.*.*
3a7b84be 387%attr(755,root,root) %ghost %{_libdir}/libavfilter.so.1
f50f7d7c 388%attr(755,root,root) %{_libdir}/libavformat.so.*.*.*
314ef0df 389%attr(755,root,root) %ghost %{_libdir}/libavformat.so.52
f50f7d7c 390%attr(755,root,root) %{_libdir}/libavutil.so.*.*.*
3a7b84be 391%attr(755,root,root) %ghost %{_libdir}/libavutil.so.50
d7493de8 392%attr(755,root,root) %{_libdir}/libpostproc.so.*.*.*
314ef0df 393%attr(755,root,root) %ghost %{_libdir}/libpostproc.so.51
ee032235 394%attr(755,root,root) %{_libdir}/libswscale.so.*.*.*
314ef0df
ER
395%attr(755,root,root) %ghost %{_libdir}/libswscale.so.0
396
539b540f
JB
397%files devel
398%defattr(644,root,root,755)
54ec280e 399%doc doc/optimization.txt
539b540f 400%attr(755,root,root) %{_libdir}/libavcodec.so
d0a0ec26 401%attr(755,root,root) %{_libdir}/libavdevice.so
314ef0df 402%attr(755,root,root) %{_libdir}/libavfilter.so
539b540f 403%attr(755,root,root) %{_libdir}/libavformat.so
d7493de8 404%attr(755,root,root) %{_libdir}/libavutil.so
d2af4612 405%attr(755,root,root) %{_libdir}/libpostproc.so
ee032235 406%attr(755,root,root) %{_libdir}/libswscale.so
2b2445b7 407%attr(755,root,root) %{_bindir}/ffmpeg-avconfig
539b540f 408%{_includedir}/ffmpeg
6382c99d
AM
409%{_includedir}/libavcodec
410%{_includedir}/libavdevice
314ef0df 411%{_includedir}/libavfilter
6382c99d
AM
412%{_includedir}/libavformat
413%{_includedir}/libavutil
414%{_includedir}/libpostproc
415%{_includedir}/libswscale
d7493de8 416%{_pkgconfigdir}/*.pc
539b540f 417
9cf4d8a4
JB
418%files static
419%defattr(644,root,root,755)
420%{_libdir}/lib*.a
af49d6ab
JB
421
422%files ffplay
423%defattr(644,root,root,755)
424%attr(755,root,root) %{_bindir}/ffplay
64f8f109 425%{?with_doc:%{_mandir}/man1/ffplay.1*}
af49d6ab 426
fde29260
ER
427%files ffserver
428%defattr(644,root,root,755)
429%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ffserver.conf
430%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ffserver
431%attr(755,root,root) %{_sbindir}/ffserver
432%attr(754,root,root) /etc/rc.d/init.d/ffserver
64f8f109 433%{?with_doc:%{_mandir}/man1/ffserver.1*}
38cf6de3
ER
434%dir %attr(770,root,ffserver) /var/cache/ffserver
435%dir %attr(770,root,ffserver) /var/log/ffserver
This page took 0.156172 seconds and 4 git commands to generate.