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