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