Blob Blame History Raw
%bcond_with debug

Name: gtengine
Summary: Library for computations in mathematics, graphics, image analysis, and physics
Version:  3.8
Release:  3%{?dist}
License:  Boost
URL: http://www.geometrictools.com
Source0:  http://www.geometrictools.com/Downloads/GeometricToolsEngine3p8.zip
Source1:  http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt

BuildRequires: pkgconfig(freeglut)
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(libpng)
BuildRequires: glibc-devel
BuildRequires: gcc-c++
BuildRequires: libstdc++-devel

%description
A library of source code for computing in the fields of mathematics,
graphics, image analysis, and physics.
The engine is written in C++ 11 and, as such, has portable access
to standard constructs for multithreading programming on cores.
The engine also supports high-performance computing using general
purpose GPU programming (GPGPU).
SIMD code is also available using Intel Streaming SIMD Extensions (SSE).

GTEngine requires OpenGL 4.3 (or later) and GLSL 4.3 (or later)
in order to support compute shaders and GLSL introspection.

This is new version of Wild Magic 5 Engine.

%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: pkgconfig
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%package samples
Summary: Samples files of %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description samples
This package contains samples files for
testing that use %{name}.

%prep
%setup -q -n GeometricTools
cp -p %{SOURCE1} License

%build
%if %{with debug}
export LDFLAGS="%{__global_ldflags} -lpthread  -lglut -lGL -lX11 -lpng -Wl,--as-needed -lm -Wl,--no-undefined -Wl,--no-allow-shlib-undefined"
export CFLAGS="-g -O0 -D_DEBUG -pthread"
mkdir -p GTEngine/obj/DebugDynamic
make CFG=DebugDynamic -f makeengine.gte -C GTEngine %{?_smp_mflags}
pushd GTEngine/lib/DebugDynamic
ln -sf libgtengine.so.%{version} libgtengine.so.3
ln -sf libgtengine.so.%{version} libgtengine.so
popd
%else
export LDFLAGS="%{__global_ldflags} -lpthread  -lglut -lGL -lX11 -lpng -Wl,--as-needed -lm -Wl,--no-undefined -Wl,--no-allow-shlib-undefined"
export CFLAGS="%{optflags} -pthread -DNDEBUG"
mkdir -p GTEngine/obj/ReleaseDynamic
make CFG=ReleaseDynamic -f makeengine.gte -C GTEngine %{?_smp_mflags}
pushd GTEngine/lib/ReleaseDynamic
ln -sf libgtengine.so.%{version} libgtengine.so.3
ln -sf libgtengine.so.%{version} libgtengine.so
popd
%endif

%if %{with debug}
make CFG=DebugDynamic -f makeallsamples.gte -C GTEngine/Samples -j 1 \
 CFLAGS="-g -O0 -D_DEBUG -pthread -c -D__LINUX__ -DGTE_DEV_OPENGL -std=c++14" \
 INCPATH="-I../../../Include" LIBS:="%{__global_ldflags} -L../../../lib/DebugDynamic -lgtengine -L%{_libdir} -lX11 -lXext -lGL -lpng -lpthread -lm"
%else
make CFG=ReleaseDynamic -f makeallsamples.gte -C GTEngine/Samples -j 1 \
 CFLAGS="%{optflags} -DNDEBUG -pthread -c -D__LINUX__ -DGTE_DEV_OPENGL -std=c++14" \
 INCPATH="-I../../../Include" LIBS:="%{__global_ldflags} -L../../../lib/ReleaseDynamic -lgtengine -L%{_libdir} -lX11 -lXext -lGL -lpng -lpthread -lm"
%endif

%install
##Manual installation

mkdir -p $RPM_BUILD_ROOT%{_libdir}/pkgconfig
install -pm 755 GTEngine/lib/ReleaseDynamic/* $RPM_BUILD_ROOT%{_libdir}
ln -sf libgtengine.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libgtengine.so.3
ln -sf libgtengine.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libgtengine.so

mkdir -p $RPM_BUILD_ROOT%{_includedir}/GTEngine
cp -a GTEngine/Include/* $RPM_BUILD_ROOT%{_includedir}/GTEngine

# Install samples files
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/%{name}
cp -a GTEngine/Samples $RPM_BUILD_ROOT%{_libexecdir}/%{name}

# Remove unsed files
for i in `find $RPM_BUILD_ROOT%{_libexecdir}/%{name}/Samples -type f \( -name "*.h" -o -name "*.filters" -o -name "*.vcxproj" -o -name "*.sln" -o -name "*.cpp" -o -name "*.gte" -o -name "*.o" \)`; do
rm -f $i
done

for i in `find $RPM_BUILD_ROOT%{_libexecdir}/%{name}/Samples -type d \( -name "ReleaseDynamic" \)`; do
rm -rf $i
done

##Edit a pkg-config file
cat > $RPM_BUILD_ROOT%{_libdir}/pkgconfig/gtengine.pc <<EOF
prefix=%{_prefix}
exec_prefix=%{_prefix}
libdir=%{_libdir}
includedir=%{_includedir}

xthreadlib=-lpthread

Name: GTEngine
Description: Library for computations in mathematics, graphics, image analysis, and physics
Version: %{version}
Cflags: -I%{_includedir}/GTEngine
Libs: -lgtengine
Libs.private: -lpthread
EOF

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%license License
%{_libdir}/*.so.*

%files devel
%{_includedir}/GTEngine/
%{_libdir}/*.so
%{_libdir}/pkgconfig/gtengine.pc

%files samples
%doc GTEngine/Gte3p8InstallationRelease.pdf
%{_libexecdir}/%{name}/

%changelog
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sun Jun 11 2017 Antonio Trande <sagitter@fedoraproject.org> 3.8-1
- Update to 3.8

* Mon May 15 2017 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild

* Tue Feb 07 2017 Antonio Trande <sagitter@fedoraproject.org> 3.7-1
- Update to 3.7

* Sun Feb 05 2017 Antonio Trande <sagitter@fedoraproject.org> 3.6-1
- Update to 3.6

* Sun Dec 25 2016 Antonio Trande <sagitter@fedoraproject.org> 3.5-1
- Update to 3.5

* Tue Nov 15 2016 Antonio Trande <sagitter@fedoraproject.org> 3.4-1
- Update to 3.4

* Sat Oct 01 2016 Antonio Trande <sagitter@fedoraproject.org> 3.3-1
- Update to 3.3

* Thu Jul 07 2016 Antonio Trande <sagitter@fedoraproject.org> 3.2-2
- Make obj directories (strange assembler error)

* Thu Jul 07 2016 Antonio Trande <sagitter@fedoraproject.org> 3.2-1
- Update to 3.2

* Sun Jun 26 2016 Antonio Trande <sagitter@fedoraproject.org> 3.1-1
- Update to 3.1

* Sun May 29 2016 Antonio Trande <sagitter@fedoraproject.org> 2.5-1
- Update to 2.5

* Sat Apr 09 2016 Antonio Trande <sagitter@fedoraproject.org> 2.4-1
- Update to 2.4

* Sat Apr 02 2016 Antonio Trande <sagitter@fedoraproject.org> 2.3-4
- Parallel Make disabled

* Fri Apr 01 2016 Antonio Trande <sagitter@fedoraproject.org> 2.3-3
- Install commands modified

* Fri Apr 01 2016 Antonio Trande <sagitter@fedoraproject.org> 2.3-2
- Renamed as gtengine

* Wed Mar 16 2016 Antonio Trande <sagitter@fedoraproject.org> 2.3-1
- Update to 2.3

* Mon Feb 22 2016 Antonio Trande <sagitter@fedoraproject.org> 2.2-1
- Update to 2.2

* Wed Jan 27 2016 Antonio Trande <sagitter@fedoraproject.org> 2.1-1
- Update to 2.1

* Tue Sep 29 2015 Antonio Trande <sagitter@fedoraproject.org> 2.0-1
- Update to 2.0

* Mon Jun 29 2015 Antonio Trande <sagitter@fedoraproject.org> 1.14-1
- First package