File cameractrls.spec of Package cameractrls
#
# Copyright (c) 2025 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: cameractrls
Version: 0.6.7
Release: 0
Summary: Camera controls for Linux
License: LGPL-3.0-or-later
Group: Hardware/Camera
URL: https://github.com/soyersoyer/cameractrls
Source: %{name}-%{version}.tar.gz
BuildArch: noarch
# Main dependencies
BuildRequires: python3
BuildRequires: python3-gobject
BuildRequires: python-rpm-macros
BuildRequires: desktop-file-utils
BuildRequires: hicolor-icon-theme
# Runtime Python dependencies
Requires: python3-gobject
# Introspection bindings for the GTK4
Requires: typelib-1_0-Gtk-4_0
# Shared libs loaded via ctypes
Requires: libSDL2-2_0-0
Requires: libspnav0
Requires: libturbojpeg0
Requires: libasound2
# For desktop integration
Requires: hicolor-icon-theme
%description
It's a standalone Python CLI and GUI (GTK3, GTK4) and
camera Viewer (SDL) to set the camera controls in Linux.
It can set the V4L2 controls and it is extendable with
the non standard controls. Currently it has a Logitech
extension (LED mode, LED frequency, BRIO FoV, Relative
Pan/Tilt, PTZ presets), Kiyo Pro extension (HDR, HDR
mode, FoV, AF mode, Save), Preset extension (Save and
restore controls), Control Restore Daemon (to restore
presets at device connection).
%prep
%autosetup -n cameractrls-%{version}
desktop-file-edit --set-key=Exec --set-value=cameractrlsgtk4 pkg/hu.irl.cameractrls.desktop
%build
%install
install -d %{buildroot}%{python3_sitelib}/cameractrls
install -d %{buildroot}%{python3_sitelib}/cameractrls/images
install -m 0644 pkg/hu.irl.cameractrls.svg %{buildroot}%{python3_sitelib}/cameractrls/images/
# Install all relevant app scripts: ensure proper shebang and executable bit
for f in cameractrls.py cameractrlsd.py cameractrlsgtk4.py cameractrlsgtk.py cameraptzgame.py cameraptzmidi.py cameraptzspnav.py cameraview.py; do
sed '1s|^#!.*|#!/usr/bin/python3|' $f > %{buildroot}%{python3_sitelib}/cameractrls/$f
chmod 0755 %{buildroot}%{python3_sitelib}/cameractrls/$f
done
# Desktop and icon
install -Dm 0644 pkg/hu.irl.cameractrls.desktop %{buildroot}%{_datadir}/applications/hu.irl.cameractrls.desktop
install -Dm 0644 pkg/hu.irl.cameractrls.metainfo.xml %{buildroot}%{_datadir}/metainfo/hu.irl.cameractrls.metainfo.xml
install -Dm 0644 pkg/hu.irl.cameractrls.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/hu.irl.cameractrls.svg
# Symlink entry points into /usr/bin (without .py extension for "main" tools)
install -d %{buildroot}%{_bindir}
ln -s %{python3_sitelib}/cameractrls/cameractrlsgtk4.py %{buildroot}%{_bindir}/cameractrlsgtk4
ln -s %{python3_sitelib}/cameractrls/cameractrlsd.py %{buildroot}%{_bindir}/cameractrlsd
ln -s %{python3_sitelib}/cameractrls/cameractrls.py %{buildroot}%{_bindir}/cameractrls
%files
%license LICENSE
%doc README.md
%{python3_sitelib}/cameractrls/
%{_bindir}/cameractrls
%{_bindir}/cameractrlsd
%{_bindir}/cameractrlsgtk4
%{_datadir}/applications/hu.irl.cameractrls.desktop
%{_datadir}/icons/hicolor/scalable/apps/hu.irl.cameractrls.svg
%{_datadir}/metainfo/hu.irl.cameractrls.metainfo.xml
%changelog