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