glm/glm.spec

111 lines
3.4 KiB
RPMSpec
Raw Normal View History

#
# spec file for package glm
#
# Copyright (c) 2016 SUSE LINUX 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/
#
Name: glm
Version: 0.9.7.4
Release: 0
Summary: Header only C++ mathematics library for graphics
License: MIT
Group: Development/Libraries/C and C++
Url: http://glm.g-truc.net/
Source0: https://github.com/g-truc/glm/releases/download/%{version}/%{name}-%{version}.zip
# PATCH-FIX-OPENSUSE glm-cmake-config.patch -- Fix cmake config location
Patch1: glm-cmake-config.patch
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: unzip
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
OpenGL Mathematics (GLM) is a header only C++ mathematics library for graphics
software based on the OpenGL Shading Language (GLSL) specification.
GLM provides classes and functions designed and implemented with the same naming
conventions and functionalities than GLSL so that when a programmer knows GLSL,
he knows GLM as well which makes it really easy to use.
%package devel
Summary: Header only C++ mathematics library for graphics
Group: Development/Libraries/C and C++
Requires: cmake
%description devel
OpenGL Mathematics (GLM) is a header only C++ mathematics library for graphics
software based on the OpenGL Shading Language (GLSL) specification.
GLM provides classes and functions designed and implemented with the same naming
conventions and functionalities than GLSL so that when a programmer knows GLSL,
he knows GLM as well which makes it really easy to use.
%package doc
Summary: Documentation for GLM library
Group: Documentation/Other
BuildArch: noarch
%description doc
This package provides the documentation for GLM library.
%prep
%setup -q -n %{name}
# Fix wrong-file-end-of-line-encoding
sed -i 's/\r//' copying.txt
sed -i 's/\r//' readme.md
sed -i 's/\r//' doc/api/doxygen.css
sed -i 's/\r//' doc/api/tabs.css
%ifarch %ix86
sed -i '/glmCreateTestGTC(core_func_exponential)/d' test/core/CMakeLists.txt
# https://github.com/g-truc/glm/issues/212
sed -i '/glmCreateTestGTC(gtc_packing)/d' test/gtc/CMakeLists.txt
%if 0%{?suse_version} <= 1320
# https://github.com/g-truc/glm/issues/296
sed -i '/glmCreateTestGTC(gtc_integer)/d' test/gtc/CMakeLists.txt
%endif
%if 0%{?suse_version} <= 1320
sed -i '/glmCreateTestGTC(gtx_common)/d' test/gtx/CMakeLists.txt
%endif
%endif
%patch1 -p1
%build
%cmake \
-DCMAKE_CXX_FLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
-DGLM_TEST_ENABLE=ON
make %{?_smp_mflags}
%install
%cmake_install
%fdupes -s %{buildroot}
%check
%ctest
%files devel
%defattr(-,root,root,-)
%{_includedir}/glm/
%{_libdir}/cmake/%{name}/
%doc copying.txt
%files doc
%defattr(-,root,root,-)
%doc doc/api
%doc doc/glm.pdf
%doc readme.md
%changelog