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