File glxosd.spec of Package glxosd

#
# spec file for package glxosd
#
# Copyright (c) 2017 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:           glxosd
Version:        3.2.2
Release:        0
Summary:        On-Screen-Display for OpenGL applications
License:        MIT
Group:          System/X11/Utilities
Url:            https://glxosd.nickguletskii.com/
Source:         %{name}-%{version}.tar.xz
Source1:        baselibs.conf
# As stated in https://en.opensuse.org/openSUSE:Packaging_checks#devel-file-in-non-devel-package the package requires
# the provided .so files in order to function, as such, the rpmlint error can be considered a false-positive and ignored.
Source2:        %{name}-rpmlintrc
Patch0:         64bit_portability.patch
BuildRequires:  boost-devel
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  fontconfig-devel
BuildRequires:  freetype-devel
BuildRequires:  gcc-c++
BuildRequires:  glu-devel
BuildRequires:  libsensors4-devel
Recommends:     %{name}-sensors-plugin

%description
GLXOSD is an extensible on-screen display (OSD) for OpenGL applications running on Linux
with X11 which aims to provide similar functionality to MSI Afterburner/RivaTuner OSD.
It can show FPS, frame timings, temperatures and more in OpenGL games and applications.
It can also be used to benchmark games, much like voglperf.

%package nvidia-plugin
Summary:        GLXOSD plugin for Nvidia drivers compatibility
Group:          System/X11/Utilities
BuildArch:      noarch

%description nvidia-plugin
GLXOSD plugin for compatibility with Nvidia's proprietary drivers.

%package sensors-plugin
Summary:        GLXOSD plugin to show temperatures
Group:          System/X11/Utilities
BuildArch:      noarch

%description sensors-plugin
GLXOSD plugin for CPU temperatures and other temperatures available through lm-sensors.

%prep
%setup -q
cd src/freetype-gl-glxosd/freetype-gl
%patch0 -p1

%build
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo \
      -G "Unix Makefiles"
make %{?_smp_mflags} all

%install
%make_install
mkdir -p %{buildroot}%{_datadir}/licenses/glxosd
%fdupes %{buildroot}%{_datadir}

%files nvidia-plugin
%defattr(-,root,root)
%{_datadir}/%{name}/%{name}/plugins/OSD/dataproviders/NVMLDataProvider.lua
%{_datadir}/%{name}/%{name}/ffi/nvml.lua
%config(noreplace) %{_sysconfdir}/%{name}/OSD/dataproviders/NVMLDataProvider

%files sensors-plugin
%defattr(-,root,root)
%{_datadir}/%{name}/%{name}/plugins/OSD/dataproviders/LibsensorsDataProvider.lua
%{_datadir}/%{name}/%{name}/ffi/libsensors.lua
%config(noreplace) %{_sysconfdir}/%{name}/OSD/dataproviders/LibsensorsDataProvider

%files
%defattr(-,root,root)
%doc README.md
%doc AUTHORS
%license LICENSE

%config(noreplace) %{_sysconfdir}/%{name}
%attr(755, root, root) %{_bindir}/%{name}
%{_datadir}/%{name}
%dir %{_datadir}/licenses

%{_libdir}/%{name}

%exclude %{_datadir}/%{name}/%{name}/conf

%exclude %{_datadir}/%{name}/%{name}/ffi/nvml.lua
%exclude %{_sysconfdir}/%{name}/OSD/dataproviders/NVMLDataProvider
%exclude %{_datadir}/%{name}/%{name}/plugins/OSD/dataproviders/NVMLDataProvider.lua

%exclude %{_datadir}/%{name}/%{name}/plugins/OSD/dataproviders/LibsensorsDataProvider.lua
%exclude %{_datadir}/%{name}/%{name}/ffi/libsensors.lua
%exclude %{_sysconfdir}/%{name}/OSD/dataproviders/LibsensorsDataProvider

%changelog
openSUSE Build Service is sponsored by