File gammastep.spec of Package gammastep

Name:		gammastep
URL:		https://github.com/jonls/gammastep/
Version:	2.0.11
Release:	2%{?dist}
Summary:	Adjust the color balance of your screen
License:	GPL-3.0-or-later
Group:		System/Management

Obsoletes:	redshift < %{version}

Source0:	https://gitlab.com/chinstrap/%{name}/-/archive/v%{version}/%{name}-v%{version}.tar.bz2

BuildRequires:	apparmor-abstractions
Buildrequires:	autoconf
BuildRequires:	automake
BuildRequires:	gcc
BuildRequires:	geoclue2-devel
BuildRequires:	glib2-devel
BuildRequires:	hicolor-icon-theme
BuildRequires:	intltool
BuildRequires:	libapparmor-devel
BuildRequires:	libdrm-devel
BuildRequires:	libtool
BuildRequires:	libX11-devel
BuildRequires:	libxcb-devel
BuildRequires:	libXxf86vm-devel
BuildRequires:	libXrandr-devel
BuildRequires:	systemd
BuildRequires:	systemd-devel
BuildRequires:	wayland-devel
BuildRequires:	xcb
BuildRequires:	xrandr

%if 0%{?suse_version} >= 1600
BuildRequires:	hicolor-icon-theme-devel
BuildRequires:	pkgconf-pkg-config
BuildRequires:	python313
BuildRequires:	python313-gobject-devel
BuildRequires:	python313-pyxdg
Requires:	hicolor-icon-theme
Requires:	python313
Requires:	python313-gobject
Requires:	python313-pyxdg
%endif

%if 0%{?suse_version} == 1560
Buildrequires:	python311
%endif

Requires:	%{name}-common = %{version}-%{release}
Requires:	xcb
Requires:	xrandr

%package common
Summary:	Common files for all installations of gammastep
BuildArch:	noarch
Requires:	hicolor-icon-theme

%package systemd
Summary:	Service files to have systemd start gammastep automatically
Requires:	gammastep = %{version}-%{release}
Requires:	systemd
BuildArch:	noarch

%package apparmor
Summary:	Apparmor policy for %{name}
Requires:	reshift = %{version}-%{name}
Requires:	apparmor-abstractions
BuildArch:	noarch

%package doc
Summary:	Documentation for %{name}
Requires:	%{name} = %{version}-%{release}
BuildArch:	noarch

%package indicator
Summary:	GTK applet for %{name}
Requires:	%{name} = %{version}-%{release}
Obsoletes:	redshift-gtk < %{version}
Provides:	%{name}-gtk

%lang_package

%description
gammastep adjusts the color temperature of your screen. It can do so based on
sunrise/sunset in your location, or based on times specified in your
configuration file.

%description common
Common files for all intallations of gammastep

%description systemd
Service files to have systemd start gammastep automatically

%description apparmor
Apparmor policy for gammastep

%description doc
Documentation for gammastep

%description indicator
%{name}-indicator provides a system tray icon that can be used to control
color temperature.

%prep
%setup -q -n %{name}-v%{version}
./bootstrap

%build
%configure \
	--enable-dependency-tracking \
	--enable-shared \
	--enable-static \
	--enable-geoclue2 \
	--enable-apparmor \
	--enable-drm \
	--enable-randr \
	--enable-gui \
	--enable-wayland
%__make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
%make_install

%find_lang %{name}

%check
make check

%files
%defattr(-, root, root, -)
%{_bindir}/%{name}

%files common
%defattr(-, root, root, -)
%dir %{_prefix}/lib/python3.13/site-packages/gammastep_indicator/
%{_prefix}/lib/python3.13/site-packages/gammastep_indicator/*.py
%dir %{_prefix}/lib/python3.13/site-packages/gammastep_indicator/__pycache__/
%{_prefix}/lib/python3.13/site-packages/gammastep_indicator/__pycache__/*.pyc
%{_datadir}/applications/
%{_datadir}/icons/hicolor/scalable/apps/*
%{_datadir}/metainfo/*

%files systemd
%defattr(-, root, root, -)
%{_prefix}/lib/systemd/user/*

%files apparmor
%defattr(-, root, root, -)
%{_sysconfdir}/apparmor.d/*

%files doc
%defattr(-, root, root, -)
%{_mandir}/*/*

%files indicator
%defattr(-, root, root, -)
%{_bindir}/%{name}-indicator

%files lang -f %{name}.lang

%changelog
* Mon Dec 22 2025 Kristopher Gamrat <gamrat.kristopher@protonmail.com> 2.0.11-2
- Separate indicator app for people who may not want it

* Sun Dec 21 2025 Kristopher Gamrat <gamrat.kristopher@protonmail.com> 2.0.11-1
- Initial package
openSUSE Build Service is sponsored by