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.344
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
210 HTML API Documentation for On2 Flix Engine.
212 Also available online at <http://support.on2.com/flixengine/linux/api/>.
214 %description apidocs -l pl.UTF-8
215 Dokumentacja HTML API dla silnika On2 Flix.
218 %setup -q -T -b %{?with_demo:0}%{!?with_demo:1} -n flix-engine-installer-linux-%{full_version}
219 bin=flix-engine-installer-linux-%{full_version}.bin
220 tar=flix-engine-linux-%{full_version}.tar.gz
222 OFFSET=$( awk -F= '/OFFSET=/{print $2; exit}' $bin)
223 dd bs=8 if=$bin of=$tar skip=$OFFSET
229 %{__sed} -ne '/## FUNCTIONS common/,/## END - common function/p' $bin > functions.sh
230 cat <<'EOF' > install.sh
232 export VERSION=%{full_version}
233 %{?with_demo:export FLIXENGINEDEMO=1}
234 export nullout=/dev/null
235 export tempdir=%{_builddir}/flix-engine-installer-linux-%{full_version}
237 . $(dirname "$0")/functions.sh
238 cd .flix-engine-installation-files
240 export -f getinput inset ynanswer
242 ./install.sh "$@" | tee -i $instlog
243 if [ -f "$instlog" ]; then
244 echo "Local system info:" >>$instlog
245 uname -a 2>/dev/null >>$instlog
246 head /etc/*version* 2>/dev/null >>$instlog
247 head /etc/*release* 2>/dev/null >>$instlog
248 cat /proc/cpuinfo 2>/dev/null >>$instlog
249 /lib/ld-linux.so.2 /lib/libc.so.6 2>/dev/null >>$instlog
250 echo "---" 2>/dev/null >>$instlog
251 /lib/ld-linux.so.2 /lib32/libc.so.6 2>/dev/null >>$instlog
252 echo "---" 2>/dev/null >>$instlog
253 /lib/libc.so.6 2>/dev/null >>$instlog
254 echo "---" 2>/dev/null >>$instlog
255 file /lib/libc.so.6 2>/dev/null >>$instlog
256 echo "---" 2>/dev/null >>$instlog
257 /sbin/ifconfig -a 2>/dev/null >>$instlog
259 echo "A log of this installation can be found here:"
266 cd .flix-engine-installation-files
268 # force installing initscript into buildroot without detection
269 s,^initchk$,inittype=sysv1; INITDIR=$RPM_BUILD_ROOT/etc/rc.d/init.d,
272 s,clear 2>\$nullout,#&,
274 # want to install examples, but not compile them in install
275 # and somewhy --no-compile didn not work, had to specify also --no-modules,
276 # which made no modules installed either, chicken-egg problem.
277 s,COMPILEMODULES=y,COMPILEMODULES=n,
278 s,^INSTALLEDFLIXLIBRARIES=.*,INSTALLEDFLIXLIBRARIES="y",
279 %{?with_perl:s,^INSTALLEDPERLFILES=.*,INSTALLEDPERLFILES="y",}
280 %{?with_php:s,^INSTALLEDPHPFILES=.*,INSTALLEDPHPFILES="y",}
281 %{?with_python:s,^INSTALLEDPYTHONFILES=.*,INSTALLEDPYTHONFILES="y",}
282 %{?with_java:s,^INSTALLEDJAVAFILES=.*,INSTALLEDJAVAFILES="y",}
286 # remove backups from patching as we use globs to package files to buildroot
287 find flixsamples '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
290 cd .flix-engine-installation-files
293 ln -snf flixhdrs flixengine2
294 export C_INCLUDE_PATH=$PWD
297 export LD_LIBRARY_PATH=$PWD/testing/lib64
298 ldconfig -n testing/lib64
300 export LD_LIBRARY_PATH=$PWD/flixlibs
303 export LIBRARY_PATH=$LD_LIBRARY_PATH
306 %{__make} -C flixphp \
313 %{__perl} Makefile.PL \
317 OPTIMIZE="%{rpmcflags}"
318 %{?with_tests:%{__make} test}
324 %{__python} setup.py build
329 %{__make} -C flixjava \
335 rm -rf $RPM_BUILD_ROOT
336 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig},%{_libdir}}
339 --prefix=$RPM_BUILD_ROOT%{_prefix} \
340 --mandir=$RPM_BUILD_ROOT%{_mandir} \
341 --mencoderbin=$RPM_BUILD_ROOT%{_bindir} \
342 --flixsamples=$RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \
343 --pidfile=$RPM_BUILD_ROOT/var/run/flixd/flixd.pid \
344 --authdir=$RPM_BUILD_ROOT%{_sysconfdir} \
347 --yesireadtheon2license \
353 rm -f $RPM_BUILD_ROOT/etc/rc.d/init.d/flixengine
354 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/flixd
355 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/flixd
357 # mencoder-flixengine searches for codecs from /usr/lib/win32 and there's no
358 # way to override it by commandline arg or env var.
359 ln -s codecs $RPM_BUILD_ROOT%{_prefix}/lib/win32
361 cd .flix-engine-installation-files
362 install lget on2_host_info $RPM_BUILD_ROOT%{_sbindir}
364 # symlink outside package, install apidoc to read all docs
365 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/c/README-cli.html
366 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/perl/README-{cgi,cli}.html
367 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/php/README-{cgi,cli}.html
368 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/python/README-{cgi,cli}.html
369 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/java/README-cli.html
370 rm -f $RPM_BUILD_ROOT%{_docdir}/on2/flixengine/javadoc
374 %{__make} -C flixphp \
376 PHPINST=%{php_extensiondir} \
377 DESTDIR=$RPM_BUILD_ROOT \
379 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
380 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/flixengine.ini
381 ; Enable flixengine extension module
382 ;extension=flixengine2.so
386 mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/php,php-%{name}-%{version}}
391 %{__make} pure_install \
392 DESTDIR=$RPM_BUILD_ROOT
393 rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/On2/flixengine2/.packlist
396 mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/perl,perl-%{name}-%{version}}
401 %{__python} setup.py install \
403 --root=$RPM_BUILD_ROOT
407 mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/python,python-%{name}-%{version}}
411 %{__make} -C flixjava \
412 SOINST=$RPM_BUILD_ROOT%{_jvmlibdir} \
413 JARINST=$RPM_BUILD_ROOT%{_javadir} \
418 mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/java,java-%{name}-%{version}}
421 mv $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}{/c/*,}
422 rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/README-cli.html
423 mv $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/{build/linux/,}Makefile
424 rmdir $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/c
426 %if %{without apidocs}
427 rm -rf $RPM_BUILD_ROOT%{_docdir}/on2
431 cp -a testing/lib64/libflixengine2.so* $RPM_BUILD_ROOT%{_libdir}
432 # flixd linked statically and other libs are 64 bit
433 rm -f $RPM_BUILD_ROOT%{_prefix}/lib/libflixengine2*.so*
436 # we have already newer soname for libavformat.so in ffmpeg-libs
437 # copy from bundled ones to private directory
438 install -d $RPM_BUILD_ROOT%{_libexecdir}
439 install supportlibs/libavformat.so.* $RPM_BUILD_ROOT%{_libexecdir}
440 install supportlibs/libavcodec.so.* $RPM_BUILD_ROOT%{_libexecdir}
441 install supportlibs/libavutil.so.* $RPM_BUILD_ROOT%{_libexecdir}
442 ldconfig -n $RPM_BUILD_ROOT%{_libexecdir}
444 # avoid collision from mencoder package
445 mv $RPM_BUILD_ROOT%{_bindir}/mencoder{,-flixengine}
447 # do not put hardware fingerprint to rpm package
448 > $RPM_BUILD_ROOT%{_sysconfdir}/hostinfo
449 touch $RPM_BUILD_ROOT%{_sysconfdir}/flixengine.lic
450 install -d $RPM_BUILD_ROOT/var/run/flixd
451 install -d $RPM_BUILD_ROOT/var/log
452 touch $RPM_BUILD_ROOT/var/log/flixd.log
455 rm -f $RPM_BUILD_ROOT%{_sbindir}/flix-engine-uninstall.sh
457 # make it somewhat easier to acquire license registration
458 install -d $RPM_BUILD_ROOT%{_sysconfdir}
459 cat > $RPM_BUILD_ROOT%{_sysconfdir}/flixd-license.conf <<'EOF'
460 # vim:encoding=latin1
461 FLIX_USERNAME='<username>'
462 FLIX_SERIAL='<serial>'
465 install -d $RPM_BUILD_ROOT%{_sbindir}
466 cat > $RPM_BUILD_ROOT%{_sbindir}/flixd-license-get <<'EOF'
470 . %{_sysconfdir}/flixd-license.conf
471 if [ -z "$FLIX_USERNAME" -o -z "$FLIX_SERIAL" ]; then
472 echo >&2 "$0: Please fill FLIX_USERNAME and FLIX_SERIAL!"
476 %{_sbindir}/lget -u "$FLIX_USERNAME" -s "$FLIX_SERIAL" -i %{_sysconfdir}/hostinfo -o %{_sysconfdir}/flixengine.lic -a 'On2FlixEngine/%{full_version} (%(uname -o))'
478 echo >&2 "Serial registered and saved into %{_sysconfdir}/flixengine.lic"
480 echo >&2 "Run \"/sbin/service flixd start\" to start flixd"
484 echo >&2 "There was error registering your license key."
490 rm -rf $RPM_BUILD_ROOT
493 %groupadd -g 179 flixd
494 %useradd -u 179 -g flixd -c "On2 Flixd" flixd
497 /sbin/chkconfig --add flixd
498 if [ ! -f /var/log/flixd.log ]; then
499 touch /var/log/flixd.log
500 chown root:flixd /var/log/flixd.log
501 chmod 660 /var/log/flixd.log
503 if [ ! -s %{_sysconfdir}/hostinfo ]; then
504 %{_sbindir}/on2_host_info > %{_sysconfdir}/hostinfo
505 %banner -e %{name} <<EOF
506 Put your username and serial key to %{_sysconfdir}/flixd-license.conf and invoke:
507 # %{_sbindir}/flixd-license-get
509 You can register evaluation demo at <http://flix.on2.com/demos/>.
512 %service flixd restart
515 if [ "$1" = "0" ]; then
516 %service -q flixd stop
517 /sbin/chkconfig --del flixd
521 if [ "$1" = "0" ]; then
526 %post libs -p /sbin/ldconfig
527 %postun libs -p /sbin/ldconfig
529 %post -n perl-%{name}
530 %php_webserver_restart
532 %postun -n perl-%{name}
533 if [ "$1" = 0 ]; then
534 %php_webserver_restart
538 %defattr(644,root,root,755)
541 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/flixd-license.conf
542 %attr(640,root,flixd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hostinfo
543 %attr(640,root,flixd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/flixengine.lic
545 %attr(755,root,root) %{_libexecdir}/libavcodec.so.*.*.*
546 %attr(755,root,root) %{_libexecdir}/libavcodec.so.51
547 %attr(755,root,root) %{_libexecdir}/libavformat.so.*.*.*
548 %attr(755,root,root) %{_libexecdir}/libavformat.so.52
549 %attr(755,root,root) %{_libexecdir}/libavutil.so.*.*.*
550 %attr(755,root,root) %{_libexecdir}/libavutil.so.49
551 %attr(755,root,root) %{_sbindir}/flixd
552 %attr(755,root,root) %{_sbindir}/flixd-license-get
553 %attr(755,root,root) %{_sbindir}/lget
554 %attr(755,root,root) %{_sbindir}/on2_host_info
555 %attr(754,root,root) /etc/rc.d/init.d/flixd
556 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/flixd
559 %{_mandir}/man8/flixd.8*
560 %dir %attr(771,root,flixd) /var/run/flixd
561 %attr(660,root,flixd) %ghost /var/log/flixd.log
562 %attr(755,root,root) %{_bindir}/mencoder-flixengine
565 %defattr(644,root,root,755)
567 %attr(755,root,root) %{_libdir}/libflixengine2.so.*.*
568 %attr(755,root,root) %ghost %{_libdir}/libflixengine2.so.0
570 %attr(755,root,root) %{_libdir}/libflixengine2.so.*.*
571 %attr(755,root,root) %{_libdir}/libflixengine2_core.so.*.*
572 %attr(755,root,root) %ghost %{_libdir}/libflixengine2.so.0
573 %attr(755,root,root) %ghost %{_libdir}/libflixengine2_core.so.0
577 %defattr(644,root,root,755)
579 %attr(755,root,root) %{_libdir}/libflixengine2.so
581 %attr(755,root,root) %{_libdir}/libflixengine2.so
582 %attr(755,root,root) %{_libdir}/libflixengine2_core.so
584 %{_includedir}/flixengine2
585 %{_examplesdir}/%{name}-%{version}
588 %files -n java-%{name}
589 %defattr(644,root,root,755)
590 %attr(755,root,root) %{_jvmlibdir}/libflixengine2_jni.so
591 %{_javadir}/flixengine2.jar
592 %{_examplesdir}/java-%{name}-%{version}
596 %files -n perl-%{name}
597 %defattr(644,root,root,755)
598 %dir %{perl_vendorarch}/On2
599 %{perl_vendorarch}/On2/flixengine2.pm
600 %dir %{perl_vendorarch}/auto/On2
601 %dir %{perl_vendorarch}/auto/On2/flixengine2
602 %{perl_vendorarch}/auto/On2/flixengine2/flixengine2.bs
603 %attr(755,root,root) %{perl_vendorarch}/auto/On2/flixengine2/flixengine2.so
604 %{_examplesdir}/perl-%{name}-%{version}
608 %files -n php-%{name}
609 %defattr(644,root,root,755)
610 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/flixengine.ini
611 %attr(755,root,root) %{php_extensiondir}/flixengine2.so
612 %{php_data_dir}/flixengine2.php
613 %{_examplesdir}/php-%{name}-%{version}
617 %files -n python-%{name}
618 %defattr(644,root,root,755)
619 %attr(755,root,root) %{py_sitedir}/_flixengine2.so
620 %{py_sitedir}/flixengine2.py[co]
621 %if "%{py_ver}" > "2.4"
622 %{py_sitedir}/flixengine2-*.egg-info
624 %{_examplesdir}/python-%{name}-%{version}
629 %defattr(644,root,root,755)