]> git.pld-linux.org Git - packages/ffmpeg.git/blob - ffmpeg.spec
e2a75b5dc16cf48881dffa48e79469fd727b3a70
[packages/ffmpeg.git] / ffmpeg.spec
1 #
2 # TODO: update for lzo 2.x (currently only lzo 1.x is supported)
3 #       - make (ffmpeg code inside) mplayer play .3gp mobile phone movies
4 #         (ffplay and vlc plays them fine
5 #
6 # Conditional build:
7 %bcond_without  amr             # don't build 3GPP Adaptive Multi Rate (AMR) speech codec
8 %bcond_without  autoreqdep      # don't care about package name deps generated by rpm
9 %bcond_without  imlib2          # don't build imlib2 vhook module
10 %bcond_with     lzo             # build with LZO support
11 #
12 Summary:        Realtime audio/video encoder and streaming server
13 Summary(pl):    Koder audio/wideo czasu rzeczywistego oraz serwer strumieni
14 Name:           ffmpeg
15 Version:        0.4.9
16 %define         snap    20060129
17 %define         _rel 10
18 Release:        3.%{snap}.%{_rel}
19 # LGPL or GPL, chosen at configure time (GPL version is more featured)
20 #
21 # (BTW. what are the 'more' features mentioned above?)
22 #
23 # Some parts of the code *is* LGPL (for example libavformat amr.c) so 
24 # it is possible to include /and distribute/ external 3GPP AMR codecs 
25 # (some kind of public domain with patent restrictions) to the 
26 # GPL-licensed stuff /and keep GPL license/.
27 %if %{with amr}
28 License:        GPL with LGPL/Public Domain parts
29 %else
30 License:        GPL with LGPL parts
31 %endif
32 Group:          Applications/Multimedia
33 #Source0:       http://dl.sourceforge.net/ffmpeg/%{name}-%{version}-pre1.tar.gz
34 #Source0:       ftp://ftp2.mplayerhq.hu/MPlayer/cvs/FFMpeg-%{snap}.tar.bz2
35 Source0:        %{name}-%{snap}.tar.bz2
36 # Source0-md5:  d8ea09431d6c0c91bfd35e0ca74a67e1
37 Source1:        ffserver.init
38 Source2:        ffserver.sysconfig
39 Source3:        ffserver.conf
40 %if %{with amr}
41 # AMR WB FLOAT 
42 #Source4:       http://www.3gpp.org/ftp/Specs/latest/Rel-6/26_series/26204-600.zip
43 Source4:        http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26204-530.zip
44 # Source4-md5:  988060bdb18b5d64b8bd82c3507d2420
45 # AMR NB FLOAT 
46 #Source6:       http://www.3gpp.org/ftp/Specs/latest/Rel-6/26_series/26104-610.zip
47 Source6:        http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-540.zip
48 # Source6-md5:  4dcbeb2bc28bf86e7131fe4cae3e0dec
49 %endif
50
51 Patch0:         %{name}-libtool.patch
52 Patch1:         %{name}-libdir.patch
53 Patch2:         %{name}-gcc4.patch
54 URL:            http://ffmpeg.sourceforge.net/
55 BuildRequires:  SDL-devel
56 BuildRequires:  faac-devel
57 BuildRequires:  faad2-devel
58 BuildRequires:  freetype-devel
59 %ifarch ppc
60 # require version with altivec support fixed
61 BuildRequires:  gcc >= 5:3.3.2-3
62 %endif
63 %{?with_imlib2:BuildRequires:   imlib2-devel >= 1.1.0-2}
64 BuildRequires:  lame-libs-devel
65 BuildRequires:  libdts-devel
66 BuildRequires:  libgsm-devel
67 BuildRequires:  libtheora-devel
68 BuildRequires:  libtool >= 2:1.4d-3
69 BuildRequires:  libvorbis-devel
70 BuildRequires:  libx264-devel >= 0.1.2-1.20060430_2245.1
71 %{?with_lzo:BuildRequires:      lzo-devel < 2.0}
72 %ifarch %{ix86}
73 %ifnarch i386 i486
74 BuildRequires:  nasm
75 %endif
76 %endif
77 BuildRequires:  perl-tools-pod
78 BuildRequires:  rpmbuild(macros) >= 1.268
79 BuildRequires:  tetex
80 BuildRequires:  texinfo
81 %{?with_amr:BuildRequires:      unzip}
82 BuildRequires:  xvid-devel >= 1:1.1.0
83 BuildRequires:  zlib-devel
84 %{?with_autoreqdep:BuildConflicts:      libpostproc}
85 Requires:       %{name}-libs = %{version}-%{release}
86 Requires:       xvid >= 1:1.1.0
87 Obsoletes:      libpostproc
88 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
89
90 %define         _noautoreqdep   libGL.so.1 libGLU.so.1
91
92 %define         specflags       -fno-strict-aliasing
93
94 # -fomit-frame-pointer is always needed on x86 due to lack of registers (-fPIC takes one)
95 %define         specflags_ia32  -fomit-frame-pointer
96 # -mmmx is needed to enable <mmintrin.h> code.
97 %define         specflags_i586  -mmmx
98 %define         specflags_i686  -mmmx
99
100 %description
101 ffmpeg is a hyper fast realtime audio/video encoder and streaming
102 server. It can grab from a standard Video4Linux video source and
103 convert it into several file formats based on DCT/motion compensation
104 encoding. Sound is compressed in MPEG audio layer 2 or using an AC3
105 compatible stream.
106
107 %description -l pl
108 ffmpeg jest bardzo szybkim koderem audio/wideo w czasie rzeczywistym
109 oraz serwerem strumieni multimedialnych. ffmpeg potrafi zrzucaæ dane
110 ze standardowego urz±dzenia Video4Linux i przekonwertowaæ je w kilka
111 formatów plików bazuj±cych na kodowaniu DCT/kompensacji ruchu. D¼wiêk
112 jest kompresowany do strumienia MPEG audio layer 2 lub u¿ywaj±c
113 strumienia kompatybilnego z AC3.
114
115 %package libs
116 Summary:        ffmpeg libraries
117 Summary(pl):    Biblioteki ffmpeg
118 Group:          Libraries
119
120 %description libs
121 This package contains ffmpeg shared libraries.
122
123 %description libs -l pl
124 Ten pakiet zawiera biblioteki wspó³dzielone ffmpeg.
125
126 %package devel
127 Summary:        ffmpeg header files
128 Summary(pl):    Pliki nag³ówkowe ffmpeg
129 Group:          Development/Libraries
130 Requires:       %{name}-libs = %{version}-%{release}
131 # for libavcodec:
132 Requires:       faac-devel
133 Requires:       faad2-devel
134 Requires:       lame-libs-devel
135 Requires:       libdts-devel
136 Requires:       libgsm-devel
137 Requires:       libtheora-devel
138 Requires:       libvorbis-devel
139 %{?with_lzo:Requires:   lzo-devel < 2.0}
140 Requires:       libx264-devel >= 0.1.2-1.20060430_2245.1
141 Requires:       xvid-devel >= 1:1.1.0
142 Requires:       zlib-devel
143 Obsoletes:      libpostproc-devel
144
145 %description devel
146 ffmpeg header files.
147
148 %description devel -l pl
149 Pliki nag³ówkowe ffmpeg.
150
151 %package static
152 Summary:        ffmpeg static libraries
153 Summary(pl):    Statyczne biblioteki ffmpeg
154 Group:          Development/Libraries
155 Requires:       %{name}-devel = %{version}-%{release}
156
157 %description static
158 ffmpeg static libraries (libavcodec and libavformat).
159
160 %description static -l pl
161 Statyczne biblioteki ffmpeg (libavcodec i libavformat).
162
163 %package ffplay
164 Summary:        FFplay - SDL-based media player
165 Summary(pl):    FFplay - odtwarzacz mediów oparty na SDL
166 Group:          Applications/Multimedia
167 Requires:       %{name}-libs = %{version}-%{release}
168
169 %description ffplay
170 FFplay is a very simple and portable media player using the FFmpeg
171 libraries and the SDL library. It is mostly used as a test bench for
172 the various APIs of FFmpeg.
173
174 %description ffplay -l pl
175 FFplay to bardzo prosty i przeno¶ny odtwarzacz mediów u¿ywaj±cy
176 bibliotek FFmpeg oraz biblioteki SDL. Jest u¿ywany g³ównie do
177 testowania ró¿nych API FFmpeg.
178
179 %package vhook-imlib2
180 Summary:        imlib2 based hook
181 Summary(pl):    Modu³ przej¶ciowy oparty o imlib2
182 Group:          Libraries
183 Requires:       %{name}-libs = %{version}-%{release}
184
185 %description vhook-imlib2
186 This module implements a text overlay for a video image. Currently it
187 supports a fixed overlay or reading the text from a file. The string
188 is passed through strftime so that it is easy to imprint the date and
189 time onto the image.
190
191 %description vhook-imlib2 -l pl
192 Ten modu³ implementuje tekstow± nak³adkê dla obrazu. Aktualnie
193 obs³uguje sta³± nak³adkê lub wczytywanie tekstu z pliku. £añcuch jest
194 przepuszczany przez strftime, wiêc ³atwo umie¶ciæ datê i czas na
195 obrazie.
196
197 %package ffserver
198 Summary:        FFserver video server
199 Summary(pl):    FFserver - serwer strumieni obrazu
200 Group:          Daemons
201 Requires(post,preun):   /sbin/chkconfig
202 Requires:       rc-scripts >= 0.4.0.10
203 Requires:       %{name}-libs = %{version}-%{release}
204
205 %description ffserver
206 FFserver is a streaming server for both audio and video. It supports
207 several live feeds, streaming from files and time shifting on live
208 feeds (you can seek to positions in the past on each live feed,
209 provided you specify a big enough feed storage in ffserver.conf).
210
211 %description ffserver -l pl
212 FFserver to serwer strumieni dla d¼wiêku i obrazu. Obs³uguje kilka
213 ¼róde³ na ¿ywo, przekazywanie strumieni z plików i przesuwanie w
214 czasie dla ¼róde³ na ¿ywo (mo¿na przeskakiwaæ na po³o¿enia w
215 przesz³o¶ci dla ka¿dego ¼ród³a na ¿ywo, pod warunkiem odpowiednio
216 du¿ej przestrzeni na dane skonfigurowanej w ffserver.conf).
217
218 %prep
219 %setup -q -n %{name}
220 %patch0 -p1
221 %patch1 -p1
222 %patch2 -p1
223 %if %{with amr}
224 cd libavcodec
225 mkdir amrwb_float
226 mkdir amr
227 mkdir amr_float
228 # put 26204-xxx.zip into libavcodec/amrwb_float
229 cd amrwb_float
230 unzip -j %{SOURCE4}
231 unzip -j 26204-530_ANSI-C_source_code.zip
232 # put 26104-xxx.zip into libavcodec/amr_float
233 cd ../amr_float
234 unzip -j %{SOURCE6}
235 unzip -j 26104-540_ANSI_C_source_code.zip
236 cd ../..
237 %endif
238
239 %build
240 # notes:
241 # - it's not autoconf configure
242 # - --disable-debug, --disable-opts, tune=generic causes not to override our optflags
243 ./configure \
244         --prefix=%{_prefix} \
245         --libdir=%{_libdir} \
246         --mandir=%{_mandir} \
247         %{!?with_lzo:--disable-lzo} \
248         --disable-strip \
249         --enable-a52 \
250         --enable-a52bin \
251         --enable-dts \
252         --enable-faac \
253         --enable-faad \
254         --enable-faadbin \
255         --enable-gpl \
256         --enable-libgsm \
257         --enable-libogg \
258         --enable-mp3lame \
259         --enable-pp \
260         --enable-pthreads \
261         --enable-shared \
262         --enable-theora \
263         --enable-vorbis \
264         --enable-x264 \
265         --enable-xvid \
266 %ifnarch %{ix86} %{x8664}
267         --disable-mmx \
268 %endif
269 %ifarch i386 i486
270         --disable-mmx \
271 %endif
272 %if %{with amr}
273         --enable-amr_nb \
274         --enable-amr_wb \
275 %endif
276         --cc="%{__cc}" \
277         --extra-cflags="%{rpmcflags}" \
278         --extra-ldflags="%{rpmldflags}" \
279         --disable-debug \
280         --disable-opts \
281         --tune=generic
282
283 %{__make} \
284         BUILD_DOC=yes
285
286 %install
287 rm -rf $RPM_BUILD_ROOT
288 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir},/etc/{sysconfig,rc.d/init.d}} \
289         $RPM_BUILD_ROOT/var/{cache,log}/ffserver
290
291 %{__make} install \
292         DESTDIR=$RPM_BUILD_ROOT
293
294 install xvmc_render.h $RPM_BUILD_ROOT%{_includedir}/ffmpeg
295 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ffserver
296 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ffserver
297 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/ffserver.conf
298 mv -f $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/ffserver
299
300 %clean
301 rm -rf $RPM_BUILD_ROOT
302
303 %post   -p /sbin/ldconfig
304 %postun -p /sbin/ldconfig
305
306 %pre ffserver
307 %groupadd -g 167 ffserver
308 %useradd -g ffserver -u 167 ffserver
309
310 %post ffserver
311 /sbin/chkconfig --add ffserver
312 %service ffserver restart
313
314 %preun ffserver
315 if [ "$1" = 0 ]; then
316         %service ffserver stop
317         /sbin/chkconfig --del ffserver
318 fi
319
320 %postun ffserver
321 if [ "$1" = 0 ]; then
322         %userremove ffserver
323         %groupremove ffserver
324 fi
325
326 %files
327 %defattr(644,root,root,755)
328 %doc Changelog README doc/*.html doc/TODO
329 %attr(755,root,root) %{_bindir}/ffmpeg
330 %{_mandir}/man1/ffmpeg.1*
331
332 %files libs
333 %defattr(644,root,root,755)
334 %attr(755,root,root) %{_libdir}/libavcodec.so.*.*.*
335 %attr(755,root,root) %{_libdir}/libavformat.so.*.*.*
336 %attr(755,root,root) %{_libdir}/libavutil.so.*.*.*
337 %attr(755,root,root) %{_libdir}/libpostproc.so.*.*.*
338 %dir %{_libdir}/vhook
339 %attr(755,root,root) %{_libdir}/vhook/drawtext.so
340 %attr(755,root,root) %{_libdir}/vhook/fish.so
341 %attr(755,root,root) %{_libdir}/vhook/null.so
342 %attr(755,root,root) %{_libdir}/vhook/ppm.so
343 %attr(755,root,root) %{_libdir}/vhook/watermark.so
344
345 %files devel
346 %defattr(644,root,root,755)
347 %doc doc/optimization.txt
348 %attr(755,root,root) %{_libdir}/libavcodec.so
349 %attr(755,root,root) %{_libdir}/libavformat.so
350 %attr(755,root,root) %{_libdir}/libavutil.so
351 %attr(755,root,root) %{_libdir}/libpostproc.so
352 %{_libdir}/lib*.la
353 %{_includedir}/ffmpeg
354 %{_includedir}/postproc
355 %{_pkgconfigdir}/*.pc
356
357 %files static
358 %defattr(644,root,root,755)
359 %{_libdir}/lib*.a
360
361 %files ffplay
362 %defattr(644,root,root,755)
363 %attr(755,root,root) %{_bindir}/ffplay
364 %{_mandir}/man1/ffplay.1*
365
366 %if %{with imlib2}
367 %files vhook-imlib2
368 %defattr(644,root,root,755)
369 %attr(755,root,root) %{_libdir}/vhook/imlib2.so
370 %endif
371
372 %files ffserver
373 %defattr(644,root,root,755)
374 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ffserver.conf
375 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ffserver
376 %attr(755,root,root) %{_sbindir}/ffserver
377 %attr(754,root,root) /etc/rc.d/init.d/ffserver
378 %{_mandir}/man1/ffserver.1*
379 %dir %attr(770,root,ffserver) /var/cache/ffserver
380 %dir %attr(770,root,ffserver) /var/log/ffserver
This page took 0.045763 seconds and 3 git commands to generate.