File sfml2.spec of Package sfml2

#
# spec file for package sfml2
#
# Copyright (c) 2015 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/
#


%define so_ver -2_3

Name:           sfml2
Version:        2.3.2
Release:        0
Summary:        Free multimedia C++ API
License:        Zlib
Group:          Development/Libraries/C and C++
Url:            http://www.sfml-dev.org/
# Source: https://github.com/SFML/SFML/archive/%%{version}/SFML-%%{version}.tar.gz
Source0:        SFML-%{version}.tar.gz
Source1:        baselibs.conf
BuildRequires:  cmake
BuildRequires:  dos2unix
BuildRequires:  doxygen
%if 0%{?suse_version}
BuildRequires:  fdupes
%endif
BuildRequires:  freetype2-devel
BuildRequires:  gcc-c++
BuildRequires:  libjpeg-devel
BuildRequires:  libudev-devel
BuildRequires:  openal-soft-devel
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(flac)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(glu)
BuildRequires:  pkgconfig(vorbis)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xcb-image)
BuildRequires:  pkgconfig(xrandr)
Requires:       lib%{name}%{so_ver} = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
SFML is a free multimedia C++ API that provides you low and high level access to graphics, input, audio, etc.
SFML is a portable and easy to use multimedia API written in C++. You can see it as a modern, object-oriented alternative to SDL.
SFML is composed of several packages to perfectly suit your needs. You can use SFML as a minimal windowing system to interface with OpenGL, or as a fully-featured multimedia library for building games or interactive programs.

%package -n lib%{name}%{so_ver}
Summary:        Free multimedia C++ API
Group:          Development/Libraries/C and C++

%description -n lib%{name}%{so_ver}
SFML is a free multimedia C++ API that provides you low and high level access to graphics, input, audio, etc.
SFML is a portable and easy to use multimedia API written in C++. You can see it as a modern, object-oriented alternative to SDL.
SFML is composed of several packages to perfectly suit your needs. You can use SFML as a minimal windowing system to interface with OpenGL, or as a fully-featured multimedia library for building games or interactive programs.

%package devel
Summary:        SFML development files
Group:          Development/Libraries/C and C++
Requires:       lib%{name}%{so_ver} = %{version}
# Conflict with the sfml 1 devel package(same include files)
Conflicts:      sfml-devel

%description devel
SFML is a free multimedia C++ API that provides you low and high level access to graphics, input, audio, etc.
SFML is a portable and easy to use multimedia API written in C++. You can see it as a modern, object-oriented alternative to SDL.
SFML is composed of several packages to perfectly suit your needs. You can use SFML as a minimal windowing system to interface with OpenGL, or as a fully-featured multimedia library for building games or interactive programs.

%package doc
Summary:        SFML developer documentation
Group:          Documentation/HTML
BuildArch:      noarch

%description doc
SFML is a free multimedia C++ API that provides you low and high level access to graphics, input, audio, etc.
SFML is a portable and easy to use multimedia API written in C++. You can see it as a modern, object-oriented alternative to SDL.
SFML is composed of several packages to perfectly suit your needs. You can use SFML as a minimal windowing system to interface with OpenGL, or as a fully-featured multimedia library for building games or interactive programs.

%prep
%setup -q -n SFML-%{version}
dos2unix license.txt

%build
%cmake -DSFML_BUILD_DOC=TRUE \
       -DSFML_INSTALL_PKGCONFIG_FILES=TRUE \
       -DCMAKE_BUILD_TYPE=RelWithDebInfo
make VERBOSE=1 %{?_smp_mflags}

%if 0%{?suse_version}
pushd doc/html
    %fdupes -s .
popd
%endif

%install
cd build
%make_install
# Remove doc from wrong location
rm -r %{buildroot}%{_datadir}/SFML/doc
rm %{buildroot}%{_datadir}/SFML/*.txt

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

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

%files -n lib%{name}%{so_ver}
%defattr(-,root,root)
%doc readme.txt license.txt changelog.txt CONTRIBUTING
%{_libdir}/libsfml-*.so.*

%files devel
%defattr(-,root,root)
%{_includedir}/SFML
%{_libdir}/libsfml-*.so
%{_libdir}/pkgconfig/sfml-*.pc
%dir %{_datadir}/SFML
%{_datadir}/SFML/cmake/

%files doc
%defattr(-,root,root)
%doc build/doc/html/*

%changelog
openSUSE Build Service is sponsored by