Skip to content

Instantly share code, notes, and snippets.

@jcrd
Created February 4, 2023 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcrd/45070e2b19d18d09255083683127fd95 to your computer and use it in GitHub Desktop.
Save jcrd/45070e2b19d18d09255083683127fd95 to your computer and use it in GitHub Desktop.
clight rpkg spec template for blog post
Name: {{{ git_cwd_name name="clight" }}}
Version: {{{ git_cwd_version lead="$(git tag | sed -n 's/^v//p' | sort --version-sort -r | head -n1)" }}}
Release: 1%{?dist}
Summary: A C daemon that turns your webcam into a light sensor. It will adjust screen backlight based on ambient brightness.
License: GPL-3.0
URL: https://github.com/FedeDP/clight
VCS: {{{ git_cwd_vcs }}}
Source0: {{{ git_cwd_pack }}}
BuildRequires: cmake
BuildRequires: g++
BuildRequires: systemd-devel
BuildRequires: popt-devel
BuildRequires: libconfig-devel
BuildRequires: gsl-devel
BuildRequires: dbus-devel
BuildRequires: libmodule
Requires: systemd
Requires: popt
Requires: gsl
Requires: libconfig
Requires: libmodule
Requires: clightd
%global debug_package %{nil}
%description
A linux bus interface that lets you change screen brightness, compute captured webcam frames brightness and change screen temperature.
%prep
{{{ git_cwd_setup_macro }}}
%build
mkdir -p build
cd build
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=%{_lib} -DCMAKE_BUILD_TYPE="Release" ..
make
%install
cd build
%make_install
%files
%license COPYING
%doc README.md
%{_sysconfdir}/default/clight.conf
%{_bindir}/clight
%{_prefix}/etc/xdg/autostart/clight.desktop
%{_includedir}/clight/public.h
%{_datadir}/applications/clightc.desktop
%{_datadir}/bash-completion/completions/clight
%{_datadir}/clight
%{_datadir}/dbus-1/services/org.clight.clight.service
%{_datadir}/icons/hicolor/scalable/apps/clight.svg
%{_mandir}/man1/clight.1.gz
%{_datadir}/zsh/site-functions/_clight
%changelog
{{{ git_cwd_changelog }}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment