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,^INSTALLEDFLIXLIBRARIES=.*,INSTALLEDFLIXLIBRARIES="y",
278 %{?with_perl:"s,^INSTALLEDPERLFILES=.*,INSTALLEDPERLFILES="y",}
279 %{?with_php:s,^INSTALLEDPHPFILES=.*,INSTALLEDPHPFILES="y",}
280 %{?with_python:s,^INSTALLEDPYTHONFILES=.*,INSTALLEDPYTHONFILES="y",}
281 %{?with_java: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 outside package, install apidoc to read all docs
371 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/c/README-cli.html
372 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/perl/README-{cgi,cli}.html
373 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/php/README-{cgi,cli}.html
374 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/python/README-{cgi,cli}.html
375 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/java/README-cli.html
376 rm -f $RPM_BUILD_ROOT%{_docdir}/on2/flixengine/javadoc
380 %{__make} -C flixphp \
382 PHPINST=%{php_extensiondir} \
383 DESTDIR=$RPM_BUILD_ROOT \
385 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
386 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/flixengine.ini
387 ; Enable flixengine extension module
388 ;extension=flixengine2.so
392 mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/php,php-%{name}-%{version}}
397 %{__make} pure_install \
398 DESTDIR=$RPM_BUILD_ROOT
399 rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/On2/flixengine2/.packlist
402 mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/perl,perl-%{name}-%{version}}
407 %{__python} setup.py install \
409 --root=$RPM_BUILD_ROOT
413 mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/python,python-%{name}-%{version}}
417 %{__make} -C flixjava \
418 SOINST=$RPM_BUILD_ROOT%{_jvmlibdir} \
419 JARINST=$RPM_BUILD_ROOT%{_javadir} \
424 mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/java,java-%{name}-%{version}}
427 mv $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}{/c/*,}
428 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/README-cli.html
429 mv $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/{build/linux/,}Makefile
430 rmdir $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/c
432 %if %{without apidocs}
433 rm -rf $RPM_BUILD_ROOT%{_docdir}/on2
437 cp -a testing/lib64/libflixengine2.so* $RPM_BUILD_ROOT%{_libdir}
438 # flixd linked statically and other libs are 64 bit
439 rm -f $RPM_BUILD_ROOT%{_prefix}/lib/libflixengine2*.so*
442 # we have already newer soname for libavformat.so in ffmpeg-libs
443 # copy from bundled ones to private directory
444 install -d $RPM_BUILD_ROOT%{_libexecdir}
445 install supportlibs/libavformat.so.* $RPM_BUILD_ROOT%{_libexecdir}
446 install supportlibs/libavcodec.so.* $RPM_BUILD_ROOT%{_libexecdir}
447 install supportlibs/libavutil.so.* $RPM_BUILD_ROOT%{_libexecdir}
448 ldconfig -n $RPM_BUILD_ROOT%{_libexecdir}
450 # avoid collision from mencoder package
451 mv $RPM_BUILD_ROOT%{_bindir}/mencoder{,-flixengine}
453 # do not put hardware fingerprint to rpm package
454 > $RPM_BUILD_ROOT%{_sysconfdir}/hostinfo
455 touch $RPM_BUILD_ROOT%{_sysconfdir}/flixengine.lic
456 install -d $RPM_BUILD_ROOT/var/run/flixd
457 install -d $RPM_BUILD_ROOT/var/log
458 touch $RPM_BUILD_ROOT/var/log/flixd.log
461 rm -f $RPM_BUILD_ROOT%{_sbindir}/flix-engine-uninstall.sh
463 # make it somewhat easier to acquire license registration
464 install -d $RPM_BUILD_ROOT%{_sysconfdir}
465 cat > $RPM_BUILD_ROOT%{_sysconfdir}/flixd-license.conf <<'EOF'
466 # vim:encoding=latin1
467 FLIX_USERNAME='<username>'
468 FLIX_SERIAL='<serial>'
471 install -d $RPM_BUILD_ROOT%{_sbindir}
472 cat > $RPM_BUILD_ROOT%{_sbindir}/flixd-license-get <<'EOF'
476 . %{_sysconfdir}/flixd-license.conf
477 if [ -z "$FLIX_USERNAME" -o -z "$FLIX_SERIAL" ]; then
478 echo >&2 "$0: Please fill FLIX_USERNAME and FLIX_SERIAL!"
482 %{_sbindir}/lget -u "$FLIX_USERNAME" -s "$FLIX_SERIAL" -i %{_sysconfdir}/hostinfo -o %{_sysconfdir}/flixengine.lic -a 'On2FlixEngine/%{full_version} (%(uname -o))'
484 echo >&2 "Serial registered and saved into %{_sysconfdir}/flixengine.lic"
486 echo >&2 "Run \"/sbin/service flixd start\" to start flixd"
490 echo >&2 "There was error registering your license key."
496 rm -rf $RPM_BUILD_ROOT
499 %groupadd -g 179 flixd
500 %useradd -u 179 -g flixd -c "On2 Flixd" flixd
503 /sbin/chkconfig --add flixd
504 if [ ! -f /var/log/flixd.log ]; then
505 touch /var/log/flixd.log
506 chown root:flixd /var/log/flixd.log
507 chmod 660 /var/log/flixd.log
509 if [ ! -s %{_sysconfdir}/hostinfo ]; then
510 %{_sbindir}/on2_host_info > %{_sysconfdir}/hostinfo
511 %banner -e %{name} <<EOF
512 Put your username and serial key to %{_sysconfdir}/flixd-license.conf and invoke:
513 # %{_sbindir}/flixd-license-get
515 You can register evaluation demo at <http://flix.on2.com/demos/>.
518 %service flixd restart
521 if [ "$1" = "0" ]; then
522 %service -q flixd stop
523 /sbin/chkconfig --del flixd
527 if [ "$1" = "0" ]; then
532 %post libs -p /sbin/ldconfig
533 %postun libs -p /sbin/ldconfig
535 %post -n perl-%{name}
536 %php_webserver_restart
538 %postun -n perl-%{name}
539 if [ "$1" = 0 ]; then
540 %php_webserver_restart
544 %defattr(644,root,root,755)
547 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/flixd-license.conf
548 %attr(640,root,flixd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hostinfo
549 %attr(640,root,flixd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/flixengine.lic
551 %attr(755,root,root) %{_libexecdir}/libavcodec.so.*.*.*
552 %attr(755,root,root) %{_libexecdir}/libavcodec.so.51
553 %attr(755,root,root) %{_libexecdir}/libavformat.so.*.*.*
554 %attr(755,root,root) %{_libexecdir}/libavformat.so.52
555 %attr(755,root,root) %{_libexecdir}/libavutil.so.*.*.*
556 %attr(755,root,root) %{_libexecdir}/libavutil.so.49
557 %attr(755,root,root) %{_sbindir}/flixd
558 %attr(755,root,root) %{_sbindir}/flixd-license-get
559 %attr(755,root,root) %{_sbindir}/lget
560 %attr(755,root,root) %{_sbindir}/on2_host_info
561 %attr(754,root,root) /etc/rc.d/init.d/flixd
562 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/flixd
565 %{_mandir}/man8/flixd.8*
566 %dir %attr(771,root,flixd) /var/run/flixd
567 %ghost %attr(660,root,flixd) /var/log/flixd.log
568 %attr(755,root,root) %{_bindir}/mencoder-flixengine
571 %defattr(644,root,root,755)
573 %attr(755,root,root) %{_libdir}/libflixengine2.so.*.*
574 %attr(755,root,root) %ghost %{_libdir}/libflixengine2.so.0
576 %attr(755,root,root) %{_libdir}/libflixengine2.so.*.*
577 %attr(755,root,root) %{_libdir}/libflixengine2_core.so.*.*
578 %attr(755,root,root) %ghost %{_libdir}/libflixengine2.so.0
579 %attr(755,root,root) %ghost %{_libdir}/libflixengine2_core.so.0
583 %defattr(644,root,root,755)
585 %attr(755,root,root) %{_libdir}/libflixengine2.so
587 %attr(755,root,root) %{_libdir}/libflixengine2.so
588 %attr(755,root,root) %{_libdir}/libflixengine2_core.so
590 %{_includedir}/flixengine2
591 %{_examplesdir}/%{name}-%{version}
594 %files -n java-%{name}
595 %defattr(644,root,root,755)
596 %attr(755,root,root) %{_jvmlibdir}/libflixengine2_jni.so
597 %{_javadir}/flixengine2.jar
598 %{_examplesdir}/java-%{name}-%{version}
602 %files -n perl-%{name}
603 %defattr(644,root,root,755)
604 %dir %{perl_vendorarch}/On2
605 %{perl_vendorarch}/On2/flixengine2.pm
606 %dir %{perl_vendorarch}/auto/On2
607 %dir %{perl_vendorarch}/auto/On2/flixengine2
608 %{perl_vendorarch}/auto/On2/flixengine2/flixengine2.bs
609 %attr(755,root,root) %{perl_vendorarch}/auto/On2/flixengine2/flixengine2.so
610 %{_examplesdir}/perl-%{name}-%{version}
614 %files -n php-%{name}
615 %defattr(644,root,root,755)
616 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/flixengine.ini
617 %attr(755,root,root) %{php_extensiondir}/flixengine2.so
618 %{php_data_dir}/flixengine2.php
619 %{_examplesdir}/php-%{name}-%{version}
623 %files -n python-%{name}
624 %defattr(644,root,root,755)
625 %attr(755,root,root) %{py_sitedir}/_flixengine2.so
626 %{py_sitedir}/flixengine2.py[co]
627 %{_examplesdir}/python-%{name}-%{version}
632 %defattr(644,root,root,755)