1 # NOTE: don't send it to Th unless you resolve libraries (incl. sonames) conflict with ffmpeg
2 # libav is a fork of ffmpeg; as of Dec 2012 they are not 100% compatible
3 # (e.g. libav didn't drop some deprecated APIs); ffmpeg 1.0.x seems more powerful than libav 0.8.x.
5 # How to deal with ffmpeg/opencv checken-egg problem:
6 # 1. make-request -r --without opencv ffmpeg.spec
7 # 2. make-request -r opencv.spec
8 # 3. bump release of ffmpeg.spec
9 # 4. make-request -r ffmpeg.spec
12 %bcond_with nonfree # non free options of package (currently: faac)
13 %bcond_without frei0r # frei0r video filtering
14 %bcond_without opencv # OpenCV video filtering
15 %bcond_without pulseaudio # PulseAudio input support
16 %bcond_without x264 # x264 encoder
17 %bcond_without va # VAAPI (Video Acceleration API)
18 %bcond_without vpx # VP8, a high-quality video codec
19 %bcond_without doc # don't build docs
21 Summary: libav - Open Source audio and video processing tools
22 Summary(pl.UTF-8): libav - narzędzia do przetwarzania dźwięku i obrazu o otwartych źródłach
26 # LGPL or GPL, chosen at configure time (GPL version is more featured)
27 # (postprocessing, some filters, x264, xavs, xvid, x11grab)
28 # using v3 allows Apache-licensed libs (opencore-amr, libvo-*enc)
29 License: GPL v3+ with LGPL v3+ parts
31 Source0: http://libav.org/releases/%{name}-%{version}.tar.xz
32 # Source0-md5: 4634b35dec327f9aba61b3b894df03f7
33 Source1: avserver.init
34 Source2: avserver.sysconfig
35 Source3: avserver.conf
36 Patch0: %{name}-gsm.patch
37 Patch1: %{name}-opencv24.patch
38 Patch2: %{name}-openjpeg.patch
39 Patch3: %{name}-cdio-paranoia.patch
40 URL: http://libav.org/
41 BuildRequires: SDL-devel >= 1.2.1
42 BuildRequires: alsa-lib-devel
43 BuildRequires: bzip2-devel
44 %{?with_nonfree:BuildRequires: faac-devel}
45 BuildRequires: freetype-devel
46 %{?with_frei0r:BuildRequires: frei0r-devel}
48 # require version with altivec support fixed
49 BuildRequires: gcc >= 5:3.3.2-3
51 BuildRequires: gnutls-devel
52 BuildRequires: jack-audio-connection-kit-devel
53 BuildRequires: lame-libs-devel >= 3.98.3
54 BuildRequires: libcdio-paranoia-devel >= 0.90-2
55 BuildRequires: libdc1394-devel >= 2
56 BuildRequires: libgsm-devel
57 BuildRequires: libnut-devel
58 BuildRequires: libraw1394-devel >= 2
59 BuildRequires: librtmp-devel
60 BuildRequires: libtheora-devel >= 1.0-0.beta3
61 BuildRequires: libtool >= 2:1.4d-3
62 %{?with_va:BuildRequires: libva-devel >= 1.0.3}
63 BuildRequires: libvdpau-devel >= 0.2
64 BuildRequires: libvorbis-devel
65 %{?with_vpx:BuildRequires: libvpx-devel >= 0.9.1}
67 %{?with_x264:BuildRequires: libx264-devel >= 0.1.3-1.20111212_2245}
73 BuildRequires: opencore-amr-devel
74 %{?with_opencv:BuildRequires: opencv-devel}
75 BuildRequires: openjpeg-devel >= 1.5
76 BuildRequires: perl-Encode
77 BuildRequires: perl-tools-pod
78 BuildRequires: pkgconfig
79 %{?with_pulseaudio:BuildRequires: pulseaudio-devel}
80 BuildRequires: rpmbuild(macros) >= 1.470
81 BuildRequires: schroedinger-devel
82 BuildRequires: speex-devel >= 1:1.2-rc1
83 BuildRequires: tar >= 1:1.22
84 %{?with_doc:BuildRequires: tetex}
85 %{?with_doc:BuildRequires: texi2html}
86 %{?with_doc:BuildRequires: texinfo}
87 BuildRequires: vo-aacenc-devel
88 BuildRequires: vo-amrwbenc-devel
89 BuildRequires: xavs-devel
90 BuildRequires: xorg-lib-libXext-devel
91 BuildRequires: xorg-lib-libXfixes-devel
92 BuildRequires: xvid-devel >= 1:1.1.0
95 BuildRequires: zlib-devel
96 Requires: xvid >= 1:1.1.0
97 Obsoletes: libpostproc
98 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
100 %define _noautoreqdep libGL.so.1 libGLU.so.1
102 %define specflags -fno-strict-aliasing
104 # -fomit-frame-pointer is always needed on x86 due to lack of registers (-fPIC takes one)
105 %define specflags_ia32 -fomit-frame-pointer
106 # -mmmx is needed to enable <mmintrin.h> code.
107 %define specflags_i586 -mmmx
108 %define specflags_i686 -mmmx
109 %define specflags_ppc -fPIC
112 Libav provides cross-platform tools and libraries to convert,
113 manipulate and stream a wide range of multimedia formats and
116 %description -l pl.UTF-8
117 Projekt libav udostępnia wieloplatformowe narzędzia i biblioteki do
118 konwersji, modyfikowania oraz nadawania strumieni przy użyciu
119 szerokiego zakresu formatów i protokołów multimedialnych.
122 Summary: libav header files
123 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek libav
124 Group: Development/Libraries
125 Requires: %{name} = %{version}-%{release}
126 # Libs.private from *.pc (unreasonably they are all the same)
127 Requires: SDL-devel >= 1.2.1
128 Requires: alsa-lib-devel
129 Requires: bzip2-devel
130 %{?with_nonfree:Requires: faac-devel}
131 Requires: freetype-devel
132 Requires: jack-audio-connection-kit-devel
133 Requires: lame-libs-devel >= 3.98.3
134 Requires: libcdio-paranoia-devel >= 0.90-2
135 Requires: libdc1394-devel >= 2
136 Requires: libgsm-devel
137 Requires: libnut-devel
138 Requires: libraw1394-devel >= 2
139 Requires: librtmp-devel
140 Requires: libtheora-devel >= 1.0-0.beta3
141 %{?with_va:Requires: libva-devel >= 1.0.3}
142 Requires: libvorbis-devel
143 %{?with_vpx:Requires: libvpx-devel >= 0.9.1}
144 %{?with_x264:Requires: libx264-devel >= 0.1.3-1.20110625_2245}
145 Requires: opencore-amr-devel
146 %{?with_opencv:Requires: opencv-devel}
147 Requires: openjpeg-devel >= 1.5
148 Requires: schroedinger-devel
149 Requires: speex-devel >= 1:1.2-rc1
150 Requires: vo-aacenc-devel
151 Requires: vo-amrwbenc-devel
153 Requires: xorg-lib-libXext-devel
154 Requires: xorg-lib-libXfixes-devel
155 Requires: xvid-devel >= 1:1.1.0
157 Obsoletes: libpostproc-devel
162 %description devel -l pl.UTF-8
163 Pliki nagłówkowe bibliotek libav.
166 Summary: libav static libraries
167 Summary(pl.UTF-8): Statyczne biblioteki libav
168 Group: Development/Libraries
169 Requires: %{name}-devel = %{version}-%{release}
172 libav static libraries.
174 %description static -l pl.UTF-8
175 Statyczne biblioteki libav.
178 Summary: libav video and audio conversion tools
179 Summary(pl.UTF-8): Narzędzia libav do konwersji obrazu i dźwięku
180 Group: Applications/Multimedia
181 Requires: %{name} = %{version}-%{release}
184 libav command line tools to convert one video file format to another.
186 %description tools -l pl.UTF-8
187 Narzędzia linii poleceń libav do konwersji filmów z jednego formatu do
191 Summary: avplay - SDL-based media player
192 Summary(pl.UTF-8): avplay - odtwarzacz mediów oparty na SDL
193 Group: Applications/Multimedia
194 Requires: %{name} = %{version}-%{release}
197 avplay is a very simple and portable media player using the libav
198 libraries and the SDL library. It is mostly used as a test bench for
199 the various APIs of libav.
201 %description avplay -l pl.UTF-8
202 avplay to bardzo prosty i przenośny odtwarzacz mediów używający
203 bibliotek libav oraz biblioteki SDL. Jest używany głównie do
204 testowania różnych API libav.
207 Summary: avserver video server
208 Summary(pl.UTF-8): avserver - serwer strumieni obrazu
210 Requires(post,preun): /sbin/chkconfig
211 Requires: %{name} = %{version}-%{release}
212 Requires: rc-scripts >= 0.4.0.10
214 %description avserver
215 avserver is a streaming server for both audio and video. It supports
216 several live feeds, streaming from files and time shifting on live
217 feeds (you can seek to positions in the past on each live feed,
218 provided you specify a big enough feed storage in avserver.conf).
220 %description avserver -l pl.UTF-8
221 avserver to serwer strumieni dla dźwięku i obrazu. Obsługuje kilka
222 źródeł na żywo, przekazywanie strumieni z plików i przesuwanie w
223 czasie dla źródeł na żywo (można przeskakiwać na położenia w
224 przeszłości dla każdego źródła na żywo, pod warunkiem odpowiednio
225 dużej przestrzeni na dane skonfigurowanej w avserver.conf).
234 # package the grep result for mplayer, the result formatted as ./mplayer/configure
235 cat <<EOF > libav-avconfig
237 _libavdecoders_all="`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
238 _libavencoders_all="`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
239 _libavparsers_all="`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
240 _libavbsfs_all="`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
241 _libavdemuxers_all="`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
242 _libavmuxers_all="`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
243 _libavprotocols_all="`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
245 cat <<'EOF' >> libav-avconfig
249 echo $_libavdecoders_all
252 echo $_libavencoders_all
255 echo $_libavparsers_all
261 echo $_libavdemuxers_all
264 echo $_libavmuxers_all
267 echo $_libavprotocols_all
289 # - it's not autoconf configure
290 # - --disable-debug, --disable-optimizations, tune=generic causes not to override our optflags
291 # - dirac is not enabled (Dirac is supported via schroedinger, dropped in ffmpeg)
292 # - openssl is not enabled (gnutls is instead)
294 --arch=%{_target_base_arch} \
295 --prefix=%{_prefix} \
296 --libdir=%{_libdir} \
297 --shlibdir=%{_libdir} \
298 --mandir=%{_mandir} \
299 --extra-cflags="-D_GNU_SOURCE=1 %{rpmcppflags} %{rpmcflags}" \
300 --extra-ldflags="%{rpmcflags} %{rpmldflags}" \
303 --disable-optimizations \
308 %{?with_frei0r:--enable-frei0r} \
311 --enable-libfreetype \
313 --enable-libmp3lame \
315 --enable-libopencore-amrnb \
316 --enable-libopencore-amrwb \
317 %{?with_opencv:--enable-libopencv} \
318 --enable-libopenjpeg \
319 %{?with_pulseaudio:--enable-libpulse} \
321 --enable-libschroedinger \
324 --enable-libvo-aacenc \
325 --enable-libvo-amrwbenc \
327 %{?with_vpx:--enable-libvpx} \
328 %{?with_x264:--enable-libx264} \
335 %{?with_va:--enable-vaapi} \
338 %ifnarch %{ix86} %{x8664}
348 --enable-runtime-cpudetect
350 # force oldscaler build
351 %{__sed} -i -e 's|#define.*CONFIG_OLDSCALER.*0|#define CONFIG_OLDSCALER 1|g' config.h
356 # CC_O to add -c to commandline. makefile should be patched
357 %{__make} tools/qt-faststart V=1 CC_O='-c -o $@'
360 rm -rf $RPM_BUILD_ROOT
361 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir},/etc/{sysconfig,rc.d/init.d}} \
362 $RPM_BUILD_ROOT%{_includedir}/libav \
363 $RPM_BUILD_ROOT/var/{cache,log}/avserver
366 DESTDIR=$RPM_BUILD_ROOT \
369 cp -a config.h $RPM_BUILD_ROOT%{_includedir}/libav
370 cp -a libavutil/intreadwrite.h $RPM_BUILD_ROOT%{_includedir}/libavutil
371 cp -a libavutil/bswap.h $RPM_BUILD_ROOT%{_includedir}/libavutil
372 cp -a libavutil/common.h $RPM_BUILD_ROOT%{_includedir}/libavutil
373 cp -a libavutil/mem.h $RPM_BUILD_ROOT%{_includedir}/libavutil
374 for a in libavutil/*/bswap.h; do
375 install -D $a $RPM_BUILD_ROOT%{_includedir}/$a
377 cp -a libavformat/riff.h $RPM_BUILD_ROOT%{_includedir}/libavformat
378 cp -a libavformat/avio.h $RPM_BUILD_ROOT%{_includedir}/libavformat
379 # for lim-omx ffmpeg components
380 cp -a libavcodec/audioconvert.h $RPM_BUILD_ROOT%{_includedir}/libavcodec
382 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/avserver
383 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/avserver
384 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/avserver.conf
385 mv -f $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/avserver
386 install -p tools/qt-faststart $RPM_BUILD_ROOT%{_bindir}/avqt-faststart
388 # install as libav-avconfig to avoid with possible programs looking for
389 # libav-config and expecting --libs output from it which is not implemented
390 # simple to do (by querying pkgconfig), but why?
391 install -p libav-avconfig $RPM_BUILD_ROOT%{_bindir}/libav-avconfig
394 rm -rf $RPM_BUILD_ROOT
396 %post -p /sbin/ldconfig
397 %postun -p /sbin/ldconfig
400 %groupadd -g 167 ffserver
401 %useradd -g ffserver -u 167 ffserver
404 /sbin/chkconfig --add avserver
405 %service avserver restart
408 if [ "$1" = 0 ]; then
409 %service avserver stop
410 /sbin/chkconfig --del avserver
414 if [ "$1" = 0 ]; then
416 %groupremove ffserver
420 %defattr(644,root,root,755)
421 %doc CREDITS Changelog LICENSE README doc/{APIchanges,RELEASE_NOTES} %{?with_doc:doc/*.html}
422 %attr(755,root,root) %{_libdir}/libavcodec.so.*.*.*
423 %attr(755,root,root) %ghost %{_libdir}/libavcodec.so.53
424 %attr(755,root,root) %{_libdir}/libavdevice.so.*.*.*
425 %attr(755,root,root) %ghost %{_libdir}/libavdevice.so.53
426 %attr(755,root,root) %{_libdir}/libavfilter.so.*.*.*
427 %attr(755,root,root) %ghost %{_libdir}/libavfilter.so.2
428 %attr(755,root,root) %{_libdir}/libavformat.so.*.*.*
429 %attr(755,root,root) %ghost %{_libdir}/libavformat.so.53
430 %attr(755,root,root) %{_libdir}/libavutil.so.*.*.*
431 %attr(755,root,root) %ghost %{_libdir}/libavutil.so.51
432 %attr(755,root,root) %{_libdir}/libpostproc.so.*.*.*
433 %attr(755,root,root) %ghost %{_libdir}/libpostproc.so.52
434 %attr(755,root,root) %{_libdir}/libswscale.so.*.*.*
435 %attr(755,root,root) %ghost %{_libdir}/libswscale.so.2
438 %defattr(644,root,root,755)
439 %doc doc/optimization.txt
440 %attr(755,root,root) %{_bindir}/libav-avconfig
441 %attr(755,root,root) %{_libdir}/libavcodec.so
442 %attr(755,root,root) %{_libdir}/libavdevice.so
443 %attr(755,root,root) %{_libdir}/libavfilter.so
444 %attr(755,root,root) %{_libdir}/libavformat.so
445 %attr(755,root,root) %{_libdir}/libavutil.so
446 %attr(755,root,root) %{_libdir}/libpostproc.so
447 %attr(755,root,root) %{_libdir}/libswscale.so
449 %{_includedir}/libavcodec
450 %{_includedir}/libavdevice
451 %{_includedir}/libavfilter
452 %{_includedir}/libavformat
453 %{_includedir}/libavutil
454 %{_includedir}/libpostproc
455 %{_includedir}/libswscale
456 %{_pkgconfigdir}/libavcodec.pc
457 %{_pkgconfigdir}/libavdevice.pc
458 %{_pkgconfigdir}/libavfilter.pc
459 %{_pkgconfigdir}/libavformat.pc
460 %{_pkgconfigdir}/libavutil.pc
461 %{_pkgconfigdir}/libpostproc.pc
462 %{_pkgconfigdir}/libswscale.pc
465 %defattr(644,root,root,755)
466 %{_libdir}/libavcodec.a
467 %{_libdir}/libavdevice.a
468 %{_libdir}/libavfilter.a
469 %{_libdir}/libavformat.a
470 %{_libdir}/libavutil.a
471 %{_libdir}/libpostproc.a
472 %{_libdir}/libswscale.a
475 %defattr(644,root,root,755)
476 %attr(755,root,root) %{_bindir}/avconv
477 %attr(755,root,root) %{_bindir}/avprobe
478 %attr(755,root,root) %{_bindir}/avqt-faststart
479 %attr(755,root,root) %{_bindir}/ffmpeg
480 %dir %{_datadir}/avconv
481 %{_datadir}/avconv/*.avpreset
482 %{?with_doc:%{_mandir}/man1/avconv.1*}
483 %{?with_doc:%{_mandir}/man1/avprobe.1*}
484 %{?with_doc:%{_mandir}/man1/ffmpeg.1*}
487 %defattr(644,root,root,755)
488 %attr(755,root,root) %{_bindir}/avplay
489 %{?with_doc:%{_mandir}/man1/avplay.1*}
492 %defattr(644,root,root,755)
493 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/avserver.conf
494 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/avserver
495 %attr(755,root,root) %{_sbindir}/avserver
496 %attr(754,root,root) /etc/rc.d/init.d/avserver
497 %{?with_doc:%{_mandir}/man1/avserver.1*}
498 %dir %attr(770,root,ffserver) /var/cache/avserver
499 %dir %attr(770,root,ffserver) /var/log/avserver