File cegui.spec of Package cegui

#
# spec file for package cegui
#
# Copyright (c) 2019 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 https://bugs.opensuse.org/
#


%define soname  -0
Name:           cegui
Version:        0.8.7
Release:        wf3
Summary:        Crazy Eddie's GUI System
License:        MIT
Group:          System/Libraries
Url:            http://www.cegui.org.uk/
Source0:        %{name}-%{version}.tar.bz2
Source99:       %{name}.changes
BuildRequires:  cmake >= 2.8.12
BuildRequires:  doxygen
BuildRequires:  fribidi-devel
BuildRequires:  gcc-c++
# BuildRequires:  glm-devel
BuildRequires:  pkgconfig
BuildRequires:  tinyxml-devel


#%if 0%{?leap_version} == 420300
#We need to get the later versions of boost than the ones provided by "boost-devel"
#BuildRequires:  boost_1_61-devel
#%else
#BuildRequires:  boost-devel
#%endif

BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(libpcre)

%if 0%{?fedora_version}
BuildRequires:  freeimage-devel
%else
BuildRequires:  libfreeimage-devel
%endif

%description
Crazy Eddie's GUI System is a free library providing windowing and widgets for
graphics APIs / engines where such functionality is not natively available, or
severely lacking. The library is object orientated, written in C++, and
targeted at games developers who should be spending their time creating great
games, not building GUI sub-systems!


%package -n lib%{name}%{soname}
Summary:        Crazy Eddie's GUI System
Group:          System/Libraries
Provides:       cegui

%description -n lib%{name}%{soname}
Crazy Eddie's GUI System is a free library providing windowing and widgets for
graphics APIs / engines where such functionality is not natively available, or
severely lacking. The library is object orientated, written in C++, and
targeted at games developers who should be spending their time creating great
games, not building GUI sub-systems!

%package -n lib%{name}-devel
Summary:        Crazy Eddie's GUI System
Group:          Development/Libraries/C and C++
Requires:       lib%{name}%{soname} = %{version}

%description -n lib%{name}-devel
Crazy Eddie's GUI System is a free library providing windowing and widgets for
graphics APIs / engines where such functionality is not natively available, or
severely lacking. The library is object orientated, written in C++, and
targeted at games developers who should be spending their time creating great
games, not building GUI sub-systems!

This package contains the development libraries and headers.

%global debug_package %{nil}

%prep
%setup -q
# Fix __DATE__ and __TIME__
modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{SOURCE99}")"
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
TIME="\"$(date -d "${modified}" "+%%R")\""
grep -Rl -e "__DATE__" -e "__TIME__" | xargs sed -i -e "s/__DATE__/$DATE/g" -e "s/__TIME__/$TIME/g"

%build

cp -r samples Samples
mkdir -p build
cd build
cmake \
        -DCMAKE_INSTALL_PREFIX=%{_prefix} \
        -DCEGUI_BUILD_RENDERER_NULL=ON    \
        -DCEGUI_BUILD_PYTHON_MODULES=OFF  \
        -DCEGUI_BUILD_TESTS=OFF           \
        -DCEGUI_SAMPLES_ENABLED=OFF       \
        ..

make %{?_smp_mflags}

%install
cd build
%{__make} DESTDIR=%{buildroot} install
rm -rf %{buildroot}%{_datadir}/cegui*

%post -n lib%{name}%{soname} -p /sbin/ldconfig
%postun -n lib%{name}%{soname} -p /sbin/ldconfig

%files -n lib%{name}%{soname}
%doc COPYING README.md doc/*-LICENSE
# the *.so files are in the main packaged because they are often
# dynamically loaded, unversioned. So programs would not run without them
%{_libdir}/libCEGUI*.so.*
%{_libdir}/cegui-*

%files -n lib%{name}-devel
%defattr(0644,root,root,0755)
%{_includedir}/cegui*
%{_libdir}/libCEGUI*.so
%{_libdir}/pkgconfig/CEGUI*.pc

%changelog
openSUSE Build Service is sponsored by