File libspe2.spec of Package libspe2

#
# spec file for package libspe2 (Version 2.3.0)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           libspe2
License:        GPL v2 or later; LGPL v2.1 or later
Group:          Development/Libraries/Cross
AutoReqProv:    on
Version:        2.3.0
Release:        5.<RELEASE1>
Summary:        Helper for standalone SPE applications
Url:            http://www.bsc.es/plantillaH.php?cat_id=253
PreReq:         %insserv_prereq grep coreutils aaa_base
Provides:       libspe
Obsoletes:      libspe
Source0:        %{name}-%{version}.tar.bz2
Source1:        elfspe
Patch0:         libspe2.ps.patch
Patch1:         libspe2.binfmt.patch
Patch2:         libspe2.fix-suse-startup.patch
Patch3:         libspe2.fix-paths.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  ppc ppc64
# match Cell for package installation
Supplements:    modalias(platform:cbe-mic)
# match ps3flash for package installation
Supplements:    modalias(ps3:8)

%description
The libspe is a library interface that has been established on top of
the spufs low-level programming model. The library interface does not
rely on implementation details of the file system and can also be used
on other operating systems that might have a different kernel
interface.



%prep
%setup
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1

%build
make EXTRA_CFLAGS="$RPM_OPT_FLAGS" prefix=%{_prefix} libdir=%{_libdir}

%install
#rm -rf $RPM_BUILD_ROOT
make install elfspe-install DESTDIR=$RPM_BUILD_ROOT prefix=%{_prefix} libdir=%{_libdir} 
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
cp %{S:1} $RPM_BUILD_ROOT/etc/init.d/elfspe
# delete static libs
rm $RPM_BUILD_ROOT%{_libdir}/libspe*.a

%post 
/sbin/ldconfig
if grep -q 'Cell Broadband Engine' < /proc/cpuinfo ; then
	%{fillup_and_insserv -y elfspe }
	# check that we are not in chroot
	if [ $(stat -Lc '%%D-%%i' /) = $(stat -Lc '%%D-%%i' /proc/1/root) ] ; then
		# start elfspe if it's not running
		if [ ! -e /proc/sys/fs/binfmt_misc/spe ] ; then
			/etc/init.d/elfspe start
		fi
	fi
fi

%postun
/sbin/ldconfig
%{insserv_cleanup}

%preun
%stop_on_removal elfspe

%files
%defattr(-,root,root)   
%{_libdir}/lib*.so.*
%attr(755,root,root) /usr/bin/*
%attr(755,root,root) /etc/init.d/elfspe

%package -n libspe2-devel
License:        LGPL v2.1 or later
Requires:       %{name} = %{version}
Summary:        Helper for standalone SPE applications
Group:          Development/Libraries/Cross

%description -n libspe2-devel
The libspe is a library interface that has been established on top of
the spufs low-level programming model. This package holds the
development files.



%files -n %{name}-devel
%defattr(-,root,root)
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*
/usr/include/*

%changelog
* Tue Jan 20 2009 sassmann@suse.de
- add a check to elfspe-register that mounts binfmnt_misc if
  it is not mounted yet (bnc#467540)
* Wed Nov 19 2008 sassmann@suse.de
- add PreReqs coreutils, aaa_base to spec (bnc#446424)
* Wed Nov 05 2008 sassmann@suse.de
- add supplements statement to match Cell hardware for automatic
  package installation (bnc#430179)
* Fri Oct 24 2008 sassmann@suse.de
- update libspe2 to version 2.3.0 (bnc#438245)
- register elfspe directly after install (bnc#438247)
* Tue Oct 21 2008 ro@suse.de
- add libspe2-devel to baselibs.conf
* Wed Jul 23 2008 sassmann@suse.de
- branch libspe2-devel package
* Mon Jul 14 2008 sassmann@suse.de
- package rename to libspe2
- update to version 2.2.80 (required for fate #304004)
* Thu Apr 10 2008 ro@suse.de
- added baselibs.conf file to build xxbit packages
  for multilib support
* Thu Aug 09 2007 sassmann@suse.de
- corrected elfspe boot script to conform with suse boot concept
* Fri May 11 2007 sassmann@suse.de
- added post-install script to mount spufs filesystem
- added example program
* Fri Apr 13 2007 sassmann@suse.de
-fixed problem if binfmt_misc module wasn't loaded in elfspe/scripts/elfspe-register
* Wed Apr 04 2007 sassmann@suse.de
-update to version 2.1.0
* Tue Apr 03 2007 sassmann@suse.de
-new package version 1.2.0
openSUSE Build Service is sponsored by