2019-02-25 10:32:31 +01:00
|
|
|
#
|
|
|
|
# spec file for package brightnessctl
|
|
|
|
#
|
2020-01-31 14:48:20 +01:00
|
|
|
# Copyright (c) 2020 SUSE LLC
|
2019-02-25 10:32:31 +01:00
|
|
|
# Copyright (c) 2019 R Tyler Croy <rtyler@brokenco.de>
|
|
|
|
# Copyright (c) 2016 Fabio Alessandro Locati <fale@fedoraproject.org>
|
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2020-01-31 14:48:20 +01:00
|
|
|
# use systemd-logind instead of udev for systemd >= 243
|
|
|
|
%if 0%{?sle_version} >= 150200 || 0%{?suse_version} > 1500
|
|
|
|
%global use_logind 1
|
|
|
|
%else
|
|
|
|
%global use_logind 0
|
|
|
|
%endif
|
2019-02-25 10:32:31 +01:00
|
|
|
Name: brightnessctl
|
|
|
|
Version: 0.4
|
2019-04-30 16:06:54 +02:00
|
|
|
Release: 0
|
2019-05-22 09:42:40 +02:00
|
|
|
Summary: Tool to read and control device brightness
|
2019-02-25 10:32:31 +01:00
|
|
|
License: MIT
|
|
|
|
URL: https://github.com/Hummer12007/%{name}
|
2020-01-31 14:48:20 +01:00
|
|
|
Source: %{URL}/archive/%{version}.tar.gz
|
|
|
|
# required to resolve cherry pick conflicts
|
|
|
|
# https://github.com/Hummer12007/brightnessctl/commit/aa6a71cd8206992a64269239f038dbf5f516e54a
|
|
|
|
Patch0: 0001-Fixed-inconsistency-in-README-thanks-AJGQ.patch
|
|
|
|
# https://github.com/Hummer12007/brightnessctl/pull/33
|
|
|
|
Patch1: 0002-Support-the-new-SetBrightness-logind-API.patch
|
|
|
|
Patch2: 0003-Make-the-use-of-SetBrightness-dynamic.patch
|
|
|
|
# https://github.com/Hummer12007/brightnessctl/pull/41
|
|
|
|
Patch3: 0004-Use-non-suid-permissions-when-logind-is-used.patch
|
2019-02-25 10:32:31 +01:00
|
|
|
BuildRequires: gcc
|
|
|
|
BuildRequires: make
|
2020-01-31 14:48:20 +01:00
|
|
|
%if %{use_logind}
|
|
|
|
BuildRequires: pkgconfig(libsystemd)
|
|
|
|
Requires: systemd >= 243
|
|
|
|
%else
|
2019-05-22 09:42:40 +02:00
|
|
|
BuildRequires: systemd-rpm-macros
|
2020-01-31 14:48:20 +01:00
|
|
|
%endif
|
2019-02-25 10:32:31 +01:00
|
|
|
|
|
|
|
%description
|
2019-05-22 09:42:40 +02:00
|
|
|
A utility to read and control the display brightness.
|
2019-02-25 10:32:31 +01:00
|
|
|
|
|
|
|
%prep
|
2020-01-31 14:48:20 +01:00
|
|
|
%autosetup -N
|
|
|
|
%if %{use_logind}
|
|
|
|
%autopatch -p1
|
|
|
|
%endif
|
2019-02-25 10:32:31 +01:00
|
|
|
|
|
|
|
%build
|
2020-01-31 14:48:20 +01:00
|
|
|
%if %{use_logind}
|
|
|
|
export ENABLE_SYSTEMD=1
|
|
|
|
%{set_build_flags}
|
|
|
|
%else
|
2019-02-25 10:32:31 +01:00
|
|
|
export MODE="4755"
|
2020-01-31 14:48:20 +01:00
|
|
|
export CFLAGS="%{optflags}"
|
|
|
|
%endif
|
2019-02-25 10:32:31 +01:00
|
|
|
%make_build
|
|
|
|
|
|
|
|
%install
|
2020-01-31 14:48:20 +01:00
|
|
|
%if %{use_logind}
|
|
|
|
%make_install INSTALL_UDEV_RULES=0 ENABLE_SYSTEMD=1 PREFIX=%{_prefix}
|
|
|
|
%else
|
2019-05-22 09:42:40 +02:00
|
|
|
%make_install UDEVDIR=%{_udevrulesdir}
|
2020-01-31 14:48:20 +01:00
|
|
|
%endif
|
2019-02-25 10:32:31 +01:00
|
|
|
|
|
|
|
%files
|
|
|
|
%doc README.md
|
|
|
|
%license LICENSE
|
|
|
|
%{_bindir}/%{name}
|
2020-01-31 14:48:20 +01:00
|
|
|
%if ! %{use_logind}
|
2019-02-25 10:32:31 +01:00
|
|
|
%{_udevrulesdir}/90-brightnessctl.rules
|
2020-01-31 14:48:20 +01:00
|
|
|
%endif
|
2019-02-25 10:32:31 +01:00
|
|
|
%{_mandir}/man1/brightnessctl.1%{?ext_man}
|
|
|
|
|
|
|
|
%changelog
|