]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
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 | |
12 | ||
13 | %if %{without apis} | |
14 | %undefine with_python | |
15 | %undefine with_java | |
16 | %undefine with_php | |
17 | %undefine with_perl | |
18 | %undefine with_apidocs | |
19 | %endif | |
20 | ||
21 | %define full_version %{version}%{?with_demo:_DEMO}%{?_extra} | |
22 | %define _extra %{nil} | |
23 | ||
24 | Summary: On2 Flix Engine | |
25 | Summary(pl.UTF-8): Silnik On2 Flix | |
26 | Name: flixengine | |
27 | Version: 8.0.13.0 | |
28 | Release: 2 | |
29 | License: (probably) not distributable | |
30 | Group: Applications | |
31 | # download demo from http://flix.on2.com/demos/ | |
32 | # check for newer versions at http://flix.on2.com/flix/download/ | |
33 | # Source0Download: http://flix.on2.com/demos/flixenginelinuxdemo.tar.gz | |
34 | %if %{with demo} | |
35 | Source0: %{name}linuxdemo-%{version}.tar.gz | |
36 | # NoSource0-md5: 883d227eeeb4973f65c4c12aed6b0e02 | |
37 | NoSource: 0 | |
38 | %endif | |
39 | %if %{without demo} | |
40 | # Source1Download: http://flix.on2.com/flix/download/flix-engine-installer-linux-%{version}.tar.gz | |
41 | Source1: flix-engine-installer-linux-%{version}%{?_extra}.tar.gz | |
42 | # NoSource1-md5: 60fd126a8d4aa81d286d6ea534a11f08 | |
43 | NoSource: 1 | |
44 | %endif | |
45 | Source2: %{name}.init | |
46 | Source3: %{name}.sysconfig | |
47 | Patch0: %{name}-libdir.patch | |
48 | Patch1: %{name}-phploader.patch | |
49 | URL: http://support.on2.com/ | |
50 | BuildRequires: bash | |
51 | %{?with_java:BuildRequires: jdk} | |
52 | %{?with_perl:BuildRequires: perl-base} | |
53 | %{?with_php:BuildRequires: php-devel} | |
54 | %{?with_python:BuildRequires: python-devel} | |
55 | %{?with_perl:BuildRequires: rpm-perlprov >= 4.1-13} | |
56 | %{?with_python:BuildRequires: rpm-pythonprov} | |
57 | BuildRequires: rpmbuild(macros) >= 1.710 | |
58 | %if %{with autodeps} | |
59 | BuildRequires: ffmpeg-libs | |
60 | BuildRequires: lame-libs | |
61 | %endif | |
62 | %if %{without demo} && "%{version}" == "8.0.13.0" | |
63 | BuildRequires: flixengine-libs = %{version} | |
64 | %endif | |
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 | |
72 | Requires: portmap | |
73 | Requires: rc-scripts >= 0.4.1.5 | |
74 | Provides: group(flixd) | |
75 | Provides: user(flixd) | |
76 | ExclusiveArch: %{ix86} %{x8664} | |
77 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
78 | ||
79 | %define _sysconfdir /etc/on2 | |
80 | %define _libexecdir %{_prefix}/lib/flixd | |
81 | ||
82 | # don't satisfy other packages for ffmpeg library deps (don't use %{name} here) | |
83 | %define _noautoprovfiles %{_libexecdir} | |
84 | ||
85 | # and as we don't provide them, don't require either | |
86 | %define _noautoreq libavutil.so libavformat.so libavcodec.so | |
87 | ||
88 | # these match for java-sun | |
89 | %ifarch %{ix86} | |
90 | %define _jvmlibdir %{_jvmdir}/jre/lib/i386 | |
91 | %endif | |
92 | %ifarch %{x8664} | |
93 | %define _jvmlibdir %{_jvmdir}/jre/lib/amd64 | |
94 | %endif | |
95 | ||
96 | %description | |
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. | |
100 | ||
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 | |
104 | more. | |
105 | ||
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 | |
111 | standards. | |
112 | ||
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. | |
116 | ||
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. | |
121 | ||
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 | |
127 | Adobe Flash Playera. | |
128 | ||
129 | %package libs | |
130 | Summary: Shared libraries for On2 Flix Engine | |
131 | Summary(pl.UTF-8): Biblioteki współdzielone silnika On2 Flix | |
132 | Group: Libraries | |
133 | ||
134 | %description libs | |
135 | Shared libraries for On2 Flix Engine. | |
136 | ||
137 | %description libs -l pl.UTF-8 | |
138 | Biblioteki współdzielone silnika On2 Flix. | |
139 | ||
140 | %package devel | |
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 | |
144 | ||
145 | %description devel | |
146 | Header files for On2 Flix Engine library. | |
147 | ||
148 | %description devel -l pl.UTF-8 | |
149 | Pliki nagłówkowe biblioteki silnika On2 Flix. | |
150 | ||
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 | |
154 | Group: Libraries | |
155 | Requires: %{name}-libs = %{version}-%{release} | |
156 | Requires: jpackage-utils | |
157 | ||
158 | %description -n java-%{name} | |
159 | Java bindings for On2 Flix Engine. | |
160 | ||
161 | %description -n java-%{name} -l pl.UTF-8 | |
162 | Wiązania Javy dla silnika On2 Flix. | |
163 | ||
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 | |
167 | Group: Libraries | |
168 | Requires: %{name}-libs = %{version}-%{release} | |
169 | ||
170 | %description -n perl-%{name} | |
171 | Perl bindings for On2 Flix Engine. | |
172 | ||
173 | %description -n perl-%{name} -l pl.UTF-8 | |
174 | Wiązania perla dla silnika On2 Flix. | |
175 | ||
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} | |
180 | Group: Libraries | |
181 | Requires: %{name}-libs = %{version}-%{release} | |
182 | Requires: php-common >= 4:5.0.4 | |
183 | ||
184 | %description -n php-%{name} | |
185 | PHP bindings for On2 Flix Engine. | |
186 | ||
187 | %description -n php-%{name} -l pl.UTF-8 | |
188 | Wiązania PHP dla silnika On2 Flix. | |
189 | ||
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 | |
193 | Group: Libraries | |
194 | Requires: %{name}-libs = %{version}-%{release} | |
195 | ||
196 | %description -n python-%{name} | |
197 | Python bindings for On2 Flix Engine. | |
198 | ||
199 | %description -n python-%{name} -l pl.UTF-8 | |
200 | Wiązania Pythona dla silnika On2 Flix. | |
201 | ||
202 | %package apidocs | |
203 | Summary: HTML API Documentation for On2 Flix Engine | |
204 | Summary(pl.UTF-8): Dokumentacja HTML API dla silnika On2 Flix | |
205 | Group: Documentation | |
206 | Obsoletes: flixengine-docs | |
207 | BuildArch: noarch | |
208 | ||
209 | %description apidocs | |
210 | HTML API Documentation for On2 Flix Engine. | |
211 | ||
212 | Also available online at <http://support.on2.com/flixengine/linux/api/>. | |
213 | ||
214 | %description apidocs -l pl.UTF-8 | |
215 | Dokumentacja HTML API dla silnika On2 Flix. | |
216 | ||
217 | %prep | |
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 | |
221 | ||
222 | OFFSET=$( awk -F= '/OFFSET=/{print $2; exit}' $bin) | |
223 | dd bs=8 if=$bin of=$tar skip=$OFFSET | |
224 | %{__tar} zxf $tar | |
225 | ||
226 | %patch0 -p1 | |
227 | %patch1 -p1 | |
228 | ||
229 | %{__sed} -ne '/## FUNCTIONS common/,/## END - common function/p' $bin > functions.sh | |
230 | cat <<'EOF' > install.sh | |
231 | #!/bin/bash | |
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} | |
236 | ||
237 | . $(dirname "$0")/functions.sh | |
238 | cd .flix-engine-installation-files | |
239 | ||
240 | export -f getinput inset ynanswer | |
241 | instlog=install.log | |
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 | |
258 | ||
259 | echo "A log of this installation can be found here:" | |
260 | echo " $instlog" | |
261 | echo | |
262 | fi | |
263 | EOF | |
264 | chmod +x install.sh | |
265 | ||
266 | cd .flix-engine-installation-files | |
267 | %{__sed} -i -e ' | |
268 | # force installing initscript into buildroot without detection | |
269 | s,^initchk$,inittype=sysv1; INITDIR=$RPM_BUILD_ROOT/etc/rc.d/init.d, | |
270 | ||
271 | # cls is annoying | |
272 | s,clear 2>\$nullout,#&, | |
273 | ||
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",} | |
283 | ||
284 | ' install.sh | |
285 | ||
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 | |
288 | ||
289 | %build | |
290 | cd .flix-engine-installation-files | |
291 | PWD=$(pwd) | |
292 | ||
293 | ln -snf flixhdrs flixengine2 | |
294 | export C_INCLUDE_PATH=$PWD | |
295 | ||
296 | %ifarch %{x8664} | |
297 | export LD_LIBRARY_PATH=$PWD/testing/lib64 | |
298 | ldconfig -n testing/lib64 | |
299 | %else | |
300 | export LD_LIBRARY_PATH=$PWD/flixlibs | |
301 | ldconfig -n flixlibs | |
302 | %endif | |
303 | export LIBRARY_PATH=$LD_LIBRARY_PATH | |
304 | ||
305 | %if %{with php} | |
306 | %{__make} -C flixphp \ | |
307 | CC="%{__cc}" \ | |
308 | -f target.mk | |
309 | %endif | |
310 | ||
311 | %if %{with perl} | |
312 | cd flixperl | |
313 | %{__perl} Makefile.PL \ | |
314 | INSTALLDIRS=vendor | |
315 | %{__make} \ | |
316 | CC="%{__cc}" \ | |
317 | OPTIMIZE="%{rpmcflags}" | |
318 | %{?with_tests:%{__make} test} | |
319 | cd .. | |
320 | %endif | |
321 | ||
322 | %if %{with python} | |
323 | cd flixpython | |
324 | %py_build | |
325 | cd .. | |
326 | %endif | |
327 | ||
328 | %if %{with java} | |
329 | %{__make} -C flixjava \ | |
330 | CC="%{__cc}" \ | |
331 | -f target.mk | |
332 | %endif | |
333 | ||
334 | %install | |
335 | rm -rf $RPM_BUILD_ROOT | |
336 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig},%{_libdir}} | |
337 | ||
338 | ./install.sh \ | |
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} \ | |
345 | --just-install \ | |
346 | --offline \ | |
347 | --yesireadtheon2license \ | |
348 | --no-compile \ | |
349 | --no-modules \ | |
350 | --no-init \ | |
351 | --noprereqlibs | |
352 | ||
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 | |
356 | ||
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 | |
360 | ||
361 | cd .flix-engine-installation-files | |
362 | install lget on2_host_info $RPM_BUILD_ROOT%{_sbindir} | |
363 | ||
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 | |
371 | ||
372 | # install bindings | |
373 | %if %{with php} | |
374 | %{__make} -C flixphp \ | |
375 | install \ | |
376 | PHPINST=%{php_extensiondir} \ | |
377 | DESTDIR=$RPM_BUILD_ROOT \ | |
378 | -f target.mk | |
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 | |
383 | EOF | |
384 | ||
385 | # per package dirs | |
386 | mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/php,php-%{name}-%{version}} | |
387 | %endif | |
388 | ||
389 | %if %{with perl} | |
390 | cd flixperl | |
391 | %{__make} pure_install \ | |
392 | DESTDIR=$RPM_BUILD_ROOT | |
393 | rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/On2/flixengine2/.packlist | |
394 | cd .. | |
395 | # per package dirs | |
396 | mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/perl,perl-%{name}-%{version}} | |
397 | %endif | |
398 | ||
399 | %if %{with python} | |
400 | cd flixpython | |
401 | %py_install | |
402 | %py_postclean | |
403 | cd .. | |
404 | # per package dirs | |
405 | mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/python,python-%{name}-%{version}} | |
406 | %endif | |
407 | ||
408 | %if %{with java} | |
409 | %{__make} -C flixjava \ | |
410 | SOINST=$RPM_BUILD_ROOT%{_jvmlibdir} \ | |
411 | JARINST=$RPM_BUILD_ROOT%{_javadir} \ | |
412 | install \ | |
413 | -f target.mk | |
414 | ||
415 | # per package dirs | |
416 | mv $RPM_BUILD_ROOT%{_examplesdir}/{%{name}-%{version}/java,java-%{name}-%{version}} | |
417 | %endif | |
418 | ||
419 | mv $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}{/c/*,} | |
420 | rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/README-cli.html | |
421 | mv $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/{build/linux/,}Makefile | |
422 | rmdir $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/c | |
423 | ||
424 | %if %{without apidocs} | |
425 | rm -rf $RPM_BUILD_ROOT%{_docdir}/on2 | |
426 | %endif | |
427 | ||
428 | %ifarch %{x8664} | |
429 | cp -a testing/lib64/libflixengine2.so* $RPM_BUILD_ROOT%{_libdir} | |
430 | # flixd linked statically and other libs are 64 bit | |
431 | rm -f $RPM_BUILD_ROOT%{_prefix}/lib/libflixengine2*.so* | |
432 | %endif | |
433 | ||
434 | # we have already newer soname for libavformat.so in ffmpeg-libs | |
435 | # copy from bundled ones to private directory | |
436 | install -d $RPM_BUILD_ROOT%{_libexecdir} | |
437 | install supportlibs/libavformat.so.* $RPM_BUILD_ROOT%{_libexecdir} | |
438 | install supportlibs/libavcodec.so.* $RPM_BUILD_ROOT%{_libexecdir} | |
439 | install supportlibs/libavutil.so.* $RPM_BUILD_ROOT%{_libexecdir} | |
440 | ldconfig -n $RPM_BUILD_ROOT%{_libexecdir} | |
441 | ||
442 | # avoid collision from mencoder package | |
443 | mv $RPM_BUILD_ROOT%{_bindir}/mencoder{,-flixengine} | |
444 | ||
445 | # do not put hardware fingerprint to rpm package | |
446 | > $RPM_BUILD_ROOT%{_sysconfdir}/hostinfo | |
447 | touch $RPM_BUILD_ROOT%{_sysconfdir}/flixengine.lic | |
448 | install -d $RPM_BUILD_ROOT/var/run/flixd | |
449 | install -d $RPM_BUILD_ROOT/var/log | |
450 | touch $RPM_BUILD_ROOT/var/log/flixd.log | |
451 | ||
452 | # use poldek -e | |
453 | rm -f $RPM_BUILD_ROOT%{_sbindir}/flix-engine-uninstall.sh | |
454 | ||
455 | # make it somewhat easier to acquire license registration | |
456 | install -d $RPM_BUILD_ROOT%{_sysconfdir} | |
457 | cat > $RPM_BUILD_ROOT%{_sysconfdir}/flixd-license.conf <<'EOF' | |
458 | # vim:encoding=latin1 | |
459 | FLIX_USERNAME='<username>' | |
460 | FLIX_SERIAL='<serial>' | |
461 | EOF | |
462 | ||
463 | install -d $RPM_BUILD_ROOT%{_sbindir} | |
464 | cat > $RPM_BUILD_ROOT%{_sbindir}/flixd-license-get <<'EOF' | |
465 | #!/bin/sh | |
466 | set -e | |
467 | ||
468 | . %{_sysconfdir}/flixd-license.conf | |
469 | if [ -z "$FLIX_USERNAME" -o -z "$FLIX_SERIAL" ]; then | |
470 | echo >&2 "$0: Please fill FLIX_USERNAME and FLIX_SERIAL!" | |
471 | exit 1 | |
472 | fi | |
473 | ||
474 | %{_sbindir}/lget -u "$FLIX_USERNAME" -s "$FLIX_SERIAL" -i %{_sysconfdir}/hostinfo -o %{_sysconfdir}/flixengine.lic -a 'On2FlixEngine/%{full_version} (%(uname -o))' | |
475 | if [ $? = 0 ]; then | |
476 | echo >&2 "Serial registered and saved into %{_sysconfdir}/flixengine.lic" | |
477 | echo >&2 "" | |
478 | echo >&2 "Run \"/sbin/service flixd start\" to start flixd" | |
479 | echo >&2 "" | |
480 | else | |
481 | echo >&2 "" | |
482 | echo >&2 "There was error registering your license key." | |
483 | exit 1 | |
484 | fi | |
485 | EOF | |
486 | ||
487 | %clean | |
488 | rm -rf $RPM_BUILD_ROOT | |
489 | ||
490 | %pre | |
491 | %groupadd -g 179 flixd | |
492 | %useradd -u 179 -g flixd -c "On2 Flixd" flixd | |
493 | ||
494 | %post | |
495 | /sbin/chkconfig --add flixd | |
496 | if [ ! -f /var/log/flixd.log ]; then | |
497 | touch /var/log/flixd.log | |
498 | chown root:flixd /var/log/flixd.log | |
499 | chmod 660 /var/log/flixd.log | |
500 | fi | |
501 | if [ ! -s %{_sysconfdir}/hostinfo ]; then | |
502 | %{_sbindir}/on2_host_info > %{_sysconfdir}/hostinfo | |
503 | %banner -e %{name} <<EOF | |
504 | Put your username and serial key to %{_sysconfdir}/flixd-license.conf and invoke: | |
505 | # %{_sbindir}/flixd-license-get | |
506 | ||
507 | You can register evaluation demo at <http://flix.on2.com/demos/>. | |
508 | EOF | |
509 | fi | |
510 | %service flixd restart | |
511 | ||
512 | %preun | |
513 | if [ "$1" = "0" ]; then | |
514 | %service -q flixd stop | |
515 | /sbin/chkconfig --del flixd | |
516 | fi | |
517 | ||
518 | %postun | |
519 | if [ "$1" = "0" ]; then | |
520 | %userremove flixd | |
521 | %groupremove flixd | |
522 | fi | |
523 | ||
524 | %post libs -p /sbin/ldconfig | |
525 | %postun libs -p /sbin/ldconfig | |
526 | ||
527 | %post -n perl-%{name} | |
528 | %php_webserver_restart | |
529 | ||
530 | %postun -n perl-%{name} | |
531 | if [ "$1" = 0 ]; then | |
532 | %php_webserver_restart | |
533 | fi | |
534 | ||
535 | %files | |
536 | %defattr(644,root,root,755) | |
537 | %doc doc/* | |
538 | %dir %{_sysconfdir} | |
539 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/flixd-license.conf | |
540 | %attr(640,root,flixd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hostinfo | |
541 | %attr(640,root,flixd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/flixengine.lic | |
542 | %dir %{_libexecdir} | |
543 | %attr(755,root,root) %{_libexecdir}/libavcodec.so.*.*.* | |
544 | %attr(755,root,root) %{_libexecdir}/libavcodec.so.51 | |
545 | %attr(755,root,root) %{_libexecdir}/libavformat.so.*.*.* | |
546 | %attr(755,root,root) %{_libexecdir}/libavformat.so.52 | |
547 | %attr(755,root,root) %{_libexecdir}/libavutil.so.*.*.* | |
548 | %attr(755,root,root) %{_libexecdir}/libavutil.so.49 | |
549 | %attr(755,root,root) %{_sbindir}/flixd | |
550 | %attr(755,root,root) %{_sbindir}/flixd-license-get | |
551 | %attr(755,root,root) %{_sbindir}/lget | |
552 | %attr(755,root,root) %{_sbindir}/on2_host_info | |
553 | %attr(754,root,root) /etc/rc.d/init.d/flixd | |
554 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/flixd | |
555 | %{_prefix}/lib/win32 | |
556 | ||
557 | %{_mandir}/man8/flixd.8* | |
558 | %dir %attr(771,root,flixd) /var/run/flixd | |
559 | %attr(660,root,flixd) %ghost /var/log/flixd.log | |
560 | %attr(755,root,root) %{_bindir}/mencoder-flixengine | |
561 | ||
562 | %files libs | |
563 | %defattr(644,root,root,755) | |
564 | %ifarch %{x8664} | |
565 | %attr(755,root,root) %{_libdir}/libflixengine2.so.*.* | |
566 | %attr(755,root,root) %ghost %{_libdir}/libflixengine2.so.0 | |
567 | %else | |
568 | %attr(755,root,root) %{_libdir}/libflixengine2.so.*.* | |
569 | %attr(755,root,root) %{_libdir}/libflixengine2_core.so.*.* | |
570 | %attr(755,root,root) %ghost %{_libdir}/libflixengine2.so.0 | |
571 | %attr(755,root,root) %ghost %{_libdir}/libflixengine2_core.so.0 | |
572 | %endif | |
573 | ||
574 | %files devel | |
575 | %defattr(644,root,root,755) | |
576 | %ifarch %{x8664} | |
577 | %attr(755,root,root) %{_libdir}/libflixengine2.so | |
578 | %else | |
579 | %attr(755,root,root) %{_libdir}/libflixengine2.so | |
580 | %attr(755,root,root) %{_libdir}/libflixengine2_core.so | |
581 | %endif | |
582 | %{_includedir}/flixengine2 | |
583 | %{_examplesdir}/%{name}-%{version} | |
584 | ||
585 | %if %{with java} | |
586 | %files -n java-%{name} | |
587 | %defattr(644,root,root,755) | |
588 | %attr(755,root,root) %{_jvmlibdir}/libflixengine2_jni.so | |
589 | %{_javadir}/flixengine2.jar | |
590 | %{_examplesdir}/java-%{name}-%{version} | |
591 | %endif | |
592 | ||
593 | %if %{with perl} | |
594 | %files -n perl-%{name} | |
595 | %defattr(644,root,root,755) | |
596 | %dir %{perl_vendorarch}/On2 | |
597 | %{perl_vendorarch}/On2/flixengine2.pm | |
598 | %dir %{perl_vendorarch}/auto/On2 | |
599 | %dir %{perl_vendorarch}/auto/On2/flixengine2 | |
600 | %{perl_vendorarch}/auto/On2/flixengine2/flixengine2.bs | |
601 | %attr(755,root,root) %{perl_vendorarch}/auto/On2/flixengine2/flixengine2.so | |
602 | %{_examplesdir}/perl-%{name}-%{version} | |
603 | %endif | |
604 | ||
605 | %if %{with php} | |
606 | %files -n php-%{name} | |
607 | %defattr(644,root,root,755) | |
608 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/flixengine.ini | |
609 | %attr(755,root,root) %{php_extensiondir}/flixengine2.so | |
610 | %{php_data_dir}/flixengine2.php | |
611 | %{_examplesdir}/php-%{name}-%{version} | |
612 | %endif | |
613 | ||
614 | %if %{with python} | |
615 | %files -n python-%{name} | |
616 | %defattr(644,root,root,755) | |
617 | %attr(755,root,root) %{py_sitedir}/_flixengine2.so | |
618 | %{py_sitedir}/flixengine2.py[co] | |
619 | %if "%{py_ver}" > "2.4" | |
620 | %{py_sitedir}/flixengine2-*.egg-info | |
621 | %endif | |
622 | %{_examplesdir}/python-%{name}-%{version} | |
623 | %endif | |
624 | ||
625 | %if %{with apidocs} | |
626 | %files apidocs | |
627 | %defattr(644,root,root,755) | |
628 | %{_docdir}/on2 | |
629 | %endif |