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