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: 071ce081e735fffc4d95bc040cc263b2
47 Source3: %{name}.sysconfig
48 Patch0: %{name}-libdir.patch
49 Patch1: %{name}-phploader.patch
50 URL: http://support.on2.com/
52 %{?with_java:BuildRequires: jre}
53 %{?with_perl:BuildRequires: perl-base}
54 %{?with_php:BuildRequires: php-devel}
55 %{?with_python:BuildRequires: python}
56 %{?with_perl:BuildRequires: rpm-perlprov >= 4.1-13}
57 BuildRequires: rpmbuild(macros) >= 1.344
59 BuildRequires: ffmpeg-libs
60 BuildRequires: lame-libs
62 %if %{without demo} && "%{version}" == "8.0.13.0"
63 BuildRequires: flixengine-libs = %{version}
65 Requires(post,preun): /sbin/chkconfig
66 Requires(postun): /usr/sbin/groupdel
67 Requires(postun): /usr/sbin/userdel
68 Requires(pre): /bin/id
69 Requires(pre): /usr/bin/getgid
70 Requires(pre): /usr/sbin/groupadd
71 Requires(pre): /usr/sbin/useradd
73 Requires: rc-scripts >= 0.4.1.5
74 Provides: group(flixd)
76 ExclusiveArch: %{ix86} %{x8664}
77 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
79 %define _sysconfdir /etc/on2
80 %define _libexecdir %{_prefix}/lib/flixd
82 # don't satisfy other packages for ffmpeg library deps (don't use %{name} here)
83 %define _noautoprovfiles %{_libexecdir}
85 # and as we don't provide them, don't require either
86 %define _noautoreq libavutil.so libavformat.so libavcodec.so
88 # these match for java-sun
90 %define _jvmlibdir %{_jvmdir}/jre/lib/i386
93 %define _jvmlibdir %{_jvmdir}/jre/lib/amd64
97 The On2 Flix Engine provides many of the Flash 8 video encoding
98 features of our industry leading On2 Flix Pro video encoder in a
99 powerful software SDK.
101 The Engine enables you to add the power and efficiency of Flash video
102 with On2 VP6 encoding to your intranet, website and other server-based
103 applications, preserve alpha channel in the video output, and much
106 The major feature of the On2 Flix Engine 8 is support for Adobe Flash
107 8 video with the On2 VP6 codec and FLV video output that can be played
108 directly in the Flash Player, streamed through the Adobe Flash Media
109 Server, or imported into Flash Studio. The new FLV output also is
110 fully compliant with FLV format metadata and Adobe Flash Player
113 %description -l pl.UTF-8
114 Silnik On2 Flix Engine udostępnia wiele spośród możliwości kodowania
115 filmów Flash 8 wiodącego kodera On2 Flix Pro w postaci potężnego SDK.
117 Silnik pozwala wykorzystywać możliwości i wydajność filmów Flash z
118 kodowaniem On2 VP6 w intranecie, na stronie WWW i w innych
119 zastosowaniach serwerowych, z zachowaniem kanału alpha na wyjściu
120 obrazu i innymi opcjami.
122 Główną cechą silnika On2 Flix Engine 8 jest obsługa filmów Adobe Flash
123 8 z kodekiem On2 VP6 oraz wyjściem obrazu FLV, które można odtwarzać
124 bezpośrednio w odtwarzaczu Flash, przekazywać strumieniem poprzez
125 Adobe Flash Media Server lub importować do Flash Studio. Nowe wyjście
126 FLV jest także w pełni zgodne z formatem metadanych FLV i standardami
130 Summary: Shared libraries for On2 Flix Engine
131 Summary(pl.UTF-8): Biblioteki współdzielone silnika On2 Flix
135 Shared libraries for On2 Flix Engine.
137 %description libs -l pl.UTF-8
138 Biblioteki współdzielone silnika On2 Flix.
141 Summary: Header files for On2 Flix Engine library
142 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki silnika On2 Flix
143 Group: Development/Libraries
146 Header files for On2 Flix Engine library.
148 %description devel -l pl.UTF-8
149 Pliki nagłówkowe biblioteki silnika On2 Flix.
151 %package -n java-%{name}
152 Summary: Java bindings for On2 Flix Engine
153 Summary(pl.UTF-8): Wiązania Javy dla silnika On2 Flix
155 Requires: %{name}-libs = %{version}-%{release}
156 Requires: jpackage-utils
158 %description -n java-%{name}
159 Java bindings for On2 Flix Engine.
161 %description -n java-%{name} -l pl.UTF-8
162 Wiązania Javy dla silnika On2 Flix.
164 %package -n perl-%{name}
165 Summary: Perl bindings for On2 Flix Engine
166 Summary(pl.UTF-8): Wiązania perla dla silnika On2 Flix
168 Requires: %{name}-libs = %{version}-%{release}
170 %description -n perl-%{name}
171 Perl bindings for On2 Flix Engine.
173 %description -n perl-%{name} -l pl.UTF-8
174 Wiązania perla dla silnika On2 Flix.
176 %package -n php-%{name}
177 Summary: PHP bindings for On2 Flix Engine
178 Summary(pl.UTF-8): Wiązania PHP dla silnika On2 Flix
179 %{?requires_php_extension}
181 Requires: %{name}-libs = %{version}-%{release}
182 Requires: php-common >= 4:5.0.4
184 %description -n php-%{name}
185 PHP bindings for On2 Flix Engine.
187 %description -n php-%{name} -l pl.UTF-8
188 Wiązania PHP dla silnika On2 Flix.
190 %package -n python-%{name}
191 Summary: Python bindings for On2 Flix Engine
192 Summary(pl.UTF-8): Wiązania Pythona dla silnika On2 Flix
194 Requires: %{name}-libs = %{version}-%{release}
196 %description -n python-%{name}
197 Python bindings for On2 Flix Engine.
199 %description -n python-%{name} -l pl.UTF-8
200 Wiązania Pythona dla silnika On2 Flix.
203 Summary: HTML API Documentation for On2 Flix Engine
204 Summary(pl.UTF-8): Dokumentacja HTML API dla silnika On2 Flix
206 Obsoletes: flixengine-docs
209 HTML API Documentation for On2 Flix Engine.
211 Also available online at <http://support.on2.com/flixengine/linux/api/>.
213 %description apidocs -l pl.UTF-8
214 Dokumentacja HTML API dla silnika On2 Flix.
217 %setup -q -T -b %{?with_demo:0}%{!?with_demo:1} -n flix-engine-installer-linux-%{full_version}
218 bin=flix-engine-installer-linux-%{full_version}.bin
219 tar=flix-engine-linux-%{full_version}.tar.gz
221 OFFSET=$( awk -F= '/OFFSET=/{print $2; exit}' $bin)
222 dd bs=8 if=$bin of=$tar skip=$OFFSET
228 %{__sed} -ne '/## FUNCTIONS common/,/## END - common function/p' $bin > functions.sh
229 cat <<'EOF' > install.sh
231 export VERSION=%{full_version}
232 %{?with_demo:export FLIXENGINEDEMO=1}
233 export nullout=/dev/null
234 export tempdir=%{_builddir}/flix-engine-installer-linux-%{full_version}
236 . $(dirname "$0")/functions.sh
237 cd .flix-engine-installation-files
239 export -f getinput inset ynanswer
241 ./install.sh "$@" | tee -i $instlog
242 if [ -f "$instlog" ]; then
243 echo "Local system info:" >>$instlog
244 uname -a 2>/dev/null >>$instlog
245 head /etc/*version* 2>/dev/null >>$instlog
246 head /etc/*release* 2>/dev/null >>$instlog
247 cat /proc/cpuinfo 2>/dev/null >>$instlog
248 /lib/ld-linux.so.2 /lib/libc.so.6 2>/dev/null >>$instlog
249 echo "---" 2>/dev/null >>$instlog
250 /lib/ld-linux.so.2 /lib32/libc.so.6 2>/dev/null >>$instlog
251 echo "---" 2>/dev/null >>$instlog
252 /lib/libc.so.6 2>/dev/null >>$instlog
253 echo "---" 2>/dev/null >>$instlog
254 file /lib/libc.so.6 2>/dev/null >>$instlog
255 echo "---" 2>/dev/null >>$instlog
256 /sbin/ifconfig -a 2>/dev/null >>$instlog
258 echo "A log of this installation can be found here:"
265 cd .flix-engine-installation-files
267 # force installing initscript into buildroot without detection
268 s,^initchk$,inittype=sysv1; INITDIR=$RPM_BUILD_ROOT/etc/rc.d/init.d,
271 s,clear 2>\$nullout,#&,
273 # want to install examples, but not compile them in install
274 # and somewhy --no-compile didn not work, had to specify also --no-modules,
275 # which made no modules installed either, chicken-egg problem.
276 s,COMPILEMODULES=y,COMPILEMODULES=n,
277 s,^INSTALLEDPERLFILES=.*,INSTALLEDPERLFILES="y",
278 s,^INSTALLEDPHPFILES=.*,INSTALLEDPHPFILES="y",
279 s,^INSTALLEDPYTHONFILES=.*,INSTALLEDPYTHONFILES="y",
280 s,^INSTALLEDFLIXLIBRARIES=.*,INSTALLEDFLIXLIBRARIES="y",
281 s,^INSTALLEDJAVAFILES=.*,INSTALLEDJAVAFILES="y",
285 # remove backups from patching as we use globs to package files to buildroot
286 find flixsamples '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
288 %if %{without demo} && "%{version}" == "8.0.13.0"
289 # purchased version doesn't have 64bit library
290 install -d testing/lib64
291 ln -sf %{_libdir}/libflixengine2.so.* testing/lib64
292 ln -sf libflixengine2.so.0 testing/lib64/libflixengine2.so
296 cd .flix-engine-installation-files
299 ln -snf flixhdrs flixengine2
300 export C_INCLUDE_PATH=$PWD
303 export LD_LIBRARY_PATH=$PWD/testing/lib64
304 ldconfig -n testing/lib64
306 export LD_LIBRARY_PATH=$PWD/flixlibs
309 export LIBRARY_PATH=$LD_LIBRARY_PATH
312 %{__make} -C flixphp \
319 %{__perl} Makefile.PL \
323 OPTIMIZE="%{rpmcflags}"
324 %{?with_tests:%{__make} test}
330 %{__python} setup.py build
335 %{__make} -C flixjava \
341 rm -rf $RPM_BUILD_ROOT
342 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},%{_libdir}}
345 --prefix=$RPM_BUILD_ROOT%{_prefix} \
346 --mandir=$RPM_BUILD_ROOT%{_mandir} \
347 --mencoderbin=$RPM_BUILD_ROOT%{_bindir} \
348 --flixsamples=$RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \
349 --pidfile=$RPM_BUILD_ROOT/var/run/flixd/flixd.pid \
350 --authdir=$RPM_BUILD_ROOT%{_sysconfdir} \
353 --yesireadtheon2license \
359 rm -f $RPM_BUILD_ROOT/etc/rc.d/init.d/flixengine
360 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/flixd
361 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/flixd
363 # mencoder-flixengine searches for codecs from /usr/lib/win32 and there's no
364 # way to override it by commandline arg or env var.
365 ln -s codecs $RPM_BUILD_ROOT%{_prefix}/lib/win32
367 cd .flix-engine-installation-files
368 install lget on2_host_info $RPM_BUILD_ROOT%{_sbindir}
370 # symlink without buildroot
371 ln -snf %{_docdir}/on2/flixengine/html/c/cli.html $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/c/README-cli.html
375 %{__make} -C flixphp \
377 PHPINST=%{php_extensiondir} \
378 DESTDIR=$RPM_BUILD_ROOT \
380 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
381 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/flixengine.ini
382 ; Enable flixengine extension module
383 ;extension=flixengine2.so
386 # symlink outside package, install apidoc package to read all docs
387 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/php/README-{cgi,cli}.html
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
398 # symlink outside package, install apidoc package to read all docs
399 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/perl/README-{cgi,cli}.html
401 mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/perl,perl-%{name}-%{version}}
406 %{__python} setup.py install \
408 --root=$RPM_BUILD_ROOT
411 # symlink outside package, install apidoc to read all docs
412 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/python/README-{cgi,cli}.html
414 mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/python,python-%{name}-%{version}}
418 %{__make} -C flixjava \
419 SOINST=$RPM_BUILD_ROOT%{_jvmlibdir} \
420 JARINST=$RPM_BUILD_ROOT%{_javadir} \
424 # symlink outside package, install apidoc to read all docs
425 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/java/README-cli.html
426 rm -f $RPM_BUILD_ROOT%{_docdir}/on2/flixengine/javadoc
428 mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/java,java-%{name}-%{version}}
431 mv $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}{/c/*,}
432 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/README-cli.html
433 mv $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/{build/linux/,}Makefile
434 rmdir $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/c
436 %if %{without apidocs}
437 rm -rf $RPM_BUILD_ROOT%{_docdir}/on2
441 cp -a testing/lib64/libflixengine2.so* $RPM_BUILD_ROOT%{_libdir}
442 # flixd linked statically and other libs are 64 bit
443 rm -f $RPM_BUILD_ROOT%{_prefix}/lib/libflixengine2*.so*
446 # we have already newer soname for libavformat.so in ffmpeg-libs
447 # copy from bundled ones to private directory
448 install -d $RPM_BUILD_ROOT%{_libexecdir}
449 install supportlibs/libavformat.so.* $RPM_BUILD_ROOT%{_libexecdir}
450 install supportlibs/libavcodec.so.* $RPM_BUILD_ROOT%{_libexecdir}
451 install supportlibs/libavutil.so.* $RPM_BUILD_ROOT%{_libexecdir}
452 ldconfig -n $RPM_BUILD_ROOT%{_libexecdir}
454 # avoid collision from mencoder package
455 mv $RPM_BUILD_ROOT%{_bindir}/mencoder{,-flixengine}
457 # do not put hardware fingerprint to rpm package
458 > $RPM_BUILD_ROOT%{_sysconfdir}/hostinfo
459 touch $RPM_BUILD_ROOT%{_sysconfdir}/flixengine.lic
460 install -d $RPM_BUILD_ROOT/var/run/flixd
461 install -d $RPM_BUILD_ROOT/var/log
462 touch $RPM_BUILD_ROOT/var/log/flixd.log
465 rm -f $RPM_BUILD_ROOT%{_sbindir}/flix-engine-uninstall.sh
467 # make it somewhat easier to acquire license registration
468 install -d $RPM_BUILD_ROOT%{_sysconfdir}
469 cat > $RPM_BUILD_ROOT%{_sysconfdir}/flixd-license.conf <<'EOF'
470 # vim:encoding=latin1
471 FLIX_USERNAME='<username>'
472 FLIX_SERIAL='<serial>'
475 install -d $RPM_BUILD_ROOT%{_sbindir}
476 cat > $RPM_BUILD_ROOT%{_sbindir}/flixd-license-get <<'EOF'
480 . %{_sysconfdir}/flixd-license.conf
481 if [ -z "$FLIX_USERNAME" -o -z "$FLIX_SERIAL" ]; then
482 echo >&2 "$0: Please fill FLIX_USERNAME and FLIX_SERIAL!"
486 %{_sbindir}/lget -u "$FLIX_USERNAME" -s "$FLIX_SERIAL" -i %{_sysconfdir}/hostinfo -o %{_sysconfdir}/flixengine.lic -a 'On2FlixEngine/%{full_version} (%(uname -o))'
488 echo >&2 "Serial registered and saved into %{_sysconfdir}/flixengine.lic"
490 echo >&2 "Run \"/sbin/service flixd start\" to start flixd"
494 echo >&2 "There was error registering your license key."
500 rm -rf $RPM_BUILD_ROOT
503 %groupadd -g 179 flixd
504 %useradd -u 179 -g flixd -c "On2 Flixd" flixd
507 /sbin/chkconfig --add flixd
508 if [ ! -f /var/log/flixd.log ]; then
509 touch /var/log/flixd.log
510 chown root:flixd /var/log/flixd.log
511 chmod 660 /var/log/flixd.log
513 if [ ! -s %{_sysconfdir}/hostinfo ]; then
514 %{_sbindir}/on2_host_info > %{_sysconfdir}/hostinfo
515 %banner -e %{name} <<EOF
516 Put your username and serial key to %{_sysconfdir}/flixd-license.conf and invoke:
517 # %{_sbindir}/flixd-license-get
519 You can register evaluation demo at <http://flix.on2.com/demos/>.
522 %service flixd restart
525 if [ "$1" = "0" ]; then
526 %service -q flixd stop
527 /sbin/chkconfig --del flixd
531 if [ "$1" = "0" ]; then
536 %post libs -p /sbin/ldconfig
537 %postun libs -p /sbin/ldconfig
539 %post -n perl-%{name}
540 %php_webserver_restart
542 %postun -n perl-%{name}
543 if [ "$1" = 0 ]; then
544 %php_webserver_restart
548 %defattr(644,root,root,755)
551 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/flixd-license.conf
552 %attr(640,root,flixd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hostinfo
553 %attr(640,root,flixd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/flixengine.lic
555 %attr(755,root,root) %{_libexecdir}/libavcodec.so.*.*.*
556 %attr(755,root,root) %{_libexecdir}/libavcodec.so.51
557 %attr(755,root,root) %{_libexecdir}/libavformat.so.*.*.*
558 %attr(755,root,root) %{_libexecdir}/libavformat.so.52
559 %attr(755,root,root) %{_libexecdir}/libavutil.so.*.*.*
560 %attr(755,root,root) %{_libexecdir}/libavutil.so.49
561 %attr(755,root,root) %{_sbindir}/flixd
562 %attr(755,root,root) %{_sbindir}/flixd-license-get
563 %attr(755,root,root) %{_sbindir}/lget
564 %attr(755,root,root) %{_sbindir}/on2_host_info
565 %attr(754,root,root) /etc/rc.d/init.d/flixd
566 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/flixd
569 %{_mandir}/man8/flixd.8*
570 %dir %attr(771,root,flixd) /var/run/flixd
571 %ghost %attr(660,root,flixd) /var/log/flixd.log
572 %attr(755,root,root) %{_bindir}/mencoder-flixengine
575 %defattr(644,root,root,755)
577 %attr(755,root,root) %{_libdir}/libflixengine2.so.*.*
578 %attr(755,root,root) %ghost %{_libdir}/libflixengine2.so.0
580 %attr(755,root,root) %{_libdir}/libflixengine2.so.*.*
581 %attr(755,root,root) %{_libdir}/libflixengine2_core.so.*.*
582 %attr(755,root,root) %ghost %{_libdir}/libflixengine2.so.0
583 %attr(755,root,root) %ghost %{_libdir}/libflixengine2_core.so.0
587 %defattr(644,root,root,755)
589 %attr(755,root,root) %{_libdir}/libflixengine2.so
591 %attr(755,root,root) %{_libdir}/libflixengine2.so
592 %attr(755,root,root) %{_libdir}/libflixengine2_core.so
594 %{_includedir}/flixengine2
595 %{_examplesdir}/%{name}-%{version}
598 %files -n java-%{name}
599 %defattr(644,root,root,755)
600 %attr(755,root,root) %{_jvmlibdir}/libflixengine2_jni.so
601 %{_javadir}/flixengine2.jar
602 %{_examplesdir}/java-%{name}-%{version}
606 %files -n perl-%{name}
607 %defattr(644,root,root,755)
608 %dir %{perl_vendorarch}/On2
609 %{perl_vendorarch}/On2/flixengine2.pm
610 %dir %{perl_vendorarch}/auto/On2
611 %dir %{perl_vendorarch}/auto/On2/flixengine2
612 %{perl_vendorarch}/auto/On2/flixengine2/flixengine2.bs
613 %attr(755,root,root) %{perl_vendorarch}/auto/On2/flixengine2/flixengine2.so
614 %{_examplesdir}/perl-%{name}-%{version}
618 %files -n php-%{name}
619 %defattr(644,root,root,755)
620 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/flixengine.ini
621 %attr(755,root,root) %{php_extensiondir}/flixengine2.so
622 %{php_data_dir}/flixengine2.php
623 %{_examplesdir}/php-%{name}-%{version}
627 %files -n python-%{name}
628 %defattr(644,root,root,755)
629 %attr(755,root,root) %{py_sitedir}/_flixengine2.so
630 %{py_sitedir}/flixengine2.py[co]
631 %{_examplesdir}/python-%{name}-%{version}
636 %defattr(644,root,root,755)