]> git.pld-linux.org Git - packages/libav.git/blame - libav.spec
- up to 9.8
[packages/libav.git] / libav.spec
CommitLineData
55f064f7 1# TODO: avserver no longer supports daemon mode, so adjust init script
97ebd1f2
JB
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.
5#
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
11#
12# Conditional build:
13%bcond_with nonfree # non free options of package (currently: faac)
55f064f7 14%bcond_with fdk_aac # AAC encoding via libfdk_aac (requires nonfree)
97ebd1f2 15%bcond_without frei0r # frei0r video filtering
55f064f7 16%bcond_without ilbc # iLBC de/encoding via WebRTC libilbc
97ebd1f2
JB
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
23
24Summary: libav - Open Source audio and video processing tools
25Summary(pl.UTF-8): libav - narzędzia do przetwarzania dźwięku i obrazu o otwartych źródłach
26Name: libav
1a70671e 27Version: 9.8
97ebd1f2
JB
28Release: 0.1
29# LGPL or GPL, chosen at configure time (GPL version is more featured)
55f064f7 30# (some filters, x264, xavs, xvid, x11grab)
97ebd1f2
JB
31# using v3 allows Apache-licensed libs (opencore-amr, libvo-*enc)
32License: GPL v3+ with LGPL v3+ parts
33Group: Libraries
34Source0: http://libav.org/releases/%{name}-%{version}.tar.xz
1a70671e 35# Source0-md5: 111e9de1aecf4c8269a08453ac671c02
97ebd1f2
JB
36Source1: avserver.init
37Source2: avserver.sysconfig
38Source3: avserver.conf
39Patch0: %{name}-gsm.patch
40Patch1: %{name}-opencv24.patch
41Patch2: %{name}-openjpeg.patch
29cbb532 42Patch3: %{name}-avserver.patch
97ebd1f2
JB
43URL: http://libav.org/
44BuildRequires: SDL-devel >= 1.2.1
45BuildRequires: alsa-lib-devel
46BuildRequires: bzip2-devel
47%{?with_nonfree:BuildRequires: faac-devel}
55f064f7 48%{?with_fdk_aac:BuildRequires: fdk-aac-devel}
97ebd1f2
JB
49BuildRequires: freetype-devel
50%{?with_frei0r:BuildRequires: frei0r-devel}
51%ifarch ppc
52# require version with altivec support fixed
53BuildRequires: gcc >= 5:3.3.2-3
54%endif
55BuildRequires: gnutls-devel
56BuildRequires: jack-audio-connection-kit-devel
57BuildRequires: lame-libs-devel >= 3.98.3
58BuildRequires: libcdio-paranoia-devel >= 0.90-2
59BuildRequires: libdc1394-devel >= 2
60BuildRequires: libgsm-devel
97ebd1f2
JB
61BuildRequires: libraw1394-devel >= 2
62BuildRequires: librtmp-devel
63BuildRequires: libtheora-devel >= 1.0-0.beta3
64BuildRequires: libtool >= 2:1.4d-3
65%{?with_va:BuildRequires: libva-devel >= 1.0.3}
66BuildRequires: libvdpau-devel >= 0.2
67BuildRequires: libvorbis-devel
68%{?with_vpx:BuildRequires: libvpx-devel >= 0.9.1}
69# X264_BUILD >= 118
70%{?with_x264:BuildRequires: libx264-devel >= 0.1.3-1.20111212_2245}
71%ifarch %{ix86}
72%ifnarch i386 i486
73BuildRequires: nasm
74%endif
75%endif
76BuildRequires: opencore-amr-devel
77%{?with_opencv:BuildRequires: opencv-devel}
78BuildRequires: openjpeg-devel >= 1.5
55f064f7 79BuildRequires: opus-devel
97ebd1f2
JB
80BuildRequires: perl-Encode
81BuildRequires: perl-tools-pod
82BuildRequires: pkgconfig
83%{?with_pulseaudio:BuildRequires: pulseaudio-devel}
84BuildRequires: rpmbuild(macros) >= 1.470
85BuildRequires: schroedinger-devel
86BuildRequires: speex-devel >= 1:1.2-rc1
87BuildRequires: tar >= 1:1.22
88%{?with_doc:BuildRequires: tetex}
89%{?with_doc:BuildRequires: texi2html}
90%{?with_doc:BuildRequires: texinfo}
91BuildRequires: vo-aacenc-devel
92BuildRequires: vo-amrwbenc-devel
55f064f7 93%{?with_ilbc:BuildRequires: webrtc-libilbc-devel}
97ebd1f2
JB
94BuildRequires: xavs-devel
95BuildRequires: xorg-lib-libXext-devel
96BuildRequires: xorg-lib-libXfixes-devel
97BuildRequires: xvid-devel >= 1:1.1.0
98BuildRequires: xz
99BuildRequires: yasm
100BuildRequires: zlib-devel
55f064f7 101%{?with_ilbc:Requires: webrtc-libilbc}
97ebd1f2 102Requires: xvid >= 1:1.1.0
97ebd1f2
JB
103BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
104
105%define _noautoreqdep libGL.so.1 libGLU.so.1
106
107%define specflags -fno-strict-aliasing
108
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
115
116%description
117Libav provides cross-platform tools and libraries to convert,
118manipulate and stream a wide range of multimedia formats and
119protocols.
120
121%description -l pl.UTF-8
122Projekt libav udostępnia wieloplatformowe narzędzia i biblioteki do
123konwersji, modyfikowania oraz nadawania strumieni przy użyciu
124szerokiego zakresu formatów i protokołów multimedialnych.
125
126%package devel
127Summary: libav header files
128Summary(pl.UTF-8): Pliki nagłówkowe bibliotek libav
129Group: Development/Libraries
130Requires: %{name} = %{version}-%{release}
131# Libs.private from *.pc (unreasonably they are all the same)
132Requires: SDL-devel >= 1.2.1
133Requires: alsa-lib-devel
134Requires: bzip2-devel
135%{?with_nonfree:Requires: faac-devel}
55f064f7 136%{?with_fdk_aac:Requires: fdk-aac-devel}
97ebd1f2
JB
137Requires: freetype-devel
138Requires: jack-audio-connection-kit-devel
139Requires: lame-libs-devel >= 3.98.3
140Requires: libcdio-paranoia-devel >= 0.90-2
141Requires: libdc1394-devel >= 2
142Requires: libgsm-devel
97ebd1f2
JB
143Requires: libraw1394-devel >= 2
144Requires: librtmp-devel
145Requires: libtheora-devel >= 1.0-0.beta3
146%{?with_va:Requires: libva-devel >= 1.0.3}
147Requires: libvorbis-devel
148%{?with_vpx:Requires: libvpx-devel >= 0.9.1}
149%{?with_x264:Requires: libx264-devel >= 0.1.3-1.20110625_2245}
150Requires: opencore-amr-devel
151%{?with_opencv:Requires: opencv-devel}
152Requires: openjpeg-devel >= 1.5
55f064f7 153Requires: opus-devel
97ebd1f2
JB
154Requires: schroedinger-devel
155Requires: speex-devel >= 1:1.2-rc1
156Requires: vo-aacenc-devel
157Requires: vo-amrwbenc-devel
55f064f7 158%{?with_ilbc:Requires: webrtc-libilbc}
97ebd1f2
JB
159Requires: xavs-devel
160Requires: xorg-lib-libXext-devel
161Requires: xorg-lib-libXfixes-devel
162Requires: xvid-devel >= 1:1.1.0
163Requires: zlib-devel
97ebd1f2
JB
164
165%description devel
166libav header files.
167
168%description devel -l pl.UTF-8
169Pliki nagłówkowe bibliotek libav.
170
171%package static
172Summary: libav static libraries
173Summary(pl.UTF-8): Statyczne biblioteki libav
174Group: Development/Libraries
175Requires: %{name}-devel = %{version}-%{release}
176
177%description static
178libav static libraries.
179
180%description static -l pl.UTF-8
181Statyczne biblioteki libav.
182
183%package tools
184Summary: libav video and audio conversion tools
185Summary(pl.UTF-8): Narzędzia libav do konwersji obrazu i dźwięku
186Group: Applications/Multimedia
187Requires: %{name} = %{version}-%{release}
188
189%description tools
190libav command line tools to convert one video file format to another.
191
192%description tools -l pl.UTF-8
193Narzędzia linii poleceń libav do konwersji filmów z jednego formatu do
194innego.
195
196%package avplay
197Summary: avplay - SDL-based media player
198Summary(pl.UTF-8): avplay - odtwarzacz mediów oparty na SDL
199Group: Applications/Multimedia
200Requires: %{name} = %{version}-%{release}
201
202%description avplay
203avplay is a very simple and portable media player using the libav
204libraries and the SDL library. It is mostly used as a test bench for
205the various APIs of libav.
206
207%description avplay -l pl.UTF-8
208avplay to bardzo prosty i przenośny odtwarzacz mediów używający
209bibliotek libav oraz biblioteki SDL. Jest używany głównie do
210testowania różnych API libav.
211
212%package avserver
213Summary: avserver video server
214Summary(pl.UTF-8): avserver - serwer strumieni obrazu
215Group: Daemons
216Requires(post,preun): /sbin/chkconfig
217Requires: %{name} = %{version}-%{release}
218Requires: rc-scripts >= 0.4.0.10
219
220%description avserver
221avserver is a streaming server for both audio and video. It supports
222several live feeds, streaming from files and time shifting on live
223feeds (you can seek to positions in the past on each live feed,
224provided you specify a big enough feed storage in avserver.conf).
225
226%description avserver -l pl.UTF-8
227avserver 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
229czasie dla źródeł na żywo (można przeskakiwać na położenia w
230przeszłości dla każdego źródła na żywo, pod warunkiem odpowiednio
231dużej przestrzeni na dane skonfigurowanej w avserver.conf).
232
233%prep
234%setup -q
235%patch0 -p1
236%patch1 -p1
237%patch2 -p1
238%patch3 -p1
239
240# package the grep result for mplayer, the result formatted as ./mplayer/configure
241cat <<EOF > libav-avconfig
242#! /bin/sh
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]'`"
250EOF
251cat <<'EOF' >> libav-avconfig
252
253case "$1" in
254--decoders)
255 echo $_libavdecoders_all
256 ;;
257--encoders)
258 echo $_libavencoders_all
259 ;;
260--parsers)
261 echo $_libavparsers_all
262 ;;
263--bsfs)
264 echo $_libavbsfs_all
265 ;;
266--demuxers)
267 echo $_libavdemuxers_all
268 ;;
269--muxers)
270 echo $_libavmuxers_all
271 ;;
272--protocols)
273 echo $_libavprotocols_all
274 ;;
275*)
276 cat <<USAGE
277Usage: $0 [OPTION]
278Options:
279 --decoders
280 --encoders
281 --parsers
282 --bsfs
283 --demuxers
284 --muxers
285 --protocols
286USAGE
287 exit 1;;
288esac
289
290exit 0
291EOF
292
293%build
294# notes:
295# - it's not autoconf configure
296# - --disable-debug, --disable-optimizations, tune=generic causes not to override our optflags
97ebd1f2
JB
297# - openssl is not enabled (gnutls is instead)
298./configure \
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}" \
306 --cc="%{__cc}" \
307 --disable-debug \
308 --disable-optimizations \
309 --enable-avfilter \
310 --enable-gnutls \
311 --enable-gpl \
312 --enable-version3 \
313 %{?with_frei0r:--enable-frei0r} \
314 --enable-libcdio \
315 --enable-libdc1394 \
55f064f7 316 %{?with_fdk_aac:--enable-libfdk-aac} \
97ebd1f2
JB
317 --enable-libfreetype \
318 --enable-libgsm \
55f064f7 319 %{?with_ilbc:--enable-libilbc} \
97ebd1f2 320 --enable-libmp3lame \
97ebd1f2
JB
321 --enable-libopencore-amrnb \
322 --enable-libopencore-amrwb \
323 %{?with_opencv:--enable-libopencv} \
324 --enable-libopenjpeg \
55f064f7 325 --enable-libopus \
97ebd1f2
JB
326 %{?with_pulseaudio:--enable-libpulse} \
327 --enable-librtmp \
328 --enable-libschroedinger \
329 --enable-libspeex \
330 --enable-libtheora \
331 --enable-libvo-aacenc \
332 --enable-libvo-amrwbenc \
333 --enable-libvorbis \
334 %{?with_vpx:--enable-libvpx} \
335 %{?with_x264:--enable-libx264} \
336 --enable-libxavs \
337 --enable-libxvid \
97ebd1f2
JB
338 --enable-pthreads \
339 --enable-shared \
340 --enable-swscale \
341 %{?with_va:--enable-vaapi} \
342 --enable-vdpau \
343 --enable-x11grab \
344%ifnarch %{ix86} %{x8664}
345 --disable-mmx \
346%endif
347%ifarch i386 i486
348 --disable-mmx \
349%endif
350%if %{with nonfree}
351 --enable-nonfree \
352 --enable-libfaac \
353%endif
354 --enable-runtime-cpudetect
355
97ebd1f2
JB
356%{__make} \
357 V=1
358
359# CC_O to add -c to commandline. makefile should be patched
360%{__make} tools/qt-faststart V=1 CC_O='-c -o $@'
361
362%install
363rm -rf $RPM_BUILD_ROOT
364install -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
367
368%{__make} install \
369 DESTDIR=$RPM_BUILD_ROOT \
370 V=1
371
372cp -a config.h $RPM_BUILD_ROOT%{_includedir}/libav
373cp -a libavutil/intreadwrite.h $RPM_BUILD_ROOT%{_includedir}/libavutil
374cp -a libavutil/bswap.h $RPM_BUILD_ROOT%{_includedir}/libavutil
375cp -a libavutil/common.h $RPM_BUILD_ROOT%{_includedir}/libavutil
376cp -a libavutil/mem.h $RPM_BUILD_ROOT%{_includedir}/libavutil
377for a in libavutil/*/bswap.h; do
378 install -D $a $RPM_BUILD_ROOT%{_includedir}/$a
379done
380cp -a libavformat/riff.h $RPM_BUILD_ROOT%{_includedir}/libavformat
381cp -a libavformat/avio.h $RPM_BUILD_ROOT%{_includedir}/libavformat
382# for lim-omx ffmpeg components
383cp -a libavcodec/audioconvert.h $RPM_BUILD_ROOT%{_includedir}/libavcodec
384
385install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/avserver
386cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/avserver
387cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/avserver.conf
388mv -f $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/avserver
389install -p tools/qt-faststart $RPM_BUILD_ROOT%{_bindir}/avqt-faststart
390
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?
394install -p libav-avconfig $RPM_BUILD_ROOT%{_bindir}/libav-avconfig
395
396%clean
397rm -rf $RPM_BUILD_ROOT
398
399%post -p /sbin/ldconfig
400%postun -p /sbin/ldconfig
401
402%pre avserver
403%groupadd -g 167 ffserver
404%useradd -g ffserver -u 167 ffserver
405
406%post avserver
407/sbin/chkconfig --add avserver
408%service avserver restart
409
410%preun avserver
411if [ "$1" = 0 ]; then
412 %service avserver stop
413 /sbin/chkconfig --del avserver
414fi
415
416%postun avserver
417if [ "$1" = 0 ]; then
418 %userremove ffserver
419 %groupremove ffserver
420fi
421
422%files
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.*.*.*
55f064f7 426%attr(755,root,root) %ghost %{_libdir}/libavcodec.so.54
97ebd1f2
JB
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.*.*.*
55f064f7 430%attr(755,root,root) %ghost %{_libdir}/libavfilter.so.3
97ebd1f2 431%attr(755,root,root) %{_libdir}/libavformat.so.*.*.*
55f064f7
JB
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
97ebd1f2 435%attr(755,root,root) %{_libdir}/libavutil.so.*.*.*
55f064f7 436%attr(755,root,root) %ghost %{_libdir}/libavutil.so.52
97ebd1f2
JB
437%attr(755,root,root) %{_libdir}/libswscale.so.*.*.*
438%attr(755,root,root) %ghost %{_libdir}/libswscale.so.2
439
440%files devel
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
55f064f7 448%attr(755,root,root) %{_libdir}/libavresample.so
97ebd1f2 449%attr(755,root,root) %{_libdir}/libavutil.so
97ebd1f2
JB
450%attr(755,root,root) %{_libdir}/libswscale.so
451%{_includedir}/libav
452%{_includedir}/libavcodec
453%{_includedir}/libavdevice
454%{_includedir}/libavfilter
455%{_includedir}/libavformat
55f064f7 456%{_includedir}/libavresample
97ebd1f2 457%{_includedir}/libavutil
97ebd1f2
JB
458%{_includedir}/libswscale
459%{_pkgconfigdir}/libavcodec.pc
460%{_pkgconfigdir}/libavdevice.pc
461%{_pkgconfigdir}/libavfilter.pc
462%{_pkgconfigdir}/libavformat.pc
55f064f7 463%{_pkgconfigdir}/libavresample.pc
97ebd1f2 464%{_pkgconfigdir}/libavutil.pc
97ebd1f2
JB
465%{_pkgconfigdir}/libswscale.pc
466
467%files static
468%defattr(644,root,root,755)
469%{_libdir}/libavcodec.a
470%{_libdir}/libavdevice.a
471%{_libdir}/libavfilter.a
472%{_libdir}/libavformat.a
55f064f7 473%{_libdir}/libavresample.a
97ebd1f2 474%{_libdir}/libavutil.a
97ebd1f2
JB
475%{_libdir}/libswscale.a
476
477%files tools
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
97ebd1f2
JB
482%dir %{_datadir}/avconv
483%{_datadir}/avconv/*.avpreset
484%{?with_doc:%{_mandir}/man1/avconv.1*}
485%{?with_doc:%{_mandir}/man1/avprobe.1*}
97ebd1f2
JB
486
487%files avplay
488%defattr(644,root,root,755)
489%attr(755,root,root) %{_bindir}/avplay
490%{?with_doc:%{_mandir}/man1/avplay.1*}
491
492%files avserver
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
This page took 0.143466 seconds and 4 git commands to generate.