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