File opencsg.spec of Package opencsg

Name:           opencsg
Version:        1.3.1
Release:        1
Url:            http://www.opencsg.org/
License:        GPLv2+
Group:          System/Libraries
Summary:        CSG rendering library
Source:         http://www.opencsg.org/OpenCSG-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  gcc-c++
BuildRequires:  glew-devel
BuildRequires:  freeglut-devel

%description
OpenCSG is a library that does image-based CSG rendering using OpenGL.

What is CSG, anyway? CSG is short for Constructive Solid Geometry
and denotes an approach to model complex 3D-shapes using simpler
ones. I.e., two shapes can be combined by taking the union of them,
by intersecting them, or by subtracting one shape of the other.
The most basic shapes, which are not result of such a CSG operation,
are called primitives. Primitives must be solid, i.e.,
they must have a clearly defined interior and exterior.
By construction, a CSG shape is also solid then.

%package -n libopencsg1
Group:          System/Libraries
Summary:        CSG rendering library

%description -n libopencsg1
OpenCSG is a library that does image-based CSG rendering using OpenGL.

%package devel
Group:          Development/Libraries/C and C++
Summary:        CSG rendering library
Requires:       libopencsg1 = %{version}
Requires:       glew-devel
Requires:       freeglut-devel

%description devel
Development files for OpenCSG

%prep
%setup -q -n OpenCSG-%{version}
# use system glew
rm -rf glew

%build
# do not build glew and examples
cd src
# rpath is evil
sed -i 's@-Wl,-rpath,\.\./lib@@' Makefile
make %{_smp_mflags}

%install
mkdir -p %{buildroot}%{_prefix}
mv include %{buildroot}%{_includedir}
mv lib %{buildroot}%{_libdir}

%clean
rm -rf %{buildroot}

%post -n libopencsg1 -p /sbin/ldconfig

%postun -n libopencsg1 -p /sbin/ldconfig

%files -n libopencsg1
%defattr(-,root,root)
%doc changelog.txt index.html license.txt news.html publications.html
%{_libdir}/libopencsg.so.*

%files devel
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/libopencsg.so

%changelog
openSUSE Build Service is sponsored by