Comments below.
On Thu, 2008-02-14 at 12:52 +0800, Jeff Cai wrote:
> #
> # spec file for package SFEgnome-power-manager
> #
> # includes module(s): gnome-power-manager
> #
Please replace this with the usual Sun header.
> %include Solaris.inc
> %use gpm = gnome-power-manager.spec
>
> Name: SFEgnome-power-manager
Change the name to SUNWgnome-power-manager
> Summary: GNOME Power Manager
I'm wondering if this could be somewhat more descriptive.
This is basically the same as the package name.
> Version: %{default_pkg_version}
> SUNW_BaseDir: %{_basedir}
> BuildRoot: %{_tmppath}/%{name}-%{version}-build
>
> %include default-depend.inc
> Requires: SUNWgnome-base-libs
> BuildRequires: SUNWgnome-base-libs-devel
> Requires: SUNWgnome-libs
> BuildRequires: SUNWgnome-libs-devel
> Requires: SUNWdbus
> BuildRequires: SUNWdbus-devel
> Requires: SUNWdbus-bindings
> BuildRequires: SUNWdbus-bindings-devel
> Requires: SUNWhal
> Requires: SUNWgnome-panel
> BuildRequires: SUNWgnome-panel-devel
> Requires: SUNWpostrun
>
> %package root
> Summary: %{summary} - / filesystem
> SUNW_BaseDir: /
> %include default-depend.inc
> Requires: SUNWpostrun
the root pkg should depend on SUNWpostrun-root, not SUNWpostrun
> Requires: SUNWgnome-config
>
> %if %build_l10n
> %package l10n
> Summary: %{summary} - l10n files
> SUNW_BaseDir: %{_basedir}
> %include default-depend.inc
> Requires: %{name}
> %endif
>
> %prep
> rm -rf %name-%version
> mkdir %name-%version
> %gpm.prep -d %name-%version
> cd %{_builddir}/%name-%version
>
> %build
> %gpm.build -d %name-%version
>
> %install
> rm -rf $RPM_BUILD_ROOT
> %gpm.install -d %name-%version
> find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'
> find $RPM_BUILD_ROOT -type f -name "*.a" -exec rm -f {} ';'
> # Delete scrollkeeper files, man & doc dir
> rm -rf $RPM_BUILD_ROOT/var
> rm -rf $RPM_BUILD_ROOT%{_datadir}/doc
> rm -rf $RPM_BUILD_ROOT%{_mandir}/
using --disable-scrollkeeper in configure should make this
unnecessary
> # Remove gnome-inhibit
> rm -rf $RPM_BUILD_ROOT%{_bindir}/gnome-inhibit-applet
> rm -rf $RPM_BUILD_ROOT
> %{_datadir}/gnome-power-manager/gpm-inhibit-test.glade
> rm -rf $RPM_BUILD_ROOT
> %{_datadir}/gnome-2.0/ui/GNOME_InhibitApplet.xml
> rm -rf $RPM_BUILD_ROOT
> %{_libdir}/bonobo/servers/GNOME_InhibitApplet.server
Why? (Please add comment)
> # Move scripts from /usr/bin to /usr/lib
> mv $RPM_BUILD_ROOT%{_bindir}/gnome-power-*.sh $RPM_BUILD_ROOT
> %{_libdir}/
>
> %if %build_l10n
> %else
> # REMOVE l10n FILES
> rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
> %endif
>
> %clean
> rm -rf $RPM_BUILD_ROOT
>
> %post
> ( echo 'test -x /usr/bin/gtk-update-icon-cache || exit 0';
> echo 'rm -f %{_datadir}/icons/*/icon-theme.cache';
> echo 'ls -d %{_datadir}/icons/* | xargs
> -l1 /usr/bin/gtk-update-icon-cache'
> ) | $BASEDIR/lib/postrun -b -u -t 5 -c JDS
> ( echo 'test -x /usr/bin/update-desktop-database || exit 0';
> echo '/usr/bin/update-desktop-database'
> ) | $BASEDIR/lib/postrun -b -u -c JDS_wait
> ( echo 'test -x /usr/bin/scrollkeeper-update || exit 0';
> echo '/usr/bin/scrollkeeper-update'
> ) | $BASEDIR/lib/postrun -b -u -c JDS
Please replace the above with %include's.
We have standard scripts in include/ for these.
> %postun
> test -x $BASEDIR/lib/postrun || exit 0
> ( echo 'test -x /usr/bin/update-desktop-database || exit 0';
> echo '/usr/bin/update-desktop-database'
> ) | $BASEDIR/lib/postrun -b -u -c JDS
> ( echo 'test -x /usr/bin/scrollkeeper-update || exit 0';
> echo '/usr/bin/scrollkeeper-update'
> ) | $BASEDIR/lib/postrun -b -u -c JDS
same again.
> %post root
> ( echo 'test -x /usr/bin/gconftool-2 || {';
> echo ' echo "ERROR: gconftool-2 not found"';
> echo ' echo "ERROR: gconftool-2 not found"';
> echo ' exit 0';
> echo '}';
> echo 'umask 0022';
> echo "GCONF_CONFIG_SOURCE=xml:merged:
> %{_sysconfdir}/gconf/gconf.xml.defaults";
> echo 'export GCONF_CONFIG_SOURCE';
> echo "SDIR=%{_sysconfdir}/gconf/schemas";
> echo '/usr/bin/gconftool-2 --makefile-install-rule
> $SDIR/gnome-power-manager.schemas'
> ) | $PKG_INSTALL_ROOT/usr/lib/postrun
Ouch, this is just wrong, please use
%include gconf-install.script
> %preun root
> ( echo 'test -x /usr/bin/gconftool-2 || {';
> echo ' echo "ERROR: gconftool-2 not found"';
> echo ' exit 0';
> echo '}';
> echo 'umask 0022';
> echo "GCONF_CONFIG_SOURCE=xml:merged:
> %{_sysconfdir}/gconf/gconf.xml.defaults";
> echo 'export GCONF_CONFIG_SOURCE';
> echo "SDIR=%{_sysconfdir}/gconf/schemas";
> echo '/usr/bin/gconftool-2 --makefile-uninstall-rule
> $SDIR/gnome-power-manager.schemas'
> ) | $PKG_INSTALL_ROOT/usr/lib/postrun
There should be a %postun script similar to the %post script
that updates the databases after uninstalling the pkg.
> %files
> %defattr (-, root, bin)
> %dir %attr (0755, root, bin) %{_bindir}
> %{_bindir}/*
> %dir %attr (0755, root, bin) %{_libdir}
> %{_libdir}/gnome-power-*.sh
> %{_libdir}/gnome-*-applet
> %dir %attr (0755, root, bin) %{_libdir}/bonobo
> %dir %attr (0755, root, bin) %{_libdir}/bonobo/servers
> %{_libdir}/bonobo/servers/GNOME_BrightnessApplet.server
> %dir %attr (0755, root, sys) %{_datadir}
> %dir %attr (0755, root, other) %{_datadir}/gnome
> %dir %attr (0755, root, bin) %{_datadir}/gnome/autostart
> %{_datadir}/gnome/autostart/gnome-power-manager.desktop
> %dir %attr (0755, root, bin) %{_datadir}/gnome/help
> %dir %attr (0755, root, bin)
> %{_datadir}/gnome/help/gnome-power-manager
> %{_datadir}/gnome/help/gnome-power-manager/*/*
> %dir %attr (0755, root, bin) %{_datadir}/gnome-2.0
> %dir %attr (0755, root, bin) %{_datadir}/gnome-2.0/ui
> %{_datadir}/gnome-2.0/ui/GNOME_BrightnessApplet.xml
> %dir %attr (0755, root, bin) %{_datadir}/gnome-power-manager
> %{_datadir}/gnome-power-manager/*
> %dir %attr (0755, root, bin) %{_datadir}/dbus-1
> %dir %attr (0755, root, bin) %{_datadir}/dbus-1/services
> %{_datadir}/dbus-1/services/gnome-power-manager.service
> %dir %attr (0755, root, bin) %{_datadir}/omf/
> %dir %attr (0755, root, bin) %{_datadir}/omf/gnome-power-manager
> %{_datadir}/omf/gnome-power-manager/*
> %dir %attr (0755, root, other) %{_datadir}/applications
> %{_datadir}/applications/gnome-power-*.desktop
> %dir %attr (0755, root, other) %{_datadir}/icons
> %dir %attr (0755, root, other) %{_datadir}/icons/hicolor/
> %dir %attr (0755, root, other) %{_datadir}/icons/hicolor/scalable/
> %dir %attr (0755, root, other)
> %{_datadir}/icons/hicolor/scalable/apps/
> %{_datadir}/icons/hicolor/scalable/apps/*
> %dir %attr (0755, root, other) %{_datadir}/icons/hicolor/16x16
> %dir %attr (0755, root, other) %{_datadir}/icons/hicolor/16x16/apps/
> %{_datadir}/icons/hicolor/16x16/apps/*
> %dir %attr (0755, root, other) %{_datadir}/icons/hicolor/22x22/
> %dir %attr (0755, root, other) %{_datadir}/icons/hicolor/22x22/apps/
> %{_datadir}/icons/hicolor/22x22/apps/*
> %dir %attr (0755, root, other) %{_datadir}/icons/hicolor/24x24/
> %dir %attr (0755, root, other) %{_datadir}/icons/hicolor/24x24/apps/
> %{_datadir}/icons/hicolor/24x24/apps/*
> %dir %attr (0755, root, other) %{_datadir}/icons/hicolor/48x48/
> %dir %attr (0755, root, other) %{_datadir}/icons/hicolor/48x48/apps/
> %{_datadir}/icons/hicolor/48x48/apps/*
Since the defattr is root,bin there's no need to add all
the %attr (0755, root, bin) modifiers, besides, they make all
file executable which is probably not what you want.
> %files root
> %defattr (0755, root, sys)
Should be -, root, sys or else all files will be 0755.
Laca
> %dir %attr (0755, root, sys) %{_sysconfdir}
> %{_sysconfdir}/gconf/schemas/gnome-power-manager.schemas
>
> %if %build_l10n
> %files l10n
> %defattr (-, root, bin)
> %dir %attr (0755, root, sys) %{_datadir}
> %attr (-, root, other) %{_datadir}/locale
> %endif
>
> %changelog
> * Thu Feb 14 2008 - jeff.cai at sun.com
> Move to gnome spec repository from sourceforge.
> * Wed Dec 26 2007 - simon.zheng at sun.com
> - Let patch gnome-power-manager-08-brightness-install.diff
> do moving applets.
> * Fri Dec 21 2007 - simon.zheng at sun.com
> - Remove redundant CFLAGS and LDFLAGS.
> * Mon Dec 17 2007 - simon.zheng at sun.com
> - Move gnome-brightness-applet into /usr/lib.
> * Thu Dec 12 2007 - simon.zheng at sun.com
> - Disable gnome-inhibit-applet, remove relevant files.
> * Tue Nov 27 2007 - simon.zheng at sun.com
> - Removed man installation dir.
> * Sun Nov 18 2007 - daymobrew at users.sourceforge.net
> - Fix %files.
> * Thu Nov 08 2007 - trisk at acm.jhu.edu
> - Ensure doc dir is not installed
> * Wed Nov 7 2007 - simon.zheng at sun.com
> - Fix %post icon-cache.
> * Thu Oct 25 2007 - simon.zheng at sun.com
> - Delete installation files under /usr/share/docs.
> * Wed Oct 17 2007 - laca at sun.com
> - add /usr/gnu to search paths
> * Wed Sep 19 2007 - trisk at acm.jhu.edu
> - Fix %post/%preun typos
> * Thu Aug 30 2007 - trisk at acm.jhu.edu
> - Add missing doc dir
> * Thu Mar 29 2007 - daymobrew at users.sourceforge.net
> - Include l10n files.
> * Tue Mar 27 2007 - simon.zheng at sun.com
> - Create
>
>
>
>
>
>
>
> plain text
> document
> attachment
> (gnome-power-manager.spec)
>
> #
> # spec file for package gnome-power-manager
> #
> #
> Name: gnome-power-manager
> License: GPL
> Group: X11/Applications
> Version: 2.21.1
> Release: 2
> Distribution: Java Desktop System
> Vendor: Sun Microsystems, Inc.
> Summary: GNOME Power Manager
> Source0:
> http://ftp.gnome.org/pub/gnome/sources/gnome-power-manager/2.21/%{name}-%{version}.tar.bz2
> Patch1: gnome-power-manager-01-build.diff
> # set gconf key "cpufreq_show" as "true" by default and define
> # gconf key "icon_policy" as "always" by default.
> Patch6: gnome-power-manager-06-icon_plicy_and_cpufreq_show.diff
> Patch7: gnome-power-manager-07-disable-sleep-configration.diff
> Patch8: gnome-power-manager-08-brightness-applet-install.diff
> Patch9: gnome-power-manager-09-scripts.diff
> Patch10:
> gnome-power-manager-10-diable-suspend-button-configration.diff
> Patch11: gnome-power-manager-11-authorization-checking.diff
> Patch12: gnome-power-manager-12-crash.diff
> Patch13: gnome-power-manager-13-beep.diff
> Patch14: gnome-power-manager-14-lid-shutdown.diff
> Patch15: gnome-power-manager-15-disable-lid-beeping.diff
> Patch16: gnome-power-manager-16-brightness-reduction.diff
> Patch17: gnome-power-manager-17-interactive-cmd.diff
> URL: http://www.gnome.org/projects/gnome-power-manager/
> BuildRequires: autoconf >= 2.52
> BuildRequires: automake
> BuildRequires: dbus-glib-devel >= 0.73
> BuildRequires: docbook-dtd41-sgml
> BuildRequires: docbook-utils
> BuildRequires: gnome-common >= 2.12.0
> BuildRequires: gnome-doc-utils
> BuildRequires: gnome-keyring-devel >= 0.8
> BuildRequires: gnome-panel-devel >= 2.18.0
> BuildRequires: gtk+2-devel >= 1:2.10.10
> BuildRequires: hal-devel >= 0.5.7.1
> BuildRequires: intltool >= 0.35.5
> BuildRequires: libglade2-devel >= 2.6.0
> BuildRequires: libgnomeui-devel >= 2.18.0
> BuildRequires: libnotify-devel >= 0.4.3
> BuildRequires: libtool
> BuildRequires: libwnck-devel >= 2.18.0
> BuildRequires: pkgconfig
> BuildRequires: rpmbuild(macros) >= 1.311
> BuildRequires: scrollkeeper
> Requires: GConf2
> Requires: gtk+2
> Requires: hicolor-icon-theme
> Requires: scrollkeeper
> Requires: gnome-session >= 2.18.0
> Requires: notification-daemon >= 0.3.5
> Obsoletes: gnome-power
> BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
>
> %description
> Uses of GNOME Power Manager infrastructure
> - A dialogue that warns the user when on UPS power, that automatically
> begins a kind shutdown when the power gets critically low.
> - An icon that allows a user to dim the LCD screen with a slider, and
> does do automatically when going from mains to battery power on a
> laptop.
> - An icon, that when an additional battery is inserted, updates it's
> display to show two batteries and recalculates how much time
> remaining. Would work for wireless mouse and keyboards, UPS's and
> PDA's.
> - A daemon that does a clean shutdown when the battery is critically
> low or does a soft-suspend when you close the lid on your laptop (or
> press the "suspend" button on your PC).
> - Tell Totem to use a codec that does low quality processing to
> conserve battery power.
> - Postpone indexing of databases (e.g. up2date) or other heavy
> operations until on mains power.
> - Presentation programs / movie players don't want the screensaver
> starting or screen blanking.
>
> %prep
> %setup -q
> %patch1 -p1
> %patch6 -p0
> %patch7 -p0
> %patch8 -p0
> %patch9 -p0
> %patch10 -p0
> %patch11 -p0
> %patch12 -p0
> %patch13 -p0
> %patch14 -p0
> %patch15 -p0
> %patch16 -p0
> %patch17 -p0
>
> %build
> %ifos linux
> if [ -x /usr/bin/getconf ]; then
> CPUS=`getconf _NPROCESSORS_ONLN`
> fi
> %else
> CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
> %endif
> if test "x$CPUS" = "x" -o $CPUS = 0; then
> CPUS=1
> fi
>
> intltoolize --copy --force --automake
> autoheader
> autoconf
> ./configure --prefix=%{_prefix} \
> --enable-policykit \
> --libexecdir=%{_libexecdir} \
> --sysconfdir=%{_sysconfdir} \
> --mandir=%{_mandir} \
> --datadir=%{_datadir} \
> --infodir=%{_datadir}/info
>
> make -j$CPUS
>
> %install
> rm -rf $RPM_BUILD_ROOT
> make install DESTDIR=$RPM_BUILD_ROOT \
>
> %clean
> rm -rf $RPM_BUILD_ROOT
>
> %post
> %gconf_schema_install gnome-power-manager.schemas
> %preun
> %gconf_schema_uninstall gnome-power-manager.schemas
>
> %postun
> %scrollkeeper_update_postun
>
> %files
> %defattr(-,root,root)
> %{_libdir}/bonobo/servers/GNOME_BrightnessApplet.server
> %{_libdir}/bonobo/servers/GNOME_InhibitApplet.server
> %{_datadir}/gnome/autostart/gnome-power-manager.desktop
> %{_datadir}/dbus-1/services/gnome-power-manager.service
> %{_datadir}/gnome-2.0/ui/GNOME_BrightnessApplet.xml
> %{_datadir}/gnome-2.0/ui/GNOME_InhibitApplet.xml
> %{_mandir}/man1/*.1*
> %{_datadir}/gnome-power-manager/*
> %{_sysconfdir}/gconf/schemas/gnome-power-manager.schemas
>
>
> %changelog
> * Thu Feb 14 2008 - jeff.cai at sun.com
> - Move to gnome spec repository from sourceforge
> * Mon Jau 28 2008 - simon.zheng at sun.com
> - Add patch gnome-power-manager-17-interactive-cmd.diff to
> set gnome-sys-suspend as power button interactive policy.
>
> * Fri Jau 25 2008 - simon.zheng at sun.com
> - Enable configure option --enable-polkit.
>
> * Mon Jau 21 2008 - simon.zheng at sun.com
> - Add gnome-power-manager-16-brightness-reduction.diff to fix
> bugzilla bug #510068.
> - Rework gnome-power-manager-11-authrization-checking.diff to
> add cpufreq policy auth checking.
>
> * Mon Jau 14 2008 - simon.zheng at sun.com
> - Add gnome-power-manager-14-lid-shutdown.diff.
> - Add gnome-power-manager-15-inhibit-lid-beeping.diff to diable
> beeping when lid id closed or opened.
>
> * Mon Jau 07 2008 - simon.zheng at sun.com
> - Add gnome-power-manager-13-beep.diff to bugzilla bug #507789.
>
> * Thu Dec 20 2007 - simon.zheng at sun.com
> - Rework gnome-power-manager-07-disable-sleep-configration.diff.
> - Add gnome-power-manager-11-authorization-checking.diff
> - Add gnome-power-manager-12-crash.diff
>
> * Wed Dec 19 2007 - simon.zheng at sun.com
> - Add gnome-power-manager-10-diable-suspend-button-configration.diff.
>
> * Tue Dec 18 2007 - simon.zheng at sun.com
> - Rework gnome-power-manager-07-disable-sleep-configration.diff.
> - Rework gnome-power-manager-08-brightness-applet-install.diff.
> - Add gnome-power-manager-09-scripts.diff.
>
> * Mon Dec 17 2007 - simon.zheng at sun.com
> - Bump to 2.21.1.
> - Rework gnome-power-manager-01-build.diff.
> - Remove gnome-power-manager-02-kstat.diff.
> - Remove upstream patch
> gnome-power-manager-03-brightness-get-stuck.diff.
> - Remove gnome-power-manager-04-display-sleep.diff.
> - Remove gnome-power-manager-05-configure-power-conf.diff
> - Add gnome-power-manager-07-disable-sleep-configration.diff.
> - Add gnome-power-manager-08-brightness-applet-install.diff.
>
> * Thu Dec 12 2007 - simon.zheng at sun.com
> - Add patch gnome-power-manager-06-icon_plicy_and_cpufreq_show.diff,
> set gconf key "cpufreq_show" as true by default and define
> gconf key "icon_policy" as always by default.
>
> * Fri Dec 07 2007 - simon.zheng at sun.com
> - Update patch gnome-power-manager-05-configure-power-conf.diff.
>
> * Thu Dec 06 2007 - simon.zheng at sun.com
> - Add patch gnome-power-manager-05-configure-power-conf.diff
> to make autoS3, autoshutdwon, disk powermanagement, autopm
> work on Solaris.
>
> * Wed Nov 28 2007 - simon.zheng at sun.com
> - Add patch gnome-power-manager-04-display-sleep.diff, to
> make display sleeping work.
>
> * Fri Nov 17 2007 - simon.zheng at sun.com
> - Bump to version 2.20.1
> - Add patch gnome-power-manager-03-brightness-get-stuck.diff.
> to fix bugzilla bug #497298,
>
> * Wed Sep 19 2007 - trisk at acm.jhu.edu
> - Add intltoolize to fix build
>
> * Wed Sep 19 2007 - simon.zheng at sun.com
> - Bump to version 2.20.0
>
> * Tue Aug 28 2007 - jeff.cai at sun.com
> - Bump to version 2.19.6.
>
> * Tue May 15 2007 - simon.zheng at sun.com
> - Bump to version 2.19.2.
>
> * Mon May 14 2007 - simon.zheng at sun.com
> - Add a patch gnome-power-manager-02-kstat.diff to
> port cpu usage statistic to solaris.
>
> * Tue May 08 2007 - simon.zheng at sun.com
> - Bump to version 2.19.1
>
> * Fri Apr 27 2007 - simon.zheng at sun.com
> - Bump to version 2.18.2
>
> * Tue Mar 28 2007 - simon.zheng at sun.com
> - initial version for pkgbuild
>