]> git.pld-linux.org Git - packages/redshift.git/commitdiff
new, version 1.7
authorElan Ruusamäe <glen@delfi.ee>
Tue, 14 May 2013 18:15:32 +0000 (21:15 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Tue, 14 May 2013 18:15:32 +0000 (21:15 +0300)
based on fedora package
4b490e5cdd5ba705e7fb70627b549dfc8f9a10a9

redshift-geoclue-client-check.patch [new file with mode: 0644]
redshift-geoclue-provider.patch [new file with mode: 0644]
redshift.spec [new file with mode: 0644]

diff --git a/redshift-geoclue-client-check.patch b/redshift-geoclue-client-check.patch
new file mode 100644 (file)
index 0000000..663b566
--- /dev/null
@@ -0,0 +1,55 @@
+=== modified file 'src/location-geoclue.c'
+--- src/location-geoclue.c     2011-03-27 22:14:58 +0000
++++ src/location-geoclue.c     2011-07-12 20:30:30 +0000
+@@ -50,14 +50,20 @@
+ int
+ location_geoclue_start(location_geoclue_state_t *state)
+ {
+-      GeoclueMaster *master = NULL;
+-      GeoclueMasterClient *client = NULL;
+-      GError *error = NULL;
+-      gchar *name = NULL;
++        if (state->provider && state->provider_path) {
++              state->position = geoclue_position_new(state->provider,
++                                                     state->provider_path);
++        } else {
++                GeoclueMaster *master = geoclue_master_get_default();
++                GeoclueMasterClient *client = geoclue_master_create_client(master,
++                                                                           NULL, NULL);
++                GError *error = NULL;
+-        if (!(state->provider && state->provider_path)) {
+-              master = geoclue_master_get_default();
+-              client = geoclue_master_create_client(master, NULL, NULL);
++                if (client == NULL) {
++                        g_printerr(_("Unable to obtain master client.\n"));
++                        g_object_unref(master);
++                        return -1;
++                }
+               if (!geoclue_master_client_set_requirements(client,
+                                                           GEOCLUE_ACCURACY_LEVEL_REGION,
+@@ -68,15 +74,18 @@
+                                  error->message);
+                       g_error_free(error);
+                       g_object_unref(client);
++                        g_object_unref(master);
+                       return -1;
+               }
+               state->position = geoclue_master_client_create_position(client, NULL);
+-      } else {
+-              state->position = geoclue_position_new(state->provider,
+-                                                     state->provider_path);
+-        }
++
++                g_object_unref(client);
++                g_object_unref(master);
++      }
++
++      gchar *name = NULL;
+       if (geoclue_provider_get_provider_info(GEOCLUE_PROVIDER(state->position),
+                                              &name, NULL, NULL)) {
+
diff --git a/redshift-geoclue-provider.patch b/redshift-geoclue-provider.patch
new file mode 100644 (file)
index 0000000..0de08e3
--- /dev/null
@@ -0,0 +1,14 @@
+diff -ur redshift-1.7/src/location-geoclue.c redshift-1.7_geoclue_provider/src/location-geoclue.c
+--- redshift-1.7/src/location-geoclue.c        2011-03-27 23:13:10.000000000 +0100
++++ redshift-1.7_geoclue_provider/src/location-geoclue.c       2011-07-09 13:41:17.940812241 +0100
+@@ -32,8 +32,8 @@
+ # define _(s) s
+ #endif
+-#define DEFAULT_PROVIDER "org.freedesktop.Geoclue.Providers.UbuntuGeoIP"
+-#define DEFAULT_PROVIDER_PATH "/org/freedesktop/Geoclue/Providers/UbuntuGeoIP"
++#define DEFAULT_PROVIDER "org.freedesktop.Geoclue.Providers.Hostip"
++#define DEFAULT_PROVIDER_PATH "/org/freedesktop/Geoclue/Providers/Hostip"
+ int
+ location_geoclue_init(location_geoclue_state_t *state)
diff --git a/redshift.spec b/redshift.spec
new file mode 100644 (file)
index 0000000..fb6d064
--- /dev/null
@@ -0,0 +1,90 @@
+Summary:       Adjusts the color temperature of your screen according to time of day
+Name:          redshift
+Version:       1.7
+Release:       1
+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
+URL:           http://jonls.dk/redshift/
+BuildRequires: GConf2-devel
+BuildRequires: desktop-file-utils
+BuildRequires: geoclue-devel
+BuildRequires: gettext-devel
+BuildRequires: python
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.219
+BuildRequires: xorg-lib-libXrandr-devel
+BuildRequires: xorg-lib-libXxf86vm-devel
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Redshift adjusts the color temperature of your screen according to
+your surroundings. This may help your eyes hurt less if you are
+working in front of the screen at night.
+
+The color temperature is set according to the position of the sun. A
+different color temperature is set during night and daytime. During
+twilight and early morning, the color temperature transitions smoothly
+from night to daytime temperature to allow your eyes to slowly adapt.
+
+This package provides the base program.
+
+%package -n gtk-%{name}
+Summary:       GTK integration for Redshift
+Group:         Applications/System
+Requires:      %{name} = %{version}-%{release}
+Requires:      python-pygtk-gtk
+Requires:      python-pyxdg
+
+%description -n gtk-%{name}
+This package provides GTK integration for Redshift, a screen color
+temperature adjustment program.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p0
+
+%build
+%configure \
+       --disable-silent-rules
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__make} install \
+       INSTALL="install -p" \
+       DESTDIR=$RPM_BUILD_ROOT
+
+%py_postclean
+
+%find_lang %{name}
+desktop-file-validate $RPM_BUILD_ROOT%{_desktopdir}/gtk-redshift.desktop
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -n gtk-%{name}
+%update_icon_cache hicolor
+
+%postun -n gtk-%{name}
+%update_icon_cache hicolor
+
+%files -f %{name}.lang
+%defattr(644,root,root,755)
+%doc AUTHORS ChangeLog NEWS README
+%attr(755,root,root) %{_bindir}/redshift
+%{_mandir}/man1/redshift.1*
+
+%files -n gtk-%{name}
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/gtk-redshift
+%{py_sitescriptdir}/gtk_redshift
+%{_iconsdir}/hicolor/scalable/apps/redshift*.svg
+%{_desktopdir}/gtk-redshift.desktop
This page took 0.087765 seconds and 4 git commands to generate.