3 %bcond_without autodeps # don't BR packages needed only for resolving deps
4 %bcond_without python # Python bindings
5 %bcond_without java # Java bindings
6 %bcond_without php # PHP bindings
7 %bcond_without perl # Perl bindings
8 %bcond_without tests # perform "make test". needs running flixd on localhost
9 %bcond_without demo # use non-demo tarball (you need valid license to start daemon)
10 %bcond_without apis # disable all apis, build just flixd
11 %bcond_without apidocs # without apidocs
18 %undefine with_apidocs
21 %define full_version %{version}%{?with_demo:_DEMO}%{?_extra}
24 %{?with_perl:%include /usr/lib/rpm/macros.perl}
25 Summary: On2 Flix Engine
26 Summary(pl.UTF-8): Silnik On2 Flix
30 License: (probably) not distributable
32 # download demo from http://flix.on2.com/demos/
33 # check for newer versions at http://flix.on2.com/flix/download/
34 # Source0Download: http://flix.on2.com/demos/flixenginelinuxdemo.tar.gz
36 Source0: %{name}linuxdemo-%{version}.tar.gz
37 # NoSource0-md5: 883d227eeeb4973f65c4c12aed6b0e02
41 # Source1Download: http://flix.on2.com/flix/download/flix-engine-installer-linux-%{version}.tar.gz
42 Source1: flix-engine-installer-linux-%{version}%{?_extra}.tar.gz
43 # NoSource1-md5: 60fd126a8d4aa81d286d6ea534a11f08
47 Source3: %{name}.sysconfig
48 Patch0: %{name}-libdir.patch
49 Patch1: %{name}-phploader.patch
50 URL: http://support.on2.com/
52 %{?with_java:BuildRequires: jdk}
53 %{?with_perl:BuildRequires: perl-base}
54 %{?with_php:BuildRequires: php-devel}
55 %{?with_python:BuildRequires: python-devel}
56 %{?with_perl:BuildRequires: rpm-perlprov >= 4.1-13}
57 %{?with_python:BuildRequires: rpm-pythonprov}
58 BuildRequires: rpmbuild(macros) >= 1.710
60 BuildRequires: ffmpeg-libs
61 BuildRequires: lame-libs
63 %if %{without demo} && "%{version}" == "8.0.13.0"
64 BuildRequires: flixengine-libs = %{version}
66 Requires(post,preun): /sbin/chkconfig
67 Requires(postun): /usr/sbin/groupdel
68 Requires(postun): /usr/sbin/userdel
69 Requires(pre): /bin/id
70 Requires(pre): /usr/bin/getgid
71 Requires(pre): /usr/sbin/groupadd
72 Requires(pre): /usr/sbin/useradd
74 Requires: rc-scripts >= 0.4.1.5
75 Provides: group(flixd)
77 ExclusiveArch: %{ix86} %{x8664}
78 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
80 %define _sysconfdir /etc/on2
81 %define _libexecdir %{_prefix}/lib/flixd
83 # don't satisfy other packages for ffmpeg library deps (don't use %{name} here)
84 %define _noautoprovfiles %{_libexecdir}
86 # and as we don't provide them, don't require either
87 %define _noautoreq libavutil.so libavformat.so libavcodec.so
89 # these match for java-sun
91 %define _jvmlibdir %{_jvmdir}/jre/lib/i386
94 %define _jvmlibdir %{_jvmdir}/jre/lib/amd64
98 The On2 Flix Engine provides many of the Flash 8 video encoding
99 features of our industry leading On2 Flix Pro video encoder in a
100 powerful software SDK.
102 The Engine enables you to add the power and efficiency of Flash video
103 with On2 VP6 encoding to your intranet, website and other server-based
104 applications, preserve alpha channel in the video output, and much
107 The major feature of the On2 Flix Engine 8 is support for Adobe Flash
108 8 video with the On2 VP6 codec and FLV video output that can be played
109 directly in the Flash Player, streamed through the Adobe Flash Media
110 Server, or imported into Flash Studio. The new FLV output also is
111 fully compliant with FLV format metadata and Adobe Flash Player
114 %description -l pl.UTF-8
115 Silnik On2 Flix Engine udostępnia wiele spośród możliwości kodowania
116 filmów Flash 8 wiodącego kodera On2 Flix Pro w postaci potężnego SDK.
118 Silnik pozwala wykorzystywać możliwości i wydajność filmów Flash z
119 kodowaniem On2 VP6 w intranecie, na stronie WWW i w innych
120 zastosowaniach serwerowych, z zachowaniem kanału alpha na wyjściu
121 obrazu i innymi opcjami.
123 Główną cechą silnika On2 Flix Engine 8 jest obsługa filmów Adobe Flash
124 8 z kodekiem On2 VP6 oraz wyjściem obrazu FLV, które można odtwarzać
125 bezpośrednio w odtwarzaczu Flash, przekazywać strumieniem poprzez
126 Adobe Flash Media Server lub importować do Flash Studio. Nowe wyjście
127 FLV jest także w pełni zgodne z formatem metadanych FLV i standardami
131 Summary: Shared libraries for On2 Flix Engine
132 Summary(pl.UTF-8): Biblioteki współdzielone silnika On2 Flix
136 Shared libraries for On2 Flix Engine.
138 %description libs -l pl.UTF-8
139 Biblioteki współdzielone silnika On2 Flix.
142 Summary: Header files for On2 Flix Engine library
143 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki silnika On2 Flix
144 Group: Development/Libraries
147 Header files for On2 Flix Engine library.
149 %description devel -l pl.UTF-8
150 Pliki nagłówkowe biblioteki silnika On2 Flix.
152 %package -n java-%{name}
153 Summary: Java bindings for On2 Flix Engine
154 Summary(pl.UTF-8): Wiązania Javy dla silnika On2 Flix
156 Requires: %{name}-libs = %{version}-%{release}
157 Requires: jpackage-utils
159 %description -n java-%{name}
160 Java bindings for On2 Flix Engine.
162 %description -n java-%{name} -l pl.UTF-8
163 Wiązania Javy dla silnika On2 Flix.
165 %package -n perl-%{name}
166 Summary: Perl bindings for On2 Flix Engine
167 Summary(pl.UTF-8): Wiązania perla dla silnika On2 Flix
169 Requires: %{name}-libs = %{version}-%{release}
171 %description -n perl-%{name}
172 Perl bindings for On2 Flix Engine.
174 %description -n perl-%{name} -l pl.UTF-8
175 Wiązania perla dla silnika On2 Flix.
177 %package -n php-%{name}
178 Summary: PHP bindings for On2 Flix Engine
179 Summary(pl.UTF-8): Wiązania PHP dla silnika On2 Flix
180 %{?requires_php_extension}
182 Requires: %{name}-libs = %{version}-%{release}
183 Requires: php-common >= 4:5.0.4
185 %description -n php-%{name}
186 PHP bindings for On2 Flix Engine.
188 %description -n php-%{name} -l pl.UTF-8
189 Wiązania PHP dla silnika On2 Flix.
191 %package -n python-%{name}
192 Summary: Python bindings for On2 Flix Engine
193 Summary(pl.UTF-8): Wiązania Pythona dla silnika On2 Flix
195 Requires: %{name}-libs = %{version}-%{release}
197 %description -n python-%{name}
198 Python bindings for On2 Flix Engine.
200 %description -n python-%{name} -l pl.UTF-8
201 Wiązania Pythona dla silnika On2 Flix.
204 Summary: HTML API Documentation for On2 Flix Engine
205 Summary(pl.UTF-8): Dokumentacja HTML API dla silnika On2 Flix
207 Obsoletes: flixengine-docs
208 %if "%{_rpmversion}" >= "5"
213 HTML API Documentation for On2 Flix Engine.
215 Also available online at <http://support.on2.com/flixengine/linux/api/>.
217 %description apidocs -l pl.UTF-8
218 Dokumentacja HTML API dla silnika On2 Flix.
221 %setup -q -T -b %{?with_demo:0}%{!?with_demo:1} -n flix-engine-installer-linux-%{full_version}
222 bin=flix-engine-installer-linux-%{full_version}.bin
223 tar=flix-engine-linux-%{full_version}.tar.gz
225 OFFSET=$( awk -F= '/OFFSET=/{print $2; exit}' $bin)
226 dd bs=8 if=$bin of=$tar skip=$OFFSET
232 %{__sed} -ne '/## FUNCTIONS common/,/## END - common function/p' $bin > functions.sh
233 cat <<'EOF' > install.sh
235 export VERSION=%{full_version}
236 %{?with_demo:export FLIXENGINEDEMO=1}
237 export nullout=/dev/null
238 export tempdir=%{_builddir}/flix-engine-installer-linux-%{full_version}
240 . $(dirname "$0")/functions.sh
241 cd .flix-engine-installation-files
243 export -f getinput inset ynanswer
245 ./install.sh "$@" | tee -i $instlog
246 if [ -f "$instlog" ]; then
247 echo "Local system info:" >>$instlog
248 uname -a 2>/dev/null >>$instlog
249 head /etc/*version* 2>/dev/null >>$instlog
250 head /etc/*release* 2>/dev/null >>$instlog
251 cat /proc/cpuinfo 2>/dev/null >>$instlog
252 /lib/ld-linux.so.2 /lib/libc.so.6 2>/dev/null >>$instlog
253 echo "---" 2>/dev/null >>$instlog
254 /lib/ld-linux.so.2 /lib32/libc.so.6 2>/dev/null >>$instlog
255 echo "---" 2>/dev/null >>$instlog
256 /lib/libc.so.6 2>/dev/null >>$instlog
257 echo "---" 2>/dev/null >>$instlog
258 file /lib/libc.so.6 2>/dev/null >>$instlog
259 echo "---" 2>/dev/null >>$instlog
260 /sbin/ifconfig -a 2>/dev/null >>$instlog
262 echo "A log of this installation can be found here:"
269 cd .flix-engine-installation-files
271 # force installing initscript into buildroot without detection
272 s,^initchk$,inittype=sysv1; INITDIR=$RPM_BUILD_ROOT/etc/rc.d/init.d,
275 s,clear 2>\$nullout,#&,
277 # want to install examples, but not compile them in install
278 # and somewhy --no-compile didn not work, had to specify also --no-modules,
279 # which made no modules installed either, chicken-egg problem.
280 s,COMPILEMODULES=y,COMPILEMODULES=n,
281 s,^INSTALLEDFLIXLIBRARIES=.*,INSTALLEDFLIXLIBRARIES="y",
282 %{?with_perl:s,^INSTALLEDPERLFILES=.*,INSTALLEDPERLFILES="y",}
283 %{?with_php:s,^INSTALLEDPHPFILES=.*,INSTALLEDPHPFILES="y",}
284 %{?with_python:s,^INSTALLEDPYTHONFILES=.*,INSTALLEDPYTHONFILES="y",}
285 %{?with_java:s,^INSTALLEDJAVAFILES=.*,INSTALLEDJAVAFILES="y",}
289 # remove backups from patching as we use globs to package files to buildroot
290 find flixsamples '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
293 cd .flix-engine-installation-files
296 ln -snf flixhdrs flixengine2
297 export C_INCLUDE_PATH=$PWD
300 export LD_LIBRARY_PATH=$PWD/testing/lib64
301 ldconfig -n testing/lib64
303 export LD_LIBRARY_PATH=$PWD/flixlibs
306 export LIBRARY_PATH=$LD_LIBRARY_PATH
309 %{__make} -C flixphp \
316 %{__perl} Makefile.PL \
320 OPTIMIZE="%{rpmcflags}"
321 %{?with_tests:%{__make} test}
332 %{__make} -C flixjava \
338 rm -rf $RPM_BUILD_ROOT
339 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig},%{_libdir}}
342 --prefix=$RPM_BUILD_ROOT%{_prefix} \
343 --mandir=$RPM_BUILD_ROOT%{_mandir} \
344 --mencoderbin=$RPM_BUILD_ROOT%{_bindir} \
345 --flixsamples=$RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \
346 --pidfile=$RPM_BUILD_ROOT/var/run/flixd/flixd.pid \
347 --authdir=$RPM_BUILD_ROOT%{_sysconfdir} \
350 --yesireadtheon2license \
356 rm -f $RPM_BUILD_ROOT/etc/rc.d/init.d/flixengine
357 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/flixd
358 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/flixd
360 # mencoder-flixengine searches for codecs from /usr/lib/win32 and there's no
361 # way to override it by commandline arg or env var.
362 ln -s codecs $RPM_BUILD_ROOT%{_prefix}/lib/win32
364 cd .flix-engine-installation-files
365 install lget on2_host_info $RPM_BUILD_ROOT%{_sbindir}
367 # symlink outside package, install apidoc to read all docs
368 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/c/README-cli.html
369 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/perl/README-{cgi,cli}.html
370 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/php/README-{cgi,cli}.html
371 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/python/README-{cgi,cli}.html
372 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/java/README-cli.html
373 rm -f $RPM_BUILD_ROOT%{_docdir}/on2/flixengine/javadoc
377 %{__make} -C flixphp \
379 PHPINST=%{php_extensiondir} \
380 DESTDIR=$RPM_BUILD_ROOT \
382 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
383 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/flixengine.ini
384 ; Enable flixengine extension module
385 ;extension=flixengine2.so
389 mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/php,php-%{name}-%{version}}
394 %{__make} pure_install \
395 DESTDIR=$RPM_BUILD_ROOT
396 rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/On2/flixengine2/.packlist
399 mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/perl,perl-%{name}-%{version}}
408 mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/python,python-%{name}-%{version}}
412 %{__make} -C flixjava \
413 SOINST=$RPM_BUILD_ROOT%{_jvmlibdir} \
414 JARINST=$RPM_BUILD_ROOT%{_javadir} \
419 mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/java,java-%{name}-%{version}}
422 mv $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}{/c/*,}
423 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/README-cli.html
424 mv $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/{build/linux/,}Makefile
425 rmdir $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/c
427 %if %{without apidocs}
428 rm -rf $RPM_BUILD_ROOT%{_docdir}/on2
432 cp -a testing/lib64/libflixengine2.so* $RPM_BUILD_ROOT%{_libdir}
433 # flixd linked statically and other libs are 64 bit
434 rm -f $RPM_BUILD_ROOT%{_prefix}/lib/libflixengine2*.so*
437 # we have already newer soname for libavformat.so in ffmpeg-libs
438 # copy from bundled ones to private directory
439 install -d $RPM_BUILD_ROOT%{_libexecdir}
440 install supportlibs/libavformat.so.* $RPM_BUILD_ROOT%{_libexecdir}
441 install supportlibs/libavcodec.so.* $RPM_BUILD_ROOT%{_libexecdir}
442 install supportlibs/libavutil.so.* $RPM_BUILD_ROOT%{_libexecdir}
443 ldconfig -n $RPM_BUILD_ROOT%{_libexecdir}
445 # avoid collision from mencoder package
446 mv $RPM_BUILD_ROOT%{_bindir}/mencoder{,-flixengine}
448 # do not put hardware fingerprint to rpm package
449 > $RPM_BUILD_ROOT%{_sysconfdir}/hostinfo
450 touch $RPM_BUILD_ROOT%{_sysconfdir}/flixengine.lic
451 install -d $RPM_BUILD_ROOT/var/run/flixd
452 install -d $RPM_BUILD_ROOT/var/log
453 touch $RPM_BUILD_ROOT/var/log/flixd.log
456 rm -f $RPM_BUILD_ROOT%{_sbindir}/flix-engine-uninstall.sh
458 # make it somewhat easier to acquire license registration
459 install -d $RPM_BUILD_ROOT%{_sysconfdir}
460 cat > $RPM_BUILD_ROOT%{_sysconfdir}/flixd-license.conf <<'EOF'
461 # vim:encoding=latin1
462 FLIX_USERNAME='<username>'
463 FLIX_SERIAL='<serial>'
466 install -d $RPM_BUILD_ROOT%{_sbindir}
467 cat > $RPM_BUILD_ROOT%{_sbindir}/flixd-license-get <<'EOF'
471 . %{_sysconfdir}/flixd-license.conf
472 if [ -z "$FLIX_USERNAME" -o -z "$FLIX_SERIAL" ]; then
473 echo >&2 "$0: Please fill FLIX_USERNAME and FLIX_SERIAL!"
477 %{_sbindir}/lget -u "$FLIX_USERNAME" -s "$FLIX_SERIAL" -i %{_sysconfdir}/hostinfo -o %{_sysconfdir}/flixengine.lic -a 'On2FlixEngine/%{full_version} (%(uname -o))'
479 echo >&2 "Serial registered and saved into %{_sysconfdir}/flixengine.lic"
481 echo >&2 "Run \"/sbin/service flixd start\" to start flixd"
485 echo >&2 "There was error registering your license key."
491 rm -rf $RPM_BUILD_ROOT
494 %groupadd -g 179 flixd
495 %useradd -u 179 -g flixd -c "On2 Flixd" flixd
498 /sbin/chkconfig --add flixd
499 if [ ! -f /var/log/flixd.log ]; then
500 touch /var/log/flixd.log
501 chown root:flixd /var/log/flixd.log
502 chmod 660 /var/log/flixd.log
504 if [ ! -s %{_sysconfdir}/hostinfo ]; then
505 %{_sbindir}/on2_host_info > %{_sysconfdir}/hostinfo
506 %banner -e %{name} <<EOF
507 Put your username and serial key to %{_sysconfdir}/flixd-license.conf and invoke:
508 # %{_sbindir}/flixd-license-get
510 You can register evaluation demo at <http://flix.on2.com/demos/>.
513 %service flixd restart
516 if [ "$1" = "0" ]; then
517 %service -q flixd stop
518 /sbin/chkconfig --del flixd
522 if [ "$1" = "0" ]; then
527 %post libs -p /sbin/ldconfig
528 %postun libs -p /sbin/ldconfig
530 %post -n perl-%{name}
531 %php_webserver_restart
533 %postun -n perl-%{name}
534 if [ "$1" = 0 ]; then
535 %php_webserver_restart
539 %defattr(644,root,root,755)
542 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/flixd-license.conf
543 %attr(640,root,flixd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hostinfo
544 %attr(640,root,flixd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/flixengine.lic
546 %attr(755,root,root) %{_libexecdir}/libavcodec.so.*.*.*
547 %attr(755,root,root) %{_libexecdir}/libavcodec.so.51
548 %attr(755,root,root) %{_libexecdir}/libavformat.so.*.*.*
549 %attr(755,root,root) %{_libexecdir}/libavformat.so.52
550 %attr(755,root,root) %{_libexecdir}/libavutil.so.*.*.*
551 %attr(755,root,root) %{_libexecdir}/libavutil.so.49
552 %attr(755,root,root) %{_sbindir}/flixd
553 %attr(755,root,root) %{_sbindir}/flixd-license-get
554 %attr(755,root,root) %{_sbindir}/lget
555 %attr(755,root,root) %{_sbindir}/on2_host_info
556 %attr(754,root,root) /etc/rc.d/init.d/flixd
557 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/flixd
560 %{_mandir}/man8/flixd.8*
561 %dir %attr(771,root,flixd) /var/run/flixd
562 %attr(660,root,flixd) %ghost /var/log/flixd.log
563 %attr(755,root,root) %{_bindir}/mencoder-flixengine
566 %defattr(644,root,root,755)
568 %attr(755,root,root) %{_libdir}/libflixengine2.so.*.*
569 %attr(755,root,root) %ghost %{_libdir}/libflixengine2.so.0
571 %attr(755,root,root) %{_libdir}/libflixengine2.so.*.*
572 %attr(755,root,root) %{_libdir}/libflixengine2_core.so.*.*
573 %attr(755,root,root) %ghost %{_libdir}/libflixengine2.so.0
574 %attr(755,root,root) %ghost %{_libdir}/libflixengine2_core.so.0
578 %defattr(644,root,root,755)
580 %attr(755,root,root) %{_libdir}/libflixengine2.so
582 %attr(755,root,root) %{_libdir}/libflixengine2.so
583 %attr(755,root,root) %{_libdir}/libflixengine2_core.so
585 %{_includedir}/flixengine2
586 %{_examplesdir}/%{name}-%{version}
589 %files -n java-%{name}
590 %defattr(644,root,root,755)
591 %attr(755,root,root) %{_jvmlibdir}/libflixengine2_jni.so
592 %{_javadir}/flixengine2.jar
593 %{_examplesdir}/java-%{name}-%{version}
597 %files -n perl-%{name}
598 %defattr(644,root,root,755)
599 %dir %{perl_vendorarch}/On2
600 %{perl_vendorarch}/On2/flixengine2.pm
601 %dir %{perl_vendorarch}/auto/On2
602 %dir %{perl_vendorarch}/auto/On2/flixengine2
603 %{perl_vendorarch}/auto/On2/flixengine2/flixengine2.bs
604 %attr(755,root,root) %{perl_vendorarch}/auto/On2/flixengine2/flixengine2.so
605 %{_examplesdir}/perl-%{name}-%{version}
609 %files -n php-%{name}
610 %defattr(644,root,root,755)
611 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/flixengine.ini
612 %attr(755,root,root) %{php_extensiondir}/flixengine2.so
613 %{php_data_dir}/flixengine2.php
614 %{_examplesdir}/php-%{name}-%{version}
618 %files -n python-%{name}
619 %defattr(644,root,root,755)
620 %attr(755,root,root) %{py_sitedir}/_flixengine2.so
621 %{py_sitedir}/flixengine2.py[co]
622 %if "%{py_ver}" > "2.4"
623 %{py_sitedir}/flixengine2-*.egg-info
625 %{_examplesdir}/python-%{name}-%{version}
630 %defattr(644,root,root,755)