]> git.pld-linux.org Git - packages/ffmpeg.git/blame_incremental - ffmpeg.spec
- updated to 0.11.2
[packages/ffmpeg.git] / ffmpeg.spec
... / ...
CommitLineData
1#
2# How to deal with ffmpeg/opencv checken-egg problem:
3# 1. make-request -r --without opencv ffmpeg.spec
4# 2. make-request -r opencv.spec
5# 3. bump release of ffmpeg.spec
6# 4. make-request -r ffmpeg.spec
7#
8# Conditional build:
9%bcond_with nonfree # non free options of package (currently: faac)
10%bcond_with aacplus # AAC+ encoding via libaacplus (requires nonfree)
11%bcond_without autoreqdep # don't care about package name deps generated by rpm
12%bcond_without frei0r # build without frei0r video filtering
13%bcond_without openal # build without OpenAL 1.1 capture support
14%bcond_without opencv # build without opencv video filtering
15%bcond_without pulseaudio # build without PulseAudio input support
16%bcond_without x264 # build without x264 encoder
17%bcond_without utvideo # build without Ut Video decoder
18%bcond_without va # VAAPI (Video Acceleration API)
19%bcond_without vpx # VP8, a high-quality video codec
20%bcond_without doc # don't build docs
21
22Summary: FFmpeg - a very fast video and audio converter
23Summary(pl.UTF-8): FFmpeg - szybki konwerter audio/wideo
24Name: ffmpeg
25Version: 0.11.2
26Release: 1
27# LGPL or GPL, chosen at configure time (GPL version is more featured)
28# (postprocessing, some filters, x264, xavs, xvid, x11grab)
29# using v3 allows Apache-licensed libs (opencore-amr, libvo-*enc)
30License: GPL v3+ with LGPL v3+ parts
31Group: Applications/Multimedia
32Source0: http://ffmpeg.org/releases/%{name}-%{version}.tar.bz2
33# Source0-md5: 93c1908022567b321df74db7214da6ac
34Source1: ffserver.init
35Source2: ffserver.sysconfig
36Source3: ffserver.conf
37Patch0: %{name}-gsm.patch
38Patch1: %{name}-opencv24.patch
39Patch2: %{name}-openjpeg.patch
40URL: http://www.ffmpeg.org/
41%{?with_openal:BuildRequires: OpenAL-devel}
42BuildRequires: SDL-devel >= 1.2.1
43BuildRequires: alsa-lib-devel
44BuildRequires: bzip2-devel
45BuildRequires: celt-devel >= 0.11.0
46%{?with_nonfree:BuildRequires: faac-devel}
47BuildRequires: fontconfig-devel
48BuildRequires: freetype-devel
49%{?with_frei0r:BuildRequires: frei0r-devel}
50%ifarch ppc
51# require version with altivec support fixed
52BuildRequires: gcc >= 5:3.3.2-3
53%endif
54BuildRequires: gnutls-devel
55BuildRequires: jack-audio-connection-kit-devel
56BuildRequires: lame-libs-devel >= 3.98.3
57%{?with_aacplus:BuildRequires: libaacplus-devel >= 2.0.0}
58BuildRequires: libass-devel
59BuildRequires: libbluray-devel
60BuildRequires: libcdio-devel
61BuildRequires: libdc1394-devel >= 2
62BuildRequires: libgsm-devel
63BuildRequires: libmodplug-devel
64BuildRequires: libnut-devel
65BuildRequires: libraw1394-devel >= 2
66BuildRequires: librtmp-devel
67BuildRequires: libtheora-devel >= 1.0-0.beta3
68BuildRequires: libtool >= 2:1.4d-3
69BuildRequires: libv4l-devel
70%{?with_va:BuildRequires: libva-devel >= 1.0.3}
71BuildRequires: libvdpau-devel >= 0.2
72BuildRequires: libvorbis-devel
73%{?with_vpx:BuildRequires: libvpx-devel >= 0.9.6}
74# X264_BUILD >= 118
75%{?with_x264:BuildRequires: libx264-devel >= 0.1.3-1.20111212_2245}
76BuildRequires: opencore-amr-devel
77%{?with_opencv:BuildRequires: opencv-devel}
78BuildRequires: openjpeg-devel >= 1.5
79%{?with_pulseaudio:BuildRequires: pulseaudio-devel}
80BuildRequires: speex-devel >= 1:1.2-rc1
81%ifarch %{ix86}
82%ifnarch i386 i486
83BuildRequires: nasm
84%endif
85%endif
86BuildRequires: perl-Encode
87BuildRequires: perl-tools-pod
88BuildRequires: pkgconfig
89BuildRequires: rpmbuild(macros) >= 1.470
90BuildRequires: schroedinger-devel
91%{?with_doc:BuildRequires: tetex}
92%{?with_doc:BuildRequires: texi2html}
93%{?with_doc:BuildRequires: texinfo}
94%{?with_utvideo:BuildRequires: utvideo-devel}
95BuildRequires: yasm
96BuildRequires: vo-aacenc-devel
97BuildRequires: vo-amrwbenc-devel
98BuildRequires: xavs-devel
99BuildRequires: xorg-lib-libXext-devel
100BuildRequires: xorg-lib-libXfixes-devel
101BuildRequires: xvid-devel >= 1:1.1.0
102BuildRequires: zlib-devel
103%{?with_autoreqdep:BuildConflicts: libpostproc}
104# overflows maximum hash table size
105BuildConflicts: pdksh < 5.2.14-57
106Requires: %{name}-libs = %{version}-%{release}
107Requires: xvid >= 1:1.1.0
108Obsoletes: libpostproc
109BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
110
111%define _noautoreqdep libGL.so.1 libGLU.so.1
112
113%define specflags -fno-strict-aliasing
114
115# -fomit-frame-pointer is always needed on x86 due to lack of registers (-fPIC takes one)
116%define specflags_ia32 -fomit-frame-pointer
117# -mmmx is needed to enable <mmintrin.h> code.
118%define specflags_i586 -mmmx
119%define specflags_i686 -mmmx
120%define specflags_ppc -fPIC
121
122%description
123FFmpeg is a complete solution to record, convert and stream audio and
124video. It is a command line tool to convert one video file format to
125another. It also supports grabbing and encoding in real time from a TV
126card.
127
128%description -l pl.UTF-8
129FFmpeg to kompletne rozwiązanie nagrywania, konwersji i transmisji
130strumieni dźwięku i obrazu. Jest to działające z linii poleceń
131narzędzie do konwersji obrazu z jednego formatu do innego. Obsługuje
132także przechwytywanie i kodowanie w czasie rzeczywistym z karty
133telewizyjnej.
134
135%package libs
136Summary: ffmpeg libraries
137Summary(pl.UTF-8): Biblioteki ffmpeg
138Group: Libraries
139
140%description libs
141This package contains the ffmpeg shared libraries:
142- the codec library (libavcodec). It supports most existing encoding
143 formats (MPEG, DivX, MPEG4, AC3, DV...),
144- demuxer library (libavformat). It supports most existing file
145 formats (AVI, MPEG, OGG, Matroska, ASF...),
146- video postprocessing library (libpostproc).
147
148%description libs -l pl.UTF-8
149Ten pakiet zawiera biblioteki współdzielone ffmpeg:
150- bibliotekę kodeków (libavcodec); obsługuje większość istniejących
151 formatów kodowania (MPEG, DivX, MPEG4, AC3, DV...),
152- bibliotekę demuksera (libavformat); obsługuje większość istniejących
153 formatów plików (AVI, MPEG, OGG, Matroska, ASF...),
154- bibliotekę postprocessingu (libpostproc).
155
156%package devel
157Summary: ffmpeg header files
158Summary(pl.UTF-8): Pliki nagłówkowe ffmpeg
159Group: Development/Libraries
160Requires: %{name}-libs = %{version}-%{release}
161# Libs.private from *.pc (unreasonably they are all the same)
162Requires: SDL-devel >= 1.2.1
163Requires: alsa-lib-devel
164Requires: bzip2-devel
165Requires: celt-devel >= 0.11.0
166%{?with_nonfree:Requires: faac-devel}
167Requires: fontconfig-devel
168Requires: freetype-devel
169Requires: jack-audio-connection-kit-devel
170Requires: lame-libs-devel >= 3.98.3
171Requires: libbluray-devel
172Requires: libdc1394-devel >= 2
173Requires: libgsm-devel
174Requires: libnut-devel
175Requires: libraw1394-devel >= 2
176Requires: librtmp-devel
177Requires: libtheora-devel >= 1.0-0.beta3
178%{?with_va:Requires: libva-devel >= 1.0.3}
179Requires: libvorbis-devel
180%{?with_vpx:Requires: libvpx-devel >= 0.9.6}
181%{?with_x264:Requires: libx264-devel >= 0.1.3-1.20110625_2245}
182Requires: opencore-amr-devel
183Requires: openjpeg-devel >= 1.5
184Requires: schroedinger-devel
185Requires: speex-devel >= 1:1.2-rc1
186Requires: vo-aacenc-devel
187Requires: vo-amrwbenc-devel
188Requires: xavs-devel
189Requires: xorg-lib-libXext-devel
190Requires: xorg-lib-libXfixes-devel
191Requires: xvid-devel >= 1:1.1.0
192Requires: zlib-devel
193Obsoletes: libpostproc-devel
194
195%description devel
196ffmpeg header files.
197
198%description devel -l pl.UTF-8
199Pliki nagłówkowe ffmpeg.
200
201%package static
202Summary: ffmpeg static libraries
203Summary(pl.UTF-8): Statyczne biblioteki ffmpeg
204Group: Development/Libraries
205Requires: %{name}-devel = %{version}-%{release}
206
207%description static
208ffmpeg static libraries (libavcodec and libavformat).
209
210%description static -l pl.UTF-8
211Statyczne biblioteki ffmpeg (libavcodec i libavformat).
212
213%package ffplay
214Summary: FFplay - SDL-based media player
215Summary(pl.UTF-8): FFplay - odtwarzacz mediów oparty na SDL
216Group: Applications/Multimedia
217Requires: %{name}-libs = %{version}-%{release}
218
219%description ffplay
220FFplay is a very simple and portable media player using the FFmpeg
221libraries and the SDL library. It is mostly used as a test bench for
222the various APIs of FFmpeg.
223
224%description ffplay -l pl.UTF-8
225FFplay to bardzo prosty i przenośny odtwarzacz mediów używający
226bibliotek FFmpeg oraz biblioteki SDL. Jest używany głównie do
227testowania różnych API FFmpeg.
228
229%package ffserver
230Summary: FFserver video server
231Summary(pl.UTF-8): FFserver - serwer strumieni obrazu
232Group: Daemons
233Requires(post,preun): /sbin/chkconfig
234Requires: %{name}-libs = %{version}-%{release}
235Requires: rc-scripts >= 0.4.0.10
236
237%description ffserver
238FFserver is a streaming server for both audio and video. It supports
239several live feeds, streaming from files and time shifting on live
240feeds (you can seek to positions in the past on each live feed,
241provided you specify a big enough feed storage in ffserver.conf).
242
243%description ffserver -l pl.UTF-8
244FFserver to serwer strumieni dla dźwięku i obrazu. Obsługuje kilka
245źródeł na żywo, przekazywanie strumieni z plików i przesuwanie w
246czasie dla źródeł na żywo (można przeskakiwać na położenia w
247przeszłości dla każdego źródła na żywo, pod warunkiem odpowiednio
248dużej przestrzeni na dane skonfigurowanej w ffserver.conf).
249
250%prep
251%setup -q
252%patch0 -p1
253%patch1 -p0
254%patch2 -p1
255
256# package the grep result for mplayer, the result formatted as ./mplayer/configure
257cat <<EOF > ffmpeg-avconfig
258#! /bin/sh
259_libavdecoders_all="`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
260_libavencoders_all="`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
261_libavparsers_all="`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
262_libavbsfs_all="`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
263_libavdemuxers_all="`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
264_libavmuxers_all="`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
265_libavprotocols_all="`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
266EOF
267cat <<'EOF' >> ffmpeg-avconfig
268
269case "$1" in
270--decoders)
271 echo $_libavdecoders_all
272 ;;
273--encoders)
274 echo $_libavencoders_all
275 ;;
276--parsers)
277 echo $_libavparsers_all
278 ;;
279--bsfs)
280 echo $_libavbsfs_all
281 ;;
282--demuxers)
283 echo $_libavdemuxers_all
284 ;;
285--muxers)
286 echo $_libavmuxers_all
287 ;;
288--protocols)
289 echo $_libavprotocols_all
290 ;;
291*)
292 cat <<USAGE
293Usage: $0 [OPTION]
294Options:
295 --decoders
296 --encoders
297 --parsers
298 --bsfs
299 --demuxers
300 --muxers
301 --protocols
302USAGE
303 exit 1;;
304esac
305
306exit 0
307EOF
308
309%build
310# notes:
311# - it's not autoconf configure
312# - --disable-debug, --disable-optimizations, tune=generic causes not to override our optflags
313./configure \
314 --arch=%{_target_base_arch} \
315 --prefix=%{_prefix} \
316 --libdir=%{_libdir} \
317 --shlibdir=%{_libdir} \
318 --mandir=%{_mandir} \
319 --extra-cflags="-D_GNU_SOURCE=1 %{rpmcppflags} %{rpmcflags}" \
320 --extra-ldflags="%{rpmcflags} %{rpmldflags}" \
321 --cc="%{__cc}" \
322 --disable-debug \
323 --disable-optimizations \
324 --disable-stripping \
325 --enable-avfilter \
326 --enable-avresample \
327 --enable-gnutls \
328 --enable-gpl \
329 --enable-version3 \
330 --enable-fontconfig \
331 %{?with_frei0r:--enable-frei0r} \
332 %{?with_aacplus:--enable-libaacplus} \
333 --enable-libass \
334 --enable-libbluray \
335 --enable-libcelt \
336 --enable-libcdio \
337 --enable-libdc1394 \
338 --enable-libfreetype \
339 --enable-libgsm \
340 --enable-libmodplug \
341 --enable-libmp3lame \
342 --enable-libnut \
343 --enable-libopencore-amrnb \
344 --enable-libopencore-amrwb \
345 %{?with_opencv:--enable-libopencv} \
346 --enable-libopenjpeg \
347 %{?with_pulseaudio:--enable-libpulse} \
348 --enable-librtmp \
349 --enable-libschroedinger \
350 --enable-libspeex \
351 --enable-libtheora \
352 %{?with_utvideo:--enable-libutvideo} \
353 --enable-libv4l2 \
354 --enable-libvo-aacenc \
355 --enable-libvo-amrwbenc \
356 --enable-libvorbis \
357 %{?with_vpx:--enable-libvpx} \
358 %{?with_x264:--enable-libx264} \
359 --enable-libxavs \
360 --enable-libxvid \
361 %{?with_openal:--enable-openal} \
362 --enable-postproc \
363 --enable-pthreads \
364 --enable-shared \
365 --enable-swscale \
366 --enable-vdpau \
367 --enable-x11grab \
368%ifnarch %{ix86} %{x8664}
369 --disable-mmx \
370%endif
371%ifarch i386 i486
372 --disable-mmx \
373%endif
374%if %{with nonfree}
375 --enable-nonfree \
376 --enable-libfaac \
377%endif
378 --enable-runtime-cpudetect
379
380# force oldscaler build
381%{__sed} -i -e 's|#define.*CONFIG_OLDSCALER.*0|#define CONFIG_OLDSCALER 1|g' config.h
382
383%{__make} \
384 V=1
385
386# CC_O to add -c to commandline. makefile should be patched
387%{__make} tools/qt-faststart V=1 CC_O='-c -o $@'
388
389%install
390rm -rf $RPM_BUILD_ROOT
391install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir},/etc/{sysconfig,rc.d/init.d}} \
392 $RPM_BUILD_ROOT%{_includedir}/ffmpeg \
393 $RPM_BUILD_ROOT/var/{cache,log}/ffserver
394
395%{__make} install \
396 DESTDIR=$RPM_BUILD_ROOT \
397 V=1
398
399cp -a config.h $RPM_BUILD_ROOT%{_includedir}/ffmpeg
400cp -a libavutil/intreadwrite.h $RPM_BUILD_ROOT%{_includedir}/libavutil
401cp -a libavutil/bswap.h $RPM_BUILD_ROOT%{_includedir}/libavutil
402cp -a libavutil/common.h $RPM_BUILD_ROOT%{_includedir}/libavutil
403cp -a libavutil/mem.h $RPM_BUILD_ROOT%{_includedir}/libavutil
404for a in libavutil/*/bswap.h; do
405 install -D $a $RPM_BUILD_ROOT%{_includedir}/$a
406done
407cp -a libavformat/riff.h $RPM_BUILD_ROOT%{_includedir}/libavformat
408cp -a libavformat/avio.h $RPM_BUILD_ROOT%{_includedir}/libavformat
409# for lim-omx ffmpeg components
410cp -a libavcodec/audioconvert.h $RPM_BUILD_ROOT%{_includedir}/libavcodec
411
412install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ffserver
413cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ffserver
414cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/ffserver.conf
415mv -f $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/ffserver
416install -p tools/qt-faststart $RPM_BUILD_ROOT%{_bindir}
417
418# install as ffmpeg-avconfig to avoid with possible programs looking for
419# ffmpeg-config and expecting --libs output from it which is not implemented
420# simple to do (by querying pkgconfig), but why?
421install -p ffmpeg-avconfig $RPM_BUILD_ROOT%{_bindir}/ffmpeg-avconfig
422
423%clean
424rm -rf $RPM_BUILD_ROOT
425
426%post libs -p /sbin/ldconfig
427%postun libs -p /sbin/ldconfig
428
429%pre ffserver
430%groupadd -g 167 ffserver
431%useradd -g ffserver -u 167 ffserver
432
433%post ffserver
434/sbin/chkconfig --add ffserver
435%service ffserver restart
436
437%preun ffserver
438if [ "$1" = 0 ]; then
439 %service ffserver stop
440 /sbin/chkconfig --del ffserver
441fi
442
443%postun ffserver
444if [ "$1" = 0 ]; then
445 %userremove ffserver
446 %groupremove ffserver
447fi
448
449%files
450%defattr(644,root,root,755)
451%doc CREDITS LICENSE MAINTAINERS README doc/{APIchanges,RELEASE_NOTES} %{?with_doc:doc/*.html}
452%attr(755,root,root) %{_bindir}/ffmpeg
453%attr(755,root,root) %{_bindir}/ffprobe
454%attr(755,root,root) %{_bindir}/qt-faststart
455%dir %{_datadir}/ffmpeg
456%{_datadir}/ffmpeg/*.ffpreset
457%{_datadir}/ffmpeg/ffprobe.xsd
458%{?with_doc:%{_mandir}/man1/ffmpeg.1*}
459%{?with_doc:%{_mandir}/man1/ffprobe.1*}
460
461%files libs
462%defattr(644,root,root,755)
463%attr(755,root,root) %{_libdir}/libavcodec.so.*.*.*
464%attr(755,root,root) %ghost %{_libdir}/libavcodec.so.54
465%attr(755,root,root) %{_libdir}/libavdevice.so.*.*.*
466%attr(755,root,root) %ghost %{_libdir}/libavdevice.so.54
467%attr(755,root,root) %{_libdir}/libavfilter.so.*.*.*
468%attr(755,root,root) %ghost %{_libdir}/libavfilter.so.2
469%attr(755,root,root) %{_libdir}/libavformat.so.*.*.*
470%attr(755,root,root) %ghost %{_libdir}/libavformat.so.54
471%attr(755,root,root) %{_libdir}/libavresample.so.*.*.*
472%attr(755,root,root) %ghost %{_libdir}/libavresample.so.0
473%attr(755,root,root) %{_libdir}/libavutil.so.*.*.*
474%attr(755,root,root) %ghost %{_libdir}/libavutil.so.51
475%attr(755,root,root) %{_libdir}/libpostproc.so.*.*.*
476%attr(755,root,root) %ghost %{_libdir}/libpostproc.so.52
477%attr(755,root,root) %{_libdir}/libswresample.so.*.*.*
478%attr(755,root,root) %ghost %{_libdir}/libswresample.so.0
479%attr(755,root,root) %{_libdir}/libswscale.so.*.*.*
480%attr(755,root,root) %ghost %{_libdir}/libswscale.so.2
481
482%files devel
483%defattr(644,root,root,755)
484%doc doc/optimization.txt
485%attr(755,root,root) %{_bindir}/ffmpeg-avconfig
486%attr(755,root,root) %{_libdir}/libavcodec.so
487%attr(755,root,root) %{_libdir}/libavdevice.so
488%attr(755,root,root) %{_libdir}/libavfilter.so
489%attr(755,root,root) %{_libdir}/libavformat.so
490%attr(755,root,root) %{_libdir}/libavresample.so
491%attr(755,root,root) %{_libdir}/libavutil.so
492%attr(755,root,root) %{_libdir}/libpostproc.so
493%attr(755,root,root) %{_libdir}/libswresample.so
494%attr(755,root,root) %{_libdir}/libswscale.so
495%{_includedir}/ffmpeg
496%{_includedir}/libavcodec
497%{_includedir}/libavdevice
498%{_includedir}/libavfilter
499%{_includedir}/libavformat
500%{_includedir}/libavresample
501%{_includedir}/libavutil
502%{_includedir}/libpostproc
503%{_includedir}/libswresample
504%{_includedir}/libswscale
505%{_pkgconfigdir}/libavcodec.pc
506%{_pkgconfigdir}/libavdevice.pc
507%{_pkgconfigdir}/libavfilter.pc
508%{_pkgconfigdir}/libavformat.pc
509%{_pkgconfigdir}/libavresample.pc
510%{_pkgconfigdir}/libavutil.pc
511%{_pkgconfigdir}/libpostproc.pc
512%{_pkgconfigdir}/libswresample.pc
513%{_pkgconfigdir}/libswscale.pc
514
515%files static
516%defattr(644,root,root,755)
517%{_libdir}/libavcodec.a
518%{_libdir}/libavdevice.a
519%{_libdir}/libavfilter.a
520%{_libdir}/libavformat.a
521%{_libdir}/libavresample.a
522%{_libdir}/libavutil.a
523%{_libdir}/libpostproc.a
524%{_libdir}/libswresample.a
525%{_libdir}/libswscale.a
526
527%files ffplay
528%defattr(644,root,root,755)
529%attr(755,root,root) %{_bindir}/ffplay
530%{?with_doc:%{_mandir}/man1/ffplay.1*}
531
532%files ffserver
533%defattr(644,root,root,755)
534%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ffserver.conf
535%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ffserver
536%attr(755,root,root) %{_sbindir}/ffserver
537%attr(754,root,root) /etc/rc.d/init.d/ffserver
538%{?with_doc:%{_mandir}/man1/ffserver.1*}
539%dir %attr(770,root,ffserver) /var/cache/ffserver
540%dir %attr(770,root,ffserver) /var/log/ffserver
This page took 0.036868 seconds and 4 git commands to generate.