File libXNVCtrl.spec of Package libXNVCtrl

#
# spec file for package libXNVCtrl
#
# 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 libXNVCtrl
%define sover 0
Name:           libXNVCtrl
Version:        435.21
Release:        0
Summary:        NVidia Control Library
License:        GPL-2.0-only
Group:          System/Libraries
URL:            https://download.nvidia.com/XFree86/nvidia-settings/
Source0:        https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-%{version}.tar.bz2
Patch0:         libxnvctrl-soname-sover.patch
Patch1:         libxnvctrl-optflags.patch
BuildRequires:  automake
BuildRequires:  gcc
BuildRequires:  libXext-devel
BuildRequires:  make
BuildRequires:  xorg-x11-devel
ExclusiveArch:  %{ix86} x86_64
# conky
Requires:       %{name}-devel = %{version}-%{release}

%description
Library for configuring the NVIDIA Linux graphics driver. It operates by
communicating with the NVIDIA X driver, querying and updating state as
appropriate. This communication is done with the NV-CONTROL X extension.

%package -n     %{soname}%{sover}
Summary:        NVidia Control Library
Group:          System/Libraries

%description -n %{soname}%{sover}
Library for configuring the NVIDIA Linux graphics driver. It operates by
communicating with the NVIDIA X driver, querying and updating state as
appropriate. This communication is done with the NV-CONTROL X extension.

%package        devel
Summary:        Development files for %{soname}
Group:          Development/Libraries/C and C++
Requires:       %{soname}%{sover} = %{version}-%{release}
Requires:       libXext-devel
Requires:       xorg-x11-devel

%description    devel
Library for configuring the NVIDIA Linux graphics driver.

This package contains the development files for %{soname}.

%prep
%autosetup -p1 -n nvidia-settings-%{version}

%build
%make_build \
   CC="gcc" \
   NV_VERBOSE=1 \
   DO_STRIP=0 \
   STRIP_CMD=/dev/true \
   OPTFLAGS="%{optflags}" \
   -C src/%{soname}

%install
pushd src/%{soname}
install -Dm 0755 %{soname}.so.0.0.0 %{buildroot}%{_libdir}/%{soname}.so.0.0.0
ln -s %{soname}.so.0.0.0 %{buildroot}%{_libdir}/%{soname}.so.0
ln -s %{soname}.so.0 %{buildroot}%{_libdir}/%{soname}.so
install -Dm 0644 *.h -t %{buildroot}%{_includedir}/NVCtrl
popd

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

%files
%license COPYING

%files -n %{soname}%{sover}
%{_libdir}/%{soname}.so.*

%files devel
%doc doc/NV-CONTROL-API.txt doc/FRAMELOCK.txt
%{_includedir}/NVCtrl/
%{_libdir}/%{soname}.so

%changelog