SPECS: flixengine.spec - compile in %build, install in %install

glen glen at pld-linux.org
Wed Dec 13 18:49:01 CET 2006


Author: glen                         Date: Wed Dec 13 17:49:01 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- compile in %build, install in %install

---- Files affected:
SPECS:
   flixengine.spec (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: SPECS/flixengine.spec
diff -u SPECS/flixengine.spec:1.2 SPECS/flixengine.spec:1.3
--- SPECS/flixengine.spec:1.2	Wed Dec 13 18:09:06 2006
+++ SPECS/flixengine.spec	Wed Dec 13 18:48:56 2006
@@ -1,8 +1,14 @@
 # $Revision$, $Date$
+#
+# Conditional build:
+%bcond_without	autodeps	# don't BR packages needed only for resolving deps
+%bcond_with	tests	# perform "make test". needs running flixd on localhost
+#
+%include	/usr/lib/rpm/macros.perl
 Summary:	On2 Flix Engine
 Name:		flixengine
 Version:	8.0.7.0
-Release:	0.2
+Release:	0.5
 License:	not distributable
 Group:		Applications
 # download demo from http://flix.on2.com/demos/
@@ -10,18 +16,22 @@
 # Source0-md5:	ea7d3a0efaf08611aad9374259015d71
 NoSource:	0
 URL:		http://www.on2.com/developer/flix-engine-sdk
-BuildRequires:	bash
+%if %{with autodeps}
 BuildRequires:	ffmpeg-libs
-BuildRequires:	jre
 BuildRequires:	lame-libs
+%endif
+BuildRequires:	bash
+BuildRequires:	jre
 BuildRequires:	perl-base
 BuildRequires:	php-devel
 BuildRequires:	python
+BuildRequires:	rpm-perlprov >= 4.1-13
 Requires:	%{name}-libs = %{version}-%{release}
 ExclusiveArch:	%{ix86}
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define		_libexecdir	%{_prefix}/libexec
+%define		extensionsdir	%(php-config --extension-dir 2>/dev/null)
 
 %description
 The On2 Flix Engine provides many of the Flash 8 video encoding
@@ -81,13 +91,59 @@
 
 cd .flix-engine-installation-files
 %{__sed} -i -e '
+# force installing initscript into buildroot without detection
 s,^initchk$,inittype=sysv1; INITDIR=$RPM_BUILD_ROOT/etc/rc.d/init.d,
+
+# cls is annoying
 s,clear 2>\$nullout,#&,
+
+# we want to install examples, but not compile them in install
+# and somewhy --no-compile didn not work, had to specify also --no-modules,
+# which made no modules installed either, chicken-egg problem.
+s,COMPILEMODULES=y,COMPILEMODULES=n,
+s,INSTALLEDPERLFILES="n",INSTALLEDPERLFILES="y",
+s,INSTALLEDPHPFILES="n",INSTALLEDPHPFILES="y",
+s,INSTALLEDPYTHONFILES="n",INSTALLEDPYTHONFILES="y",
+s,INSTALLEDFLIXLIBRARIES="n",INSTALLEDFLIXLIBRARIES="y",
+s,INSTALLEDJAVAFILES="n",INSTALLEDJAVAFILES="y",
+
 ' install.sh
 
 %build
 cd .flix-engine-installation-files
 
+ln -snf flixhdrs flixengine2
+export C_INCLUDE_PATH=$(pwd)
+
+ldconfig -n flixlibs
+export LD_LIBRARY_PATH=$(pwd)/flixlibs
+export LIBRARY_PATH=$(pwd)/flixlibs
+
+# PHP
+%{__make} -C flixphp \
+	CC="%{__cc}" \
+	-f target.mk \
+
+# Perl
+cd flixperl
+%{__perl} Makefile.PL \
+	INSTALLDIRS=vendor
+%{__make} \
+	CC="%{__cc}" \
+	OPTIMIZE="%{rpmcflags}"
+%{?with_tests:%{__make} test}
+cd ..
+
+# Python
+cd flixpython
+%{__python} setup.py build
+cd ..
+
+# Java
+%{__make} -C flixjava \
+	CC="%{__cc}" \
+	-f target.mk
+
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
@@ -95,15 +151,44 @@
 ./install.sh \
 	--prefix=$RPM_BUILD_ROOT%{_prefix} \
 	--mandir=$RPM_BUILD_ROOT%{_mandir} \
-	--pidfile=/var/run/flixd.pid \
+	--flixsamples=$RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \
+	--pidfile=$RPM_BUILD_ROOT/var/run/flixd.pid \
 	--authdir=$RPM_BUILD_ROOT/var/lib/on2 \
 	--just-install \
 	--offline \
 	--yesireadtheon2license \
 	--no-compile \
+	--no-modules \
 	--no-init \
-	--noprereqlibs \
-	--install-all
+	--noprereqlibs
+
+# install bindings
+cd .flix-engine-installation-files
+# PHP
+%{__make} -C flixphp \
+	install \
+	PHPINST=$RPM_BUILD_ROOT%{extensionsdir} \
+	-f target.mk
+
+# Perl
+cd flixperl
+%{__make} pure_install \
+	DESTDIR=$RPM_BUILD_ROOT
+cd ..
+
+# Python
+cd flixpython
+%{__python} setup.py install \
+	--optimize=2 \
+	--root=$RPM_BUILD_ROOT
+cd ..
+
+# Java
+%{__make} -C flixjava \
+	SOINST=$RPM_BUILD_ROOT%{_libdir} \
+	JARINST=$RPM_BUILD_ROOT%{_javadir} \
+	install \
+	-f target.mk
 
 # symlink without buildroot
 ln -snf %{_prefix}/src/flixmodules/flixjava/doc $RPM_BUILD_ROOT%{_docdir}/on2/flixengine/javadoc
@@ -121,7 +206,7 @@
 %postun	libs -p /sbin/ldconfig
 
 %post
-if [ -s on2_host_info ]; then
+if [ ! -s /var/lib/on2/hostinfo ]; then
 	%{_sbindir}/on2_host_info > /var/lib/on2/hostinfo
 fi
 
@@ -136,7 +221,6 @@
 %dir /var/lib/on2
 %config(noreplace) %verify(not md5 mtime size) /var/lib/on2/hostinfo
 %{_libexecdir}/on2/flixengine/mencoder
-%{_datadir}/on2
 
 %files libs
 %defattr(644,root,root,755)
@@ -145,8 +229,16 @@
 
 %files devel
 %defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libflixengine2.so
+%attr(755,root,root) %{_libdir}/libflixengine2_core.so
 %{_includedir}/flixengine2
-%{_prefix}/src/flixmodules
+
+%dir %{_examplesdir}/%{name}-%{version}
+%{_examplesdir}/%{name}-%{version}/c
+%{_examplesdir}/%{name}-%{version}/java
+%{_examplesdir}/%{name}-%{version}/perl
+%{_examplesdir}/%{name}-%{version}/php
+%{_examplesdir}/%{name}-%{version}/python
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -154,6 +246,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.3  2006/12/13 17:48:56  glen
+- compile in %build, install in %install
+
 Revision 1.2  2006/12/13 17:09:06  glen
 - extract tarball and install then
 - try with system ffmpeg and lame
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/flixengine.spec?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list