File Clight.spec of Package Clight

#
# spec file for package Clight
#
# Copyright (c) 2024 SUSE LLC
#
# 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/
#


Name:           Clight
Version:        4.11
Release:        0
Summary:        C daemon to turn webcam into light sensor
License:        GPL-3.0-or-later
Group:          System/Daemons
URL:            https://github.com/FedeDP/Clight
Source0:        https://github.com/FedeDP/Clight/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  cmake
BuildRequires:  fish
BuildRequires:  hicolor-icon-theme
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(bash-completion)
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(fish)
BuildRequires:  pkgconfig(gsl)
BuildRequires:  pkgconfig(libconfig)
BuildRequires:  pkgconfig(libmodule) >= 5.0.0
BuildRequires:  pkgconfig(libsystemd) >= 234
BuildRequires:  pkgconfig(popt)
Requires:       Clightd >= 5.0
# for busctl
Requires:       systemd >= 234

%description
A C daemon that turns webcam into a light sensor.
It will adjust screen backlight based on ambient brightness.

%package devel
Summary:       Devel files for creating Clight modules
Requires:      %{name} = %{version}

%description devel
Contains header files to create modules for the Clight package.

%package bash-completion
Summary:        Bash Completion for %{name}
Group:          System/Daemons
Requires:       %{name} = %{version}
Requires:       bash-completion
Supplements:    (%{name} and bash)
BuildArch:      noarch

%description bash-completion
Bash command line completion support for %{name}.

%package fish-completion
Summary:        Fish Completion for %{name}
Group:          System/Daemons
Requires:       %{name} = %{version}
Supplements:    (%{name} and fish)
BuildArch:      noarch

%description fish-completion
Fish command line completion support for %{name}.

%package zsh-completion
Summary:        ZSH Completion for %{name}
Group:          System/Daemons
Requires:       %{name} = %{version}
Supplements:    (%{name} and zsh)
BuildArch:      noarch

%description zsh-completion
ZSH command line completion support for %{name}.


%prep
%autosetup -p1

%build
%cmake
%cmake_build

%install
%cmake_install
%suse_update_desktop_file -r clightc "Settings;HardwareSettings;"

%files
%license COPYING
%doc README.md
%{_bindir}/clight
%dir %{_datadir}/clight
%{_datadir}/applications/clightc.desktop
%{_datadir}/clight/inhibit_bl.skel
%{_datadir}/clight/nightmode.skel
%{_datadir}/clight/synctemp_bumblebee.skel
%{_datadir}/dbus-1/services/org.clight.clight.service
%{_datadir}/icons/hicolor/scalable/apps/clight.svg
%{_mandir}/man1/clight.1%{?ext_man}
%dir %{_sysconfdir}/clight/
%config %{_sysconfdir}/clight/*
# _distconfdir is unknown in openSUSE Leap
%if 0%{?sle_version} >= 150400 && 0%{?sle_version} < 160000 && 0%{?is_opensuse}
%dir %{_prefix}%{_sysconfdir}
%dir %{_prefix}%{_sysconfdir}/xdg
%dir %{_prefix}%{_sysconfdir}/xdg/autostart
%{_prefix}%{_sysconfdir}/xdg/autostart/clight.desktop
%else
%{_distconfdir}/xdg/autostart/clight.desktop
%endif

%files devel
%dir %{_includedir}/clight
%{_includedir}/clight/public.h

%files bash-completion
%{_datadir}/bash-completion/completions/clight

%files fish-completion
%{_datadir}/fish/vendor_completions.d/clight.fish

%files zsh-completion
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_clight

%changelog
openSUSE Build Service is sponsored by