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