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