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