File xsct.spec of Package xsct

#
# spec file for package xsct
#
# Copyright (c) 2022 SUSE Software Solutions Germany 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 _name   sct

Name:           xsct
Version:        2.3
Release:        0
Summary:        X11 set screen color temperature
License:        Unlicense
Group:          System/GUI/Other
URL:            https://github.com/faf0/%{_name}
Source0:        https://github.com/faf0/%{_name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  gcc
BuildRequires:  fdupes
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xrandr)

%description
xsct is a small C program to change the screen color temperature.
It can be used to reduce or increase the amount of blue light
produced by the screen.

The xsct tool sets the color temperature of the screen via xrandr
like redshift. Unlike redshift, it is only 80 lines of C and will
not change the screen temperature automatically.

# Currently no language support, enable if needed and make sure to remove the
# escaping.
#%%lang_package

%prep
%if (0%{?suse_version} < 1550 && 0%{?sle_version} < 150300)
%setup -q -n %{_name}-%{version}
%else
%autosetup -n %{_name}-%{version}
%endif

%build
%if (0%{?suse_version} < 1550 && 0%{?sle_version} < 150400)
# We don't want to actually run configure, but get the flags exported only.
%define _configure :
%configure
%else
%set_build_flags
%endif
export 'CC=%{__cc}'

# Make sure to clear out LDFLAGS if %%set_build_flags or the like didn't
# define it - otherwise we'll end up with the default settings providing
# -s and stripping the binary, which is not what we want for debuginfo
# support.
[ -z "${LDFLAGS}" ] && export LDFLAGS=''

%if 0%{?suse_version} >= 1500
%make_build
%else
make %{?_smp_mflags}
%endif

%install
%make_install

%fdupes %{buildroot}

# No language support yet, disabled.
#%%find_lang %%{name}

%files
%if 0%{?suse_version} < 1500
%defattr(-,root,root)
%endif
%license LICENSE
%doc CHANGELOG README.md
%{_bindir}/xsct
%{_mandir}/man1/xsct.1%{?ext_man}

# No language support yet, disabled.
#%%files lang -f %%{name}.lang

%changelog
openSUSE Build Service is sponsored by