Laca,

Updated SUNWgnome-power-manager.spec as attaechment. Also answered your 
question in line.

Laszlo (Laca) Peter wrote:
> 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.
>   
Sure.
>   
>> %include Solaris.inc
>> %use gpm = gnome-power-manager.spec
>>
>> Name:                    SFEgnome-power-manager
>>     
>
> Change the name to SUNWgnome-power-manager
>   
Sure.
>   
>> Summary:                 GNOME Power Manager
>>     
>
> I'm wondering if this could be somewhat more descriptive.
> This is basically the same as the package name.
>   
Change to "GNOME Power Manager utilities for desktop users"

>   
>> 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
>   
Sure.
>   
>> 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
>   
Sorry, it's a mistake here. In fact it's unnecessary to remove any 
scrollkeeper and docs files.
Remove "rm -rf $RPM_BUILD_ROOT/var" and "rm -rf 
$RPM_BUILD_ROOT%{_datadir}/doc".
>   
>> # 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.
>   

Sure. Remove  those redundant statements.
>   
>> %files root
>> %defattr (0755, root, sys)
>>     
>
> Should be -, root, sys or else all files will be 0755.
>   
Sure.

Thanks,
-Simon

> Laca
>
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: SUNWgnome-power-manager.spec
Type: text/x-rpm-spec
Size: 7067 bytes
Desc: not available
URL: 
<http://mail.opensolaris.org/pipermail/jds-review/attachments/20080215/5a709108/attachment.bin>

Reply via email to