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