Summary: Adjusts the color temperature of your screen according to time of day
Name: redshift
-Version: 1.7
-Release: 1
+Version: 1.12
+Release: 6
License: GPL v3+
Group: Applications/System
-Source0: http://launchpad.net/redshift/trunk/%{version}/+download/%{name}-%{version}.tar.bz2
-# Source0-md5: c56512afa292b5a94b715ed4a1841d4c
-# Remove Ubuntu specific geoclue provider
-Patch0: %{name}-geoclue-provider.patch
-# https://bugs.launchpad.net/redshift/+bug/888661
-# http://bazaar.launchpad.net/~jonls/redshift/trunk/revision/165
-Patch1: %{name}-geoclue-client-check.patch
+Source0: https://github.com/jonls/redshift/releases/download/v%{version}/%{name}-%{version}.tar.xz
+# Source0-md5: 5d04f2413dacdf3434cb86f373842462
URL: http://jonls.dk/redshift/
-BuildRequires: GConf2-devel
+BuildRequires: autoconf >= 2.69
+BuildRequires: automake
BuildRequires: desktop-file-utils
-BuildRequires: geoclue-devel
-BuildRequires: gettext-devel
-BuildRequires: python
+BuildRequires: gettext-tools >= 0.17
+BuildRequires: glib2-devel >= 1:2.26
+BuildRequires: intltool >= 0.50
+BuildRequires: libdrm-devel
+BuildRequires: libtool
+BuildRequires: libxcb-devel
+BuildRequires: pkgconfig
+BuildRequires: python3 >= 3.2
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.219
-BuildRequires: xorg-lib-libXrandr-devel
+BuildRequires: rpmbuild(macros) >= 2.011
+BuildRequires: sed >= 4.0
+BuildRequires: xorg-lib-libX11-devel
BuildRequires: xorg-lib-libXxf86vm-devel
+Requires(post,preun): systemd-units >= 1:250.1
+Requires: systemd-units >= 1:250.1
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
This package provides the base program.
-%package -n gtk-%{name}
+%package gtk
Summary: GTK integration for Redshift
Group: Applications/System
Requires: %{name} = %{version}-%{release}
-Requires: python-pygtk-gtk
-Requires: python-pyxdg
+Requires: gtk+3
+Requires: python3 >= 3.2
+Requires: python3-pyxdg
+Obsoletes: gtk-redshift
-%description -n gtk-%{name}
+%description gtk
This package provides GTK integration for Redshift, a screen color
temperature adjustment program.
%prep
%setup -q
-%patch0 -p1
-%patch1 -p0
+
+%{__sed} -i -e '1s,^#!.*python3,#!%{__python3},' src/redshift-gtk/redshift-gtk.in
%build
+%{__gettextize}
+%{__intltoolize}
+%{__aclocal} -I m4
+%{__autoheader}
+%{__automake}
+%{__autoconf}
%configure \
- --disable-silent-rules
+ am_cv_python_pythondir=%{py3_sitescriptdir} \
+ --disable-silent-rules \
+ --enable-drm \
+ --enable-geoclue \
+ --enable-geoclue2 \
+ --enable-gui \
+ --enable-randr \
+ --enable-vidmode \
+ --with-systemduserunitdir=%{systemduserunitdir}
%{__make}
%install
%py_postclean
%find_lang %{name}
-desktop-file-validate $RPM_BUILD_ROOT%{_desktopdir}/gtk-redshift.desktop
+desktop-file-validate $RPM_BUILD_ROOT%{_desktopdir}/redshift-gtk.desktop
%clean
rm -rf $RPM_BUILD_ROOT
-%post -n gtk-%{name}
+%post gtk
%update_icon_cache hicolor
+%systemd_user_post redshift-gtk.service
+
+%preun gtk
+%systemd_user_preun redshift-gtk.service
-%postun -n gtk-%{name}
+%postun gtk
%update_icon_cache hicolor
%files -f %{name}.lang
%defattr(644,root,root,755)
-%doc AUTHORS ChangeLog NEWS README
+%doc CONTRIBUTING.md DESIGN NEWS README README-colorramp redshift.conf.sample
%attr(755,root,root) %{_bindir}/redshift
%{_mandir}/man1/redshift.1*
-%files -n gtk-%{name}
+%files gtk
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/gtk-redshift
-%{py_sitescriptdir}/gtk_redshift
+%attr(755,root,root) %{_bindir}/redshift-gtk
+%{_datadir}/appdata/redshift-gtk.appdata.xml
+%{py3_sitescriptdir}/redshift_gtk
%{_iconsdir}/hicolor/scalable/apps/redshift*.svg
-%{_desktopdir}/gtk-redshift.desktop
+%{_desktopdir}/redshift.desktop
+%{_desktopdir}/redshift-gtk.desktop
+%{systemduserunitdir}/redshift.service
+%{systemduserunitdir}/redshift-gtk.service