Sisyphus repository
Last update: 26 january 2022 | SRPMs: 17491 | Visits: 22843147
en ru br
ALT Linux repos
S:1.2-alt1.g3f9c625

Group :: System/Kernel and hardware
RPM: acpilight

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: acpilight-1.2-alt1.g3f9c625.patch
Download


 .gear/acpilight.spec                               | 47 ++++++++++++++++++++++
 .gear/rules                                        |  3 ++
 .../tags/680166ae32c710fc3b6240bcd880eabdea0e48eb  |  6 +++
 .gear/tags/list                                    |  1 +
 Makefile                                           |  6 ++-
 xbacklight                                         |  2 +
 6 files changed, 63 insertions(+), 2 deletions(-)
diff --git a/.gear/acpilight.spec b/.gear/acpilight.spec
new file mode 100644
index 0000000..d7f2ed1
--- /dev/null
+++ b/.gear/acpilight.spec
@@ -0,0 +1,47 @@
+%define git 3f9c625
+
+Name: acpilight
+Version: 1.2
+Release: alt1.g%{git}
+
+Summary: Replacement for xbacklight that uses the ACPI interface to set brightness
+License: GPL-3.0+
+Group: System/Kernel and hardware
+URL: https://gitlab.com/wavexx/acpilight/
+Patch0: %name-%version-%release.patch
+Source0: https://gitlab.com/wavexx/acpilight/-/archive/v%{version}/%{name}-%{version}.tar.gz
+
+Conflicts: xbacklight
+
+BuildRequires: rpm-build-python3
+BuildArch: noarch
+
+%description
+Replacement for xbacklight that uses the ACPI interface to set brightness
+
+%prep
+%setup -q -n %name-%version
+
+%build
+
+%install
+mkdir -p %buildroot{%_bindir,%_udevrulesdir,%_man1dir}
+install -m755 xbacklight %buildroot%{_bindir}/
+install -m644 xbacklight.1 %buildroot%{_man1dir}/
+install -m644 90-backlight.rules %buildroot%{_udevrulesdir}/
+
+%post
+echo 'To use the xbacklight binary as a regular user, you must be a part of the video group'
+
+%files
+%doc README.rst NEWS.rst
+%_bindir/*
+%_man1dir/*
+%_udevrulesdir/*.rules
+
+%changelog
+* Wed May 26 2021 L.A. Kostis <lakostis@altlinux.ru> 1.2-alt1.g3f9c625
+- v1.2-4-g3f9c625
+- Don't obsolete xbacklight yet as it might be something which
+  still depends on it.
+- Initial build for ALTLinux.
diff --git a/.gear/rules b/.gear/rules
new file mode 100644
index 0000000..faca68c
--- /dev/null
+++ b/.gear/rules
@@ -0,0 +1,3 @@
+tar.gz: v@version@:.
+diff: v@version@:. .
+spec: .gear/acpilight.spec
diff --git a/.gear/tags/680166ae32c710fc3b6240bcd880eabdea0e48eb b/.gear/tags/680166ae32c710fc3b6240bcd880eabdea0e48eb
new file mode 100644
index 0000000..0d47385
--- /dev/null
+++ b/.gear/tags/680166ae32c710fc3b6240bcd880eabdea0e48eb
@@ -0,0 +1,6 @@
+object 06fcb7452e8b79107860425af4aecc1dac9e06b1
+type commit
+tag v1.2
+tagger Yuri D'Elia <wavexx@thregr.org> 1561229795 +0200
+
+acpilight 1.2
diff --git a/.gear/tags/list b/.gear/tags/list
new file mode 100644
index 0000000..0dbe225
--- /dev/null
+++ b/.gear/tags/list
@@ -0,0 +1 @@
+680166ae32c710fc3b6240bcd880eabdea0e48eb v1.2
diff --git a/Makefile b/Makefile
index a78f378..50e1231 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,8 @@ mandir = $(datarootdir)/man
 man1dir = $(mandir)/man1
 sysconfdir = /etc
 
-.PHONY: install
+all:
+
 install: xbacklight xbacklight.1 90-backlight.rules
 	$(NORMAL_INSTALL)
 	install -vCDt $(DESTDIR)$(bindir) xbacklight
@@ -16,8 +17,9 @@ install: xbacklight xbacklight.1 90-backlight.rules
 	$(POST_INSTALL)
 	udevadm trigger -s backlight -c add
 
-.PHONY: uninstall
 uninstall:
 	rm -f $(DESTDIR)$(bindir)/xbacklight
 	rm -f $(DESTDIR)$(man1dir)/xbacklight.1
 	rm -f $(DESTDIR)$(sysconfdir)/udev/rules.d/90-backlight.rules
+
+.PHONY: install uninstall all
diff --git a/xbacklight b/xbacklight
index 2cb0fa8..f1c2187 100755
--- a/xbacklight
+++ b/xbacklight
@@ -82,6 +82,8 @@ class LogController(RawController):
 
     @property
     def brightness(self):
+        if super().brightness == 0:
+            return 0
         return log10(super().brightness)/log10(super().max_brightness)*self.max_brightness
 
     @brightness.setter
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin