SFExfce4-power-manager.spec: initial spec with patch from Guido Berhoerster
authorjurikm
Mon, 25 Apr 2011 08:06:00 +0000
changeset 3430 0f8554f505cf
parent 3429 077522c66e55
child 3431 d21b8cc43f38
SFExfce4-power-manager.spec: initial spec with patch from Guido Berhoerster
ChangeLog
SFExfce4-power-manager.spec
patches/xfce4-power-manager-01-solaris-diff
--- a/ChangeLog	Mon Apr 25 07:37:56 2011 +0000
+++ b/ChangeLog	Mon Apr 25 08:06:00 2011 +0000
@@ -1,6 +1,8 @@
 2011-04-25 Ken Mays <[email protected]>
 
 	* SFElibxfcegui4.spec: Bump to 4.8.1
+	* SFExfce4-power-manager.spec: initial spec with patch
+	  from Guido Berhoerster
 
 2011-04-24 Milan Jurik <[email protected]>
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SFExfce4-power-manager.spec	Mon Apr 25 08:06:00 2011 +0000
@@ -0,0 +1,145 @@
+#
+# Copyright 2007 Sun Microsystems, Inc.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+
+%include Solaris.inc
+
+%define src_name xfce4-power-manager
+%define src_url http://archive.xfce.org/src/xfce/xfce4-power-manager/1.0/
+
+Name:		SFExfce4-power-manager
+Summary:	Xfce Power management utilities
+Version:	1.0.10
+URL:		http://www.xfce.org/
+Source:		%{src_url}/%{src_name}-%{version}.tar.bz2
+Patch1:		xfce4-power-manager-01-solaris-diff
+Group:		User Interface/Desktops
+SUNW_BaseDir:	%{_basedir}
+BuildRoot:	%{_tmppath}/%{name}-%{version}-build
+%include default-depend.inc
+BuildRequires:	SUNWgnome-base-libs-devel
+Requires:	SUNWgnome-base-libs
+BuildRequires:  SUNWdbus
+BuildRequires:	SFExfce4-panel-devel
+Requires:	SFExfce4-panel
+BuildRequires:	SFElibxfce4ui
+BuildRequires:  SFElibxfce4util
+Requires:	SFExfce4-panel
+BuildRequires:  SFExfconf
+Requires:	%{name}-root
+
+%description
+xfce4-power-manager is a tool for the Xfce desktop environment for managing profiles of policies which affect power consumption, such as the display brightness level, display sleep times, or CPU frequency scaling. It can also trigger actions on certain events such as closing the lid or reaching low battery levels and provides a set of interfaces to inform other applications about current power level so that they can adjust their power consumption. Furthermore, it provides the a standardized inhibit interface which allows applications to prevent automatic sleep actions via the power manager. 
+
+%package root
+Summary:	%{summary} - / filesystem
+SUNW_BaseDir:	/
+%include default-depend.inc
+
+%if %build_l10n
+%package l10n
+Summary:	%{summary} - l10n files
+SUNW_BaseDir:	%{_basedir}
+%include default-depend.inc
+Requires:	%{name}
+%endif
+
+%prep
+%setup -q -n %{src_name}-%{version}
+%patch1 -p1
+
+%build
+CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
+if test "x$CPUS" = "x" -o $CPUS = 0; then
+  CPUS=1
+fi
+
+# GNU xgettext needed
+export PATH=/usr/gnu/bin:$PATH
+./configure --prefix=%{_prefix}		\
+	--bindir=%{_bindir}		\
+	--libdir=%{_libdir}		\
+	--libexecdir=%{_libexecdir}	\
+	--datadir=%{_datadir}		\
+	--mandir=%{_mandir}		\
+	--sysconfdir=%{_sysconfdir}
+
+make -j $CPUS
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+
+%if %build_l10n
+%else
+# REMOVE l10n FILES
+rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-, root, bin) 
+%doc AUTHORS COPYING ChangeLog NEWS README TODO 
+%{_bindir} 
+%{_libdir}/xfce4/panel-plugins
+%dir %attr (0755, root, sys) %{_datadir}
+%dir %attr (0755, root, other) %{_docdir}
+%{_mandir}
+%{_datadir}/polkit-1 
+%dir %attr (0755, root, other) %{_datadir}/applications
+%{_datadir}/applications/xfce4-power-manager-settings.desktop 
+%dir %attr (0755, root, other) %{_datadir}/icons
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/16x16
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/16x16/actions
+%{_datadir}/icons/hicolor/16x16/actions/*
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/16x16/status
+%{_datadir}/icons/hicolor/16x16/status/*
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/22x22
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/22x22/actions
+%{_datadir}/icons/hicolor/22x22/actions/*
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/22x22/status
+%{_datadir}/icons/hicolor/22x22/status/*
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/24x24
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/24x24/actions
+%{_datadir}/icons/hicolor/24x24/actions/*
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/24x24/status
+%{_datadir}/icons/hicolor/24x24/status/*
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/48x48
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/48x48/actions
+%{_datadir}/icons/hicolor/48x48/actions/*
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/48x48/status
+%{_datadir}/icons/hicolor/48x48/status/*
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/128x128
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/128x128/devices
+%{_datadir}/icons/hicolor/128x128/devices/*
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/scalable
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/scalable/actions
+%{_datadir}/icons/hicolor/scalable/actions/* 
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/scalable/status
+%{_datadir}/icons/hicolor/scalable/status/* 
+%doc %{_datadir}/xfce4/doc 
+%{_datadir}/xfce4/panel-plugins
+%{_sbindir}
+
+%files root
+%defattr(-, root, sys)
+%dir %attr (0755, root, sys) %{_sysconfdir}
+%dir %attr (0755, root, sys) %{_sysconfdir}/xdg
+%dir %attr (0755, root, sys) %{_sysconfdir}/xdg/autostart
+%config %{_sysconfdir}/xdg/autostart/xfce4-power-manager.desktop
+
+%if %build_l10n
+%files l10n
+%defattr (-, root, bin)
+%dir %attr (0755, root, sys) %{_datadir}
+%attr (-, root, other) %{_datadir}/locale
+%endif
+
+%changelog
+* Thu Apr 21 2011 - Ken Mays <[email protected]
+- Initial spec for 1.0.10
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/xfce4-power-manager-01-solaris-diff	Mon Apr 25 08:06:00 2011 +0000
@@ -0,0 +1,75 @@
+--- a/src/xfpm-polkit.c
++++ b/src/xfpm-polkit.c
+@@ -32,12 +32,15 @@
+ 
+ #include <sys/types.h>
+ 
+-#if defined(__FreeBSD__)
+-#include <sys/stat.h>
+-#else
++#if defined(__linux)
+ #include <sys/param.h>
+ #include <sys/sysctl.h>
+ #include <sys/user.h>
++#elif defined(__FreeBSD__)
++#include <sys/stat.h>
++#elif defined(__SVR4) || defined(__sun)
++#include <fcntl.h>
++#include <procfs.h>
+ #endif
+ 
+ #include <errno.h>
+@@ -115,7 +118,7 @@ static guint64
+ get_start_time_for_pid (pid_t pid)
+ {
+     guint64 start_time;
+-#if !defined(__FreeBSD__)
++#if defined(__linux)
+     gchar *filename;
+     gchar *contents;
+     size_t length;
+@@ -172,7 +175,7 @@ get_start_time_for_pid (pid_t pid)
+     g_free (filename);
+     g_free (contents);
+     
+-#else /*if !defined(__FreeBSD__)*/
++#elif defined(__FreeBSD__)
+ 
+     struct kinfo_proc p;
+     
+@@ -189,6 +192,33 @@ get_start_time_for_pid (pid_t pid)
+     start_time = (guint64) p.ki_start.tv_sec;
+     
+ out:
++#elif defined(__SVR4) || defined(__sun)
++
++    psinfo_t p;
++    gchar *filename;
++    int fd;
++
++    start_time = 0;
++
++    filename = g_strdup_printf ("/proc/%d/psinfo", (int) pid);
++    if ((fd = open(filename, O_RDONLY)) < 0)
++    {
++	g_warning ("Error opening %s (%s)",
++		   filename,
++		   g_strerror (errno));
++	goto out;
++    }
++    if (read(fd, &p, sizeof (p)) != sizeof (p))
++    {
++	g_warning ("Error reading %s",
++		   filename);
++	close(fd);
++	goto out;
++    }
++    start_time = (guint64) p.pr_start.tv_sec;
++    close(fd);
++out:
++    g_free (filename);
+ #endif
+     
+     return start_time;
+--
+cgit v0.8.3.4