]> git.pld-linux.org Git - packages/ffmpeg.git/blame - ffmpeg.spec
- release 2
[packages/ffmpeg.git] / ffmpeg.spec
CommitLineData
197f4211 1#
5663f846 2# How to deal with ffmpeg/opencv checken-egg problem:
29c7bf5c 3# 1. make-request -r --with bootstrap ffmpeg.spec
192f9f57 4# 2. make-request -r opencv.spec
5# 3. bump release of ffmpeg.spec
6# 4. make-request -r ffmpeg.spec
7#
2b3b2117 8# Conditional build:
29c7bf5c 9%bcond_with bootstrap # disable features to able to build without installed ffmpeg
38cefaee 10%bcond_with nonfree # non free options of package (currently: faac)
2e585b44 11%bcond_with aacplus # AAC+ encoding via libaacplus (requires nonfree)
5f3dc7d9 12%bcond_with fdk_aac # AAC de/encoding via libfdk_aac (requires nonfree)
4474c07d 13%bcond_without bs2b # BS2B audio filter support
1c1d1368 14%bcond_without caca # textual display using libcaca
fecf9f23 15%bcond_without dcadec # DCA decoding via libdcadec
f6f5022a 16%bcond_without decklink # Blackmagic DeskLink output support
a584ded4
JB
17%bcond_without flite # flite voice synthesis support
18%bcond_without frei0r # frei0r video filtering
4474c07d 19%bcond_without fribidi # fribidi support
22745365 20%bcond_without gme # Game Music Emu support
cbeed0a5 21%bcond_without ilbc # iLBC de/encoding via WebRTC libilbc
7160e157 22%bcond_without kvazaar # Kvazaar HEVC encoder support
5f3dc7d9 23%bcond_without ladspa # LADSPA audio filtering
0258feb8
JB
24%bcond_with mfx # MFX hardware acceleration support
25%bcond_with nvenc # NVIDIA NVENC support (requires nonfree)
a584ded4 26%bcond_without openal # OpenAL 1.1 capture support
6513d7e3 27%bcond_without opencl # OpenCL 1.2 code
a584ded4 28%bcond_without opencv # OpenCV video filtering
0258feb8
JB
29%bcond_without opengl # OpenGL rendering support
30%bcond_with openh264 # OpenH264 H.264 encoder
a584ded4 31%bcond_without pulseaudio # PulseAudio input support
22745365 32%bcond_without quvi # quvi input support
f56b6dce 33%bcond_without shine # shine fixed-point MP3 encoder
7160e157 34%bcond_without snappy # Snappy compression support (needed for hap encoding)
0258feb8 35%bcond_without ssh # SFTP protocol support via libssh
4474c07d 36%bcond_with smb # SMB support via libsmbclient
05408820 37%bcond_without soxr # SoX Resampler support
8b9d2787 38%bcond_without x264 # H.264 x264 encoder
90ab353a 39%bcond_without x265 # H.265/HEVC x265 encoder
a584ded4 40%bcond_without utvideo # Ut Video decoder
1ef27ea1 41%bcond_without va # VAAPI (Video Acceleration API)
f56b6dce 42%bcond_without vidstab # vid.stab video stabilization support
1ef27ea1 43%bcond_without vpx # VP8, a high-quality video codec
22745365 44%bcond_without wavpack # wavpack encoding support
8b9d2787 45%bcond_without webp # WebP encoding support
6a6b11be 46%bcond_without zmq # 0MQ message passing
5f3dc7d9 47%bcond_without zvbi # teletext via libzvbi
1ef27ea1 48%bcond_without doc # don't build docs
560d82ce 49%bcond_with tests # "make check" (some tests fail as of 2.5)
314ef0df 50
29c7bf5c
ER
51%if %{with bootstrap}
52%undefine with_opencv
53%endif
54
a6755e78
JB
55%ifnarch %{ix86} %{x8664} arm
56%undefine with_x265
57%endif
58%ifarch i386 i486
59%undefine with_x265
60%endif
cbdd2688
JB
61Summary: FFmpeg - a very fast video and audio converter
62Summary(pl.UTF-8): FFmpeg - szybki konwerter audio/wideo
9fc4ad22 63Name: ffmpeg
1565fd2f 64Version: 2.8.1
7d250ea3 65Release: 2
9cf4d8a4 66# LGPL or GPL, chosen at configure time (GPL version is more featured)
8b9d2787 67# (postprocessing, some filters, x264, x265, xavs, xvid, x11grab)
38cefaee 68# using v3 allows Apache-licensed libs (opencore-amr, libvo-*enc)
0b43f655 69License: GPL v3+ with LGPL v3+ parts
fde29260 70Group: Applications/Multimedia
1ef27ea1 71Source0: http://ffmpeg.org/releases/%{name}-%{version}.tar.bz2
1565fd2f 72# Source0-md5: 63b2cfeea930e942ff7579fd0064c5be
fde29260
ER
73Source1: ffserver.init
74Source2: ffserver.sysconfig
38cf6de3 75Source3: ffserver.conf
7160e157 76Patch0: %{name}-kvazaar.patch
85f7cea1 77URL: http://www.ffmpeg.org/
f6f5022a 78%{?with_decklink:BuildRequires: Blackmagic_DeckLink_SDK}
28673856 79%{?with_openal:BuildRequires: OpenAL-devel >= 1.1}
6a6b11be 80%{?with_opencl:BuildRequires: OpenCL-devel >= 1.2}
8b9d2787 81%{?with_opengl:BuildRequires: OpenGL-GLX-devel}
3dcb8642 82BuildRequires: SDL-devel >= 1.2.1
cbdd2688 83BuildRequires: alsa-lib-devel
38cefaee 84BuildRequires: bzip2-devel
9f9ba8ac 85BuildRequires: celt-devel >= 0.11.0
fecf9f23 86%{?with_dcadec:BuildRequires: dcadec-devel}
38cefaee 87%{?with_nonfree:BuildRequires: faac-devel}
004e5628 88%{?with_fdk_aac:BuildRequires: fdk-aac-devel}
a584ded4 89%{?with_flite:BuildRequires: flite-devel >= 1.4}
3dcb8642 90BuildRequires: fontconfig-devel
0aad4bf2 91BuildRequires: freetype-devel
d7a39558 92%{?with_frei0r:BuildRequires: frei0r-devel}
4474c07d 93%{?with_fribidi:BuildRequires: fribidi-devel}
22745365 94%{?with_gme:BuildRequires: game-music-emu-devel}
4bee03f0
JB
95%ifarch ppc
96# require version with altivec support fixed
97BuildRequires: gcc >= 5:3.3.2-3
98%endif
fecf9f23 99BuildRequires: gmp-devel
d5aef92e 100BuildRequires: gnutls-devel
cbdd2688 101BuildRequires: jack-audio-connection-kit-devel
7160e157 102%{?with_kvazaar:BuildRequires: kvazaar-devel >= 0.7}
5f3dc7d9 103%{?with_ladspa:BuildRequires: ladspa-devel}
cbdd2688 104BuildRequires: lame-libs-devel >= 3.98.3
2e585b44 105%{?with_aacplus:BuildRequires: libaacplus-devel >= 2.0.0}
d5aef92e 106BuildRequires: libass-devel
1c1d1368 107BuildRequires: libavc1394-devel
4474c07d 108%{?with_bs2b:BuildRequires: libbs2b-devel}
3dcb8642 109BuildRequires: libbluray-devel
1c1d1368 110%{?with_caca:BuildRequires: libcaca-devel}
a09e741c 111BuildRequires: libcdio-paranoia-devel >= 0.90-2
9c4296c2 112BuildRequires: libdc1394-devel >= 2
f1669449 113BuildRequires: libgsm-devel
1c1d1368 114BuildRequires: libiec61883-devel
d5aef92e 115BuildRequires: libmodplug-devel
4a927f9d 116BuildRequires: libnut-devel
22745365 117%{?with_quvi:BuildRequires: libquvi-devel}
7571bfa0 118BuildRequires: libraw1394-devel >= 2
cbdd2688 119BuildRequires: librtmp-devel
5f3dc7d9 120%{?with_ssh:BuildRequires: libssh-devel}
4474c07d 121%{?with_smb:BuildRequires: libsmbclient-devel}
9042663c 122BuildRequires: libtheora-devel >= 1.0-0.beta3
4814ac84 123BuildRequires: libtool >= 2:1.4d-3
daf9a670 124BuildRequires: libv4l-devel
64f8f109 125%{?with_va:BuildRequires: libva-devel >= 1.0.3}
9c4296c2 126BuildRequires: libvdpau-devel >= 0.2
e380e18a 127BuildRequires: libvorbis-devel
1be5865c 128%{?with_vpx:BuildRequires: libvpx-devel >= 1.3.0}
fecf9f23 129%{?with_webp:BuildRequires: libwebp-devel >= 0.4.0}
660918c5
AM
130# X264_BUILD >= 118
131%{?with_x264:BuildRequires: libx264-devel >= 0.1.3-1.20111212_2245}
fecf9f23 132# X265_BUILD >= 57
7d10e69e 133%{?with_x265:BuildRequires: libx265-devel >= 1.3-0.20150610.1}
560d82ce 134# libxcb xcb-shm xcb-xfixes xcb-shape
0258feb8
JB
135BuildRequires: libxcb-devel >= 1.4
136%{?with_mfx:BuildRequires: mfx_dispatch-devel}
e1fe03f7 137%ifarch %{ix86}
138%ifnarch i386 i486
76243dbd
JB
139BuildRequires: nasm
140%endif
e1fe03f7 141%endif
0258feb8
JB
142# which package?
143#%{?with_nvenc:BuildRequires: NVIDIA-NVENC-API}
1c1d1368
JB
144BuildRequires: opencore-amr-devel
145%{?with_opencv:BuildRequires: opencv-devel}
62da4e00 146%{?with_openh264:BuildRequires: openh264-devel >= 1.3}
1c1d1368
JB
147BuildRequires: openjpeg-devel >= 1.5
148BuildRequires: opus-devel
136f0f45 149BuildRequires: perl-Encode
1463656a 150BuildRequires: perl-tools-pod
ef3c0513 151BuildRequires: pkgconfig
1c1d1368 152%{?with_pulseaudio:BuildRequires: pulseaudio-devel}
db8052c8 153BuildRequires: rpmbuild(macros) >= 1.470
126fb805 154BuildRequires: schroedinger-devel
4a11c99e 155%{?with_shine:BuildRequires: shine-devel >= 3.0.0}
7160e157 156%{?with_snappy:BuildRequires: snappy-devel}
05408820 157%{?with_soxr:BuildRequires: soxr-devel}
1c1d1368 158BuildRequires: speex-devel >= 1:1.2-rc1
64f8f109
ER
159%{?with_doc:BuildRequires: tetex}
160%{?with_doc:BuildRequires: texi2html}
161%{?with_doc:BuildRequires: texinfo}
1c1d1368 162BuildRequires: twolame-devel
05408820 163%{?with_utvideo:BuildRequires: utvideo-devel >= 12}
9befe454 164%{?with_vidstab:BuildRequires: vid.stab-devel >= 0.98}
5dc039cb
JB
165BuildRequires: vo-aacenc-devel
166BuildRequires: vo-amrwbenc-devel
22745365 167%{?with_wavpack:BuildRequires: wavpack-devel}
cbeed0a5 168%{?with_ilbc:BuildRequires: webrtc-libilbc-devel}
5dc039cb 169BuildRequires: xavs-devel
28673856 170BuildRequires: xorg-lib-libX11-devel
cbdd2688
JB
171BuildRequires: xorg-lib-libXext-devel
172BuildRequires: xorg-lib-libXfixes-devel
46f2a56b 173BuildRequires: xvid-devel >= 1:1.1.0
cbeed0a5 174BuildRequires: yasm
6a6b11be 175%{?with_zmq:BuildRequires: zeromq-devel}
5f3dc7d9 176%{?with_zvbi:BuildRequires: zvbi-devel}
33a1c0f3 177BuildRequires: zlib-devel
57ebb8ad 178%{?with_autoreqdep:BuildConflicts: libpostproc}
9c4296c2
JB
179# overflows maximum hash table size
180BuildConflicts: pdksh < 5.2.14-57
54ec280e 181Requires: %{name}-libs = %{version}-%{release}
05408820 182%{?with_utvideo:Requires: utvideo >= 12}
92a3edff 183%{?with_ilbc:Requires: webrtc-libilbc}
839e806f 184Requires: xvid >= 1:1.1.0
af49d6ab 185Obsoletes: libpostproc
539b540f 186BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
9fc4ad22 187
2a60eebe
JB
188%define _noautoreqdep libGL.so.1 libGLU.so.1
189
c01d7857
PS
190%define specflags -fno-strict-aliasing
191
192# -fomit-frame-pointer is always needed on x86 due to lack of registers (-fPIC takes one)
193%define specflags_ia32 -fomit-frame-pointer
194# -mmmx is needed to enable <mmintrin.h> code.
195%define specflags_i586 -mmmx
196%define specflags_i686 -mmmx
1162803a 197%define specflags_ppc -fPIC
c01d7857 198
9fc4ad22 199%description
85f7cea1
ER
200FFmpeg is a complete solution to record, convert and stream audio and
201video. It is a command line tool to convert one video file format to
202another. It also supports grabbing and encoding in real time from a TV
203card.
9fc4ad22 204
cdb7b42e 205%description -l pl.UTF-8
cbdd2688
JB
206FFmpeg to kompletne rozwiązanie nagrywania, konwersji i transmisji
207strumieni dźwięku i obrazu. Jest to działające z linii poleceń
208narzędzie do konwersji obrazu z jednego formatu do innego. Obsługuje
209także przechwytywanie i kodowanie w czasie rzeczywistym z karty
210telewizyjnej.
9fc4ad22 211
54ec280e
PG
212%package libs
213Summary: ffmpeg libraries
adcc0f76 214Summary(pl.UTF-8): Biblioteki ffmpeg
1be5865c 215Group: Libraries
143c6eec
JB
216%if "%(rpm -q --qf '%{V}' gnutls-devel)" >= "3.0.20"
217# uses gnutls_certificate_set_x509_system_trust if >= 3.0.20
f9cce0c9 218Requires: gnutls-libs >= 3.0.20
143c6eec 219%endif
1be5865c 220%{?with_vpx:Requires: libvpx >= 1.3.0}
54ec280e
PG
221
222%description libs
cbdd2688
JB
223This package contains the ffmpeg shared libraries:
224- the codec library (libavcodec). It supports most existing encoding
225 formats (MPEG, DivX, MPEG4, AC3, DV...),
226- demuxer library (libavformat). It supports most existing file
227 formats (AVI, MPEG, OGG, Matroska, ASF...),
228- video postprocessing library (libpostproc).
54ec280e 229
cdb7b42e 230%description libs -l pl.UTF-8
cbdd2688
JB
231Ten pakiet zawiera biblioteki współdzielone ffmpeg:
232- bibliotekę kodeków (libavcodec); obsługuje większość istniejących
233 formatów kodowania (MPEG, DivX, MPEG4, AC3, DV...),
234- bibliotekę demuksera (libavformat); obsługuje większość istniejących
235 formatów plików (AVI, MPEG, OGG, Matroska, ASF...),
236- bibliotekę postprocessingu (libpostproc).
54ec280e 237
af49d6ab
JB
238%package devel
239Summary: ffmpeg header files
adcc0f76 240Summary(pl.UTF-8): Pliki nagłówkowe ffmpeg
af49d6ab 241Group: Development/Libraries
54ec280e 242Requires: %{name}-libs = %{version}-%{release}
38cefaee 243# Libs.private from *.pc (unreasonably they are all the same)
6a6b11be 244%{?with_opencl:Requires: OpenCL-devel >= 1.2}
f6f5022a 245%{?with_opengl:Requires: OpenGL-devel}
3dcb8642 246Requires: SDL-devel >= 1.2.1
38cefaee
JB
247Requires: alsa-lib-devel
248Requires: bzip2-devel
9c4296c2 249Requires: celt-devel >= 0.11.0
fecf9f23 250%{?with_dcadec:Requires: dcadec-devel}
38cefaee 251%{?with_nonfree:Requires: faac-devel}
004e5628 252%{?with_fdk_aac:Requires: fdk-aac-devel}
4b05ede1 253%{?with_flite:Requires: flite-devel >= 1.4}
3dcb8642 254Requires: fontconfig-devel
0aad4bf2 255Requires: freetype-devel
4474c07d 256%{?with_fribidi:Requires: fribidi-devel}
22745365 257%{?with_gme:Requires: game-music-emu-devel}
38cefaee 258Requires: jack-audio-connection-kit-devel
7160e157 259%{?with_kvazaar:Requires: kvazaar-devel >= 0.7}
38cefaee 260Requires: lame-libs-devel >= 3.98.3
1c1d1368
JB
261%{?with_aacplus:Requires: libaacplus-devel >= 2.0.0}
262Requires: libass-devel
263Requires: libavc1394-devel
3dcb8642 264Requires: libbluray-devel
4474c07d 265%{?with_bs2b:Requires: libbs2b-devel}
28673856 266%{?with_caca:Requires: libcaca-devel}
a09e741c 267Requires: libcdio-paranoia-devel >= 0.90-2
9c4296c2 268Requires: libdc1394-devel >= 2
bf479bc6 269Requires: libgsm-devel
1c1d1368
JB
270Requires: libiec61883-devel
271Requires: libmodplug-devel
4a927f9d 272Requires: libnut-devel
22745365 273%{?with_quvi:Requires: libquvi-devel}
7571bfa0 274Requires: libraw1394-devel >= 2
38cefaee 275Requires: librtmp-devel
4474c07d 276%{?with_smb:Requires: libsmbclient-devel}
38cefaee
JB
277Requires: libtheora-devel >= 1.0-0.beta3
278%{?with_va:Requires: libva-devel >= 1.0.3}
33a1c0f3 279Requires: libvorbis-devel
1be5865c 280%{?with_vpx:Requires: libvpx-devel >= 1.3.0}
fecf9f23 281%{?with_webp:Requires: libwebp-devel >= 0.4.0}
ea09f25d 282%{?with_x264:Requires: libx264-devel >= 0.1.3-1.20110625_2245}
7d10e69e 283%{?with_x265:Requires: libx265-devel >= 1.3-0.20150610.1}
0258feb8 284%{?with_mfx:Requires: mfx_dispatch-devel}
38cefaee 285Requires: opencore-amr-devel
fc1d9619 286%{?with_opencv:Requires: opencv-devel}
62da4e00 287%{?with_openh264:Requires: openh264-devel >= 1.3}
ae5be86b 288Requires: openjpeg-devel >= 1.5
38cefaee 289Requires: schroedinger-devel
4a11c99e 290%{?with_shine:Requires: shine-devel >= 3.0.0}
7160e157 291%{?with_snappy:Requires: snappy-devel}
05408820 292%{?with_soxr:Requires: soxr-devel}
38cefaee 293Requires: speex-devel >= 1:1.2-rc1
1c1d1368 294Requires: twolame-devel
05408820 295%{?with_utvideo:Requires: utvideo-devel >= 12}
9befe454 296%{?with_vidstab:Requires: vid.stab-devel >= 0.98}
38cefaee
JB
297Requires: vo-aacenc-devel
298Requires: vo-amrwbenc-devel
22745365 299%{?with_wavpack:Requires: wavpack-devel}
cbeed0a5 300%{?with_ilbc:Requires: webrtc-libilbc-devel}
38cefaee
JB
301Requires: xavs-devel
302Requires: xorg-lib-libXext-devel
303Requires: xorg-lib-libXfixes-devel
46f2a56b 304Requires: xvid-devel >= 1:1.1.0
6a6b11be 305%{?with_zmq:Requires: zeromq-devel}
33a1c0f3 306Requires: zlib-devel
8152d6a2 307Obsoletes: libpostproc-devel
af49d6ab
JB
308
309%description devel
310ffmpeg header files.
311
cdb7b42e
JR
312%description devel -l pl.UTF-8
313Pliki nagłówkowe ffmpeg.
af49d6ab
JB
314
315%package static
316Summary: ffmpeg static libraries
adcc0f76 317Summary(pl.UTF-8): Statyczne biblioteki ffmpeg
af49d6ab
JB
318Group: Development/Libraries
319Requires: %{name}-devel = %{version}-%{release}
320
321%description static
322ffmpeg static libraries (libavcodec and libavformat).
323
cdb7b42e 324%description static -l pl.UTF-8
af49d6ab
JB
325Statyczne biblioteki ffmpeg (libavcodec i libavformat).
326
2a60eebe
JB
327%package ffplay
328Summary: FFplay - SDL-based media player
adcc0f76 329Summary(pl.UTF-8): FFplay - odtwarzacz mediów oparty na SDL
2a60eebe 330Group: Applications/Multimedia
54ec280e 331Requires: %{name}-libs = %{version}-%{release}
2a60eebe
JB
332
333%description ffplay
334FFplay is a very simple and portable media player using the FFmpeg
335libraries and the SDL library. It is mostly used as a test bench for
336the various APIs of FFmpeg.
337
cdb7b42e
JR
338%description ffplay -l pl.UTF-8
339FFplay to bardzo prosty i przenośny odtwarzacz mediów używający
340bibliotek FFmpeg oraz biblioteki SDL. Jest używany głównie do
341testowania różnych API FFmpeg.
2a60eebe 342
fde29260
ER
343%package ffserver
344Summary: FFserver video server
adcc0f76 345Summary(pl.UTF-8): FFserver - serwer strumieni obrazu
fde29260 346Group: Daemons
593d3a64 347Requires(post,preun): /sbin/chkconfig
67103923 348Requires: %{name}-libs = %{version}-%{release}
2305d791 349Requires: rc-scripts >= 0.4.0.10
fde29260
ER
350
351%description ffserver
352FFserver is a streaming server for both audio and video. It supports
353several live feeds, streaming from files and time shifting on live
354feeds (you can seek to positions in the past on each live feed,
355provided you specify a big enough feed storage in ffserver.conf).
356
cdb7b42e
JR
357%description ffserver -l pl.UTF-8
358FFserver to serwer strumieni dla dźwięku i obrazu. Obsługuje kilka
359źródeł na żywo, przekazywanie strumieni z plików i przesuwanie w
360czasie dla źródeł na żywo (można przeskakiwać na położenia w
361przeszłości dla każdego źródła na żywo, pod warunkiem odpowiednio
362dużej przestrzeni na dane skonfigurowanej w ffserver.conf).
4e0bd1da 363
4b05ede1 364%package doc
143c6eec
JB
365Summary: FFmpeg documentation in HTML format
366Summary(pl.UTF-8): Dokumentacja pakietu FFmpeg w formacie HTML
4b05ede1
ER
367Group: Documentation
368%if "%{_rpmversion}" >= "5"
369BuildArch: noarch
370%endif
371
372%description doc
143c6eec 373FFmpeg documentation in HTML format.
4b05ede1
ER
374
375%description doc -l pl.UTF-8
143c6eec 376Dokumentacja pakietu FFmpeg w formacie HTML.
4b05ede1 377
9fc4ad22 378%prep
aed8e8c9 379%setup -q
7160e157 380%patch0 -p1
9fc4ad22 381
9d4f8977
ER
382# package the grep result for mplayer, the result formatted as ./mplayer/configure
383cat <<EOF > ffmpeg-avconfig
2b2445b7 384#! /bin/sh
16803cdb
ER
385libavdecoders_all="$(sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')"
386libavencoders_all="$(sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')"
387libavparsers_all="$(sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')"
388libavbsfs_all="$(sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')"
389libavdemuxers_all="$(sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')"
390libavmuxers_all="$(sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')"
391libavprotocols_all="$(sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')"
392libavhwaccels_all="$(sed -n 's/^[^#]*HWACCEL.*(.*, *\(.*\)).*/\1_hwaccel/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')"
393libavfilters_all="$(sed -n 's/^[^#]*FILTER.*(.*, *\(.*\),.*).*/\1_filter/p' libavfilter/allfilters.c | tr '[a-z]' '[A-Z]')"
2b2445b7 394EOF
9d4f8977 395cat <<'EOF' >> ffmpeg-avconfig
2b2445b7
ER
396
397case "$1" in
398--decoders)
16803cdb 399 echo $libavdecoders_all
2b2445b7
ER
400 ;;
401--encoders)
16803cdb 402 echo $libavencoders_all
2b2445b7
ER
403 ;;
404--parsers)
16803cdb 405 echo $libavparsers_all
2b2445b7
ER
406 ;;
407--bsfs)
16803cdb 408 echo $libavbsfs_all
2b2445b7
ER
409 ;;
410--demuxers)
16803cdb 411 echo $libavdemuxers_all
2b2445b7
ER
412 ;;
413--muxers)
16803cdb 414 echo $libavmuxers_all
2b2445b7
ER
415 ;;
416--protocols)
16803cdb
ER
417 echo $libavprotocols_all
418 ;;
419--hwaccels)
420 echo $libavhwaccels_all
421 ;;
422--filters)
423 echo $libavfilters_all
2b2445b7
ER
424 ;;
425*)
426 cat <<USAGE
427Usage: $0 [OPTION]
428Options:
429 --decoders
430 --encoders
431 --parsers
432 --bsfs
433 --demuxers
434 --muxers
435 --protocols
16803cdb
ER
436 --hwaccels
437 --filters
2b2445b7
ER
438USAGE
439 exit 1;;
440esac
441
442exit 0
443EOF
444
9fc4ad22 445%build
05e1eb2f
JB
446# notes:
447# - it's not autoconf configure
d0a0ec26 448# - --disable-debug, --disable-optimizations, tune=generic causes not to override our optflags
2080d1d3 449./configure \
b4680d0b 450 --arch=%{_target_base_arch} \
539b540f 451 --prefix=%{_prefix} \
9cf4d8a4 452 --libdir=%{_libdir} \
d81dfa95 453 --shlibdir=%{_libdir} \
2a60eebe 454 --mandir=%{_mandir} \
f6f5022a 455 --extra-cflags="-D_GNU_SOURCE=1 %{rpmcppflags} %{rpmcflags}%{?with_decklink: -I/usr/include/decklink}" \
1162803a 456 --extra-ldflags="%{rpmcflags} %{rpmldflags}" \
3eef5ddf 457 --cc="%{__cc}" \
126fb805
JB
458 --disable-debug \
459 --disable-optimizations \
6382c99d 460 --disable-stripping \
314ef0df 461 --enable-avfilter \
0797daec 462 --enable-avresample \
f6f5022a 463 %{?with_decklink:--enable-decklink} \
d5aef92e 464 --enable-gnutls \
126fb805 465 --enable-gpl \
0b43f655 466 --enable-version3 \
3dcb8642 467 --enable-fontconfig \
d7a39558 468 %{?with_frei0r:--enable-frei0r} \
5f3dc7d9 469 %{?with_ladspa:--enable-ladspa} \
2e585b44 470 %{?with_aacplus:--enable-libaacplus} \
d5aef92e 471 --enable-libass \
3dcb8642 472 --enable-libbluray \
4474c07d 473 %{?with_bs2b:--enable-libbs2b} \
2362253d 474 %{?with_caca:--enable-libcaca} \
cbdd2688 475 --enable-libcelt \
d5aef92e
JB
476 --enable-libcdio \
477 --enable-libdc1394 \
fecf9f23 478 %{?with_dcadec:--enable-libdcadec} \
004e5628 479 %{?with_fdk_aac:--enable-libfdk-aac} \
1c1d1368 480 %{?with_flite:--enable-libflite} \
3dcb8642 481 --enable-libfreetype \
4474c07d 482 %{?with_fribidi:--enable-libfribidi} \
22745365 483 %{?with_gme:--enable-libgme} \
f3692243 484 --enable-libgsm \
1c1d1368 485 --enable-libiec61883 \
004e5628 486 %{?with_ilbc:--enable-libilbc} \
7160e157 487 %{?with_kvazaar:--enable-libkvazaar} \
0258feb8 488 %{?with_mfx:--enable-libmfx} \
d5aef92e 489 --enable-libmodplug \
15c15700 490 --enable-libmp3lame \
4a927f9d 491 --enable-libnut \
cbdd2688
JB
492 --enable-libopencore-amrnb \
493 --enable-libopencore-amrwb \
192f9f57 494 %{?with_opencv:--enable-libopencv} \
0258feb8 495 %{?with_openh264:--enable-libopenh264} \
cbdd2688 496 --enable-libopenjpeg \
1c1d1368 497 --enable-libopus \
d5aef92e 498 %{?with_pulseaudio:--enable-libpulse} \
22745365 499 %{?with_quvi:--enable-libquvi} \
cbdd2688 500 --enable-librtmp \
126fb805 501 --enable-libschroedinger \
f56b6dce 502 %{?with_shine:--enable-libshine} \
4474c07d 503 %{?with_smb:--enable-libsmbclient} \
7160e157 504 %{?with_snappy:--enable-libsnappy} \
05408820 505 %{?with_soxr:--enable-libsoxr} \
da99dcf2 506 --enable-libspeex \
5f3dc7d9 507 %{?with_ssh:--enable-libssh} \
126fb805 508 --enable-libtheora \
1c1d1368 509 --enable-libtwolame \
daf9a670 510 %{?with_utvideo:--enable-libutvideo} \
d5aef92e 511 --enable-libv4l2 \
f56b6dce 512 %{?with_vidstab:--enable-libvidstab} \
5dc039cb
JB
513 --enable-libvo-aacenc \
514 --enable-libvo-amrwbenc \
126fb805 515 --enable-libvorbis \
64f8f109 516 %{?with_vpx:--enable-libvpx} \
22745365 517 %{?with_wavpack:--enable-libwavpack} \
8b9d2787 518 %{?with_webp:--enable-libwebp} \
ea09f25d 519 %{?with_x264:--enable-libx264} \
90ab353a 520 %{?with_x265:--enable-libx265} \
5dc039cb 521 --enable-libxavs \
126fb805 522 --enable-libxvid \
6a6b11be 523 %{?with_zmq:--enable-libzmq} \
5f3dc7d9 524 %{?with_zvbi:--enable-libzvbi} \
0258feb8 525 %{?with_nvenc:--enable-nvenc} \
d5aef92e 526 %{?with_openal:--enable-openal} \
f56b6dce 527 %{?with_opencl:--enable-opencl} \
8b9d2787 528 %{?with_opengl:--enable-opengl} \
6382c99d 529 --enable-postproc \
d7493de8 530 --enable-pthreads \
9cf4d8a4 531 --enable-shared \
6382c99d 532 --enable-swscale \
22745365 533 %{!?with_va:--disable-vaapi} \
75231f25 534 --enable-x11grab \
7a286645 535%ifnarch %{ix86} %{x8664}
e1fe03f7 536 --disable-mmx \
537%endif
538%ifarch i386 i486
05e1eb2f 539 --disable-mmx \
b524cd99 540%endif
61f81a23
JR
541%ifarch x32
542 --disable-asm \
543%endif
0b43f655 544%if %{with nonfree}
48610c64 545 --enable-nonfree \
0b43f655 546 --enable-libfaac \
76243dbd 547%endif
75231f25 548 --enable-runtime-cpudetect
2305d791 549
1ef27ea1
JB
550%{__make} \
551 V=1
9fc4ad22 552
b8c60172
ER
553# CC_O to add -c to commandline. makefile should be patched
554%{__make} tools/qt-faststart V=1 CC_O='-c -o $@'
555
39711f7c
AM
556%{?with_tests:%{__make} check V=1}
557
9fc4ad22
AM
558%install
559rm -rf $RPM_BUILD_ROOT
38cf6de3 560install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir},/etc/{sysconfig,rc.d/init.d}} \
38baa0f1 561 $RPM_BUILD_ROOT%{_includedir}/ffmpeg \
38cf6de3 562 $RPM_BUILD_ROOT/var/{cache,log}/ffserver
9fc4ad22 563
a831ce58 564%{__make} install install-headers \
1ef27ea1
JB
565 DESTDIR=$RPM_BUILD_ROOT \
566 V=1
539b540f 567
a831ce58 568# install nonstandard, non-public headers manually
544421b2 569cp -a config.h $RPM_BUILD_ROOT%{_includedir}/ffmpeg
80428ade 570for a in libavutil/*/{asm,bswap}.h; do
a831ce58 571 install -Dp $a $RPM_BUILD_ROOT%{_includedir}/$a
544421b2 572done
9d4f8977 573cp -a libavformat/riff.h $RPM_BUILD_ROOT%{_includedir}/libavformat
980e7aa8
JB
574# for lim-omx ffmpeg components
575cp -a libavcodec/audioconvert.h $RPM_BUILD_ROOT%{_includedir}/libavcodec
544421b2 576
b8c60172
ER
577install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ffserver
578cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ffserver
579cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/ffserver.conf
539b540f 580mv -f $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/ffserver
b8c60172 581install -p tools/qt-faststart $RPM_BUILD_ROOT%{_bindir}
9fc4ad22 582
2b2445b7
ER
583# install as ffmpeg-avconfig to avoid with possible programs looking for
584# ffmpeg-config and expecting --libs output from it which is not implemented
585# simple to do (by querying pkgconfig), but why?
b8c60172 586install -p ffmpeg-avconfig $RPM_BUILD_ROOT%{_bindir}/ffmpeg-avconfig
2b2445b7 587
a6755e78
JB
588# packaged as %doc in -doc
589%{__rm} $RPM_BUILD_ROOT%{_docdir}/ffmpeg/*.html
590
591install -d $RPM_BUILD_ROOT%{_examplesdir}
592%{__mv} $RPM_BUILD_ROOT%{_datadir}/ffmpeg/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
593
9fc4ad22
AM
594%clean
595rm -rf $RPM_BUILD_ROOT
596
1ef27ea1
JB
597%post libs -p /sbin/ldconfig
598%postun libs -p /sbin/ldconfig
539b540f 599
38cf6de3
ER
600%pre ffserver
601%groupadd -g 167 ffserver
602%useradd -g ffserver -u 167 ffserver
603
593d3a64
ER
604%post ffserver
605/sbin/chkconfig --add ffserver
606%service ffserver restart
607
38cf6de3 608%preun ffserver
593d3a64
ER
609if [ "$1" = 0 ]; then
610 %service ffserver stop
611 /sbin/chkconfig --del ffserver
612fi
613
38cf6de3
ER
614%postun ffserver
615if [ "$1" = 0 ]; then
616 %userremove ffserver
617 %groupremove ffserver
618fi
619
9fc4ad22
AM
620%files
621%defattr(644,root,root,755)
479e9af6 622%doc CREDITS LICENSE.md MAINTAINERS README.md RELEASE_NOTES doc/APIchanges
2a60eebe 623%attr(755,root,root) %{_bindir}/ffmpeg
3a7b84be 624%attr(755,root,root) %{_bindir}/ffprobe
b7313442 625%attr(755,root,root) %{_bindir}/qt-faststart
da99dcf2
AM
626%dir %{_datadir}/ffmpeg
627%{_datadir}/ffmpeg/*.ffpreset
714dcf83 628%{_datadir}/ffmpeg/ffprobe.xsd
28673856
JB
629%if %{with doc}
630%{_mandir}/man1/ffmpeg.1*
22745365 631%{_mandir}/man1/ffmpeg-all.1*
28673856
JB
632%{_mandir}/man1/ffmpeg-bitstream-filters.1*
633%{_mandir}/man1/ffmpeg-codecs.1*
634%{_mandir}/man1/ffmpeg-devices.1*
635%{_mandir}/man1/ffmpeg-filters.1*
636%{_mandir}/man1/ffmpeg-formats.1*
637%{_mandir}/man1/ffmpeg-protocols.1*
638%{_mandir}/man1/ffmpeg-resampler.1*
639%{_mandir}/man1/ffmpeg-scaler.1*
640%{_mandir}/man1/ffmpeg-utils.1*
641%{_mandir}/man1/ffprobe.1*
22745365 642%{_mandir}/man1/ffprobe-all.1*
28673856 643%endif
54ec280e
PG
644
645%files libs
646%defattr(644,root,root,755)
f50f7d7c 647%attr(755,root,root) %{_libdir}/libavcodec.so.*.*.*
c16de9f4 648%attr(755,root,root) %ghost %{_libdir}/libavcodec.so.56
d0a0ec26 649%attr(755,root,root) %{_libdir}/libavdevice.so.*.*.*
c16de9f4 650%attr(755,root,root) %ghost %{_libdir}/libavdevice.so.56
314ef0df 651%attr(755,root,root) %{_libdir}/libavfilter.so.*.*.*
c16de9f4 652%attr(755,root,root) %ghost %{_libdir}/libavfilter.so.5
f50f7d7c 653%attr(755,root,root) %{_libdir}/libavformat.so.*.*.*
c16de9f4 654%attr(755,root,root) %ghost %{_libdir}/libavformat.so.56
5663f846 655%attr(755,root,root) %{_libdir}/libavresample.so.*.*.*
c16de9f4 656%attr(755,root,root) %ghost %{_libdir}/libavresample.so.2
f50f7d7c 657%attr(755,root,root) %{_libdir}/libavutil.so.*.*.*
c16de9f4 658%attr(755,root,root) %ghost %{_libdir}/libavutil.so.54
d7493de8 659%attr(755,root,root) %{_libdir}/libpostproc.so.*.*.*
c16de9f4 660%attr(755,root,root) %ghost %{_libdir}/libpostproc.so.53
660918c5 661%attr(755,root,root) %{_libdir}/libswresample.so.*.*.*
c16de9f4 662%attr(755,root,root) %ghost %{_libdir}/libswresample.so.1
ee032235 663%attr(755,root,root) %{_libdir}/libswscale.so.*.*.*
c16de9f4 664%attr(755,root,root) %ghost %{_libdir}/libswscale.so.3
314ef0df 665
539b540f
JB
666%files devel
667%defattr(644,root,root,755)
54ec280e 668%doc doc/optimization.txt
1ef27ea1 669%attr(755,root,root) %{_bindir}/ffmpeg-avconfig
539b540f 670%attr(755,root,root) %{_libdir}/libavcodec.so
d0a0ec26 671%attr(755,root,root) %{_libdir}/libavdevice.so
314ef0df 672%attr(755,root,root) %{_libdir}/libavfilter.so
539b540f 673%attr(755,root,root) %{_libdir}/libavformat.so
5663f846 674%attr(755,root,root) %{_libdir}/libavresample.so
d7493de8 675%attr(755,root,root) %{_libdir}/libavutil.so
d2af4612 676%attr(755,root,root) %{_libdir}/libpostproc.so
660918c5 677%attr(755,root,root) %{_libdir}/libswresample.so
ee032235 678%attr(755,root,root) %{_libdir}/libswscale.so
539b540f 679%{_includedir}/ffmpeg
6382c99d
AM
680%{_includedir}/libavcodec
681%{_includedir}/libavdevice
314ef0df 682%{_includedir}/libavfilter
6382c99d 683%{_includedir}/libavformat
5663f846 684%{_includedir}/libavresample
6382c99d
AM
685%{_includedir}/libavutil
686%{_includedir}/libpostproc
660918c5 687%{_includedir}/libswresample
6382c99d 688%{_includedir}/libswscale
1ef27ea1
JB
689%{_pkgconfigdir}/libavcodec.pc
690%{_pkgconfigdir}/libavdevice.pc
691%{_pkgconfigdir}/libavfilter.pc
692%{_pkgconfigdir}/libavformat.pc
5663f846 693%{_pkgconfigdir}/libavresample.pc
1ef27ea1
JB
694%{_pkgconfigdir}/libavutil.pc
695%{_pkgconfigdir}/libpostproc.pc
660918c5 696%{_pkgconfigdir}/libswresample.pc
1ef27ea1 697%{_pkgconfigdir}/libswscale.pc
28673856
JB
698%if %{with doc}
699%{_mandir}/man3/libavcodec.3*
700%{_mandir}/man3/libavdevice.3*
701%{_mandir}/man3/libavfilter.3*
702%{_mandir}/man3/libavformat.3*
703%{_mandir}/man3/libavutil.3*
704%{_mandir}/man3/libswresample.3*
705%{_mandir}/man3/libswscale.3*
706%endif
a6755e78 707%{_examplesdir}/%{name}-%{version}
539b540f 708
9cf4d8a4
JB
709%files static
710%defattr(644,root,root,755)
1ef27ea1
JB
711%{_libdir}/libavcodec.a
712%{_libdir}/libavdevice.a
713%{_libdir}/libavfilter.a
714%{_libdir}/libavformat.a
5663f846 715%{_libdir}/libavresample.a
1ef27ea1
JB
716%{_libdir}/libavutil.a
717%{_libdir}/libpostproc.a
660918c5 718%{_libdir}/libswresample.a
1ef27ea1 719%{_libdir}/libswscale.a
af49d6ab
JB
720
721%files ffplay
722%defattr(644,root,root,755)
723%attr(755,root,root) %{_bindir}/ffplay
22745365
JB
724%if %{with doc}
725%{_mandir}/man1/ffplay.1*
726%{_mandir}/man1/ffplay-all.1*
727%endif
af49d6ab 728
fde29260
ER
729%files ffserver
730%defattr(644,root,root,755)
731%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ffserver.conf
732%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ffserver
733%attr(755,root,root) %{_sbindir}/ffserver
734%attr(754,root,root) /etc/rc.d/init.d/ffserver
22745365
JB
735%if %{with doc}
736%{_mandir}/man1/ffserver.1*
737%{_mandir}/man1/ffserver-all.1*
738%endif
38cf6de3
ER
739%dir %attr(770,root,ffserver) /var/cache/ffserver
740%dir %attr(770,root,ffserver) /var/log/ffserver
4b05ede1
ER
741
742%if %{with doc}
743%files doc
744%defattr(644,root,root,755)
745%doc doc/*.html
746%endif
This page took 0.249761 seconds and 4 git commands to generate.