SUNWgnome-power-manager.spec
author an230044
Mon, 27 Sep 2010 11:32:21 +0000
branchopensolaris-2009-06
changeset 20102 2d19c462bb98
parent 13802 06ec649f9274
child 15156 f9396d3b305b
permissions -rw-r--r--
6917569 CVE-2008-5824 libaudiofile contains heap-based buffer overflow in msadpcm.c Committing for Rohini because of svn issues on opensolaris2009.06 branch.

#
# spec file for package SUNWgnome-power-manager
#
# includes module(s): gnome-power-manager
#
# Copyright 2008 Sun Microsystems, Inc.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Owner: SimonZheng
#
%include Solaris.inc
%use gpm = gnome-power-manager.spec
%define with_xmlto %(test -x /usr/bin/xmlto && echo 1 || echo 0)

Name:                    SUNWgnome-power-manager
Summary:                 GNOME Power Manager utilities for desktop users
Version:                 %{gpm.version}
Source:                  %{name}-manpages-0.1.tar.gz
SUNW_BaseDir:            %{_basedir}
SUNW_Copyright:          %{name}.copyright
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:                SUNWgnome-media
BuildRequires:           SUNWgnome-media-devel
Requires:                SUNWpostrun
Requires:                SUNWxdg-utils

%package root
Summary:                 %{summary} - / filesystem
SUNW_BaseDir:            /
%include default-depend.inc
Requires: SUNWpostrun-root
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
gzcat %SOURCE0 | tar xf -

%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 {} ';'

# Replace debian format man pages with solaris-specical man pages.
rm -rf $RPM_BUILD_ROOT%{_mandir}/
cd %{_builddir}/%name-%version/sun-manpages
make install DESTDIR=$RPM_BUILD_ROOT

# Disable gnome-inhibit applet. Because it's unable to inhibit all suspend 
# actions, e.g. some suspend actions are done by powerd daemon on Solaris.
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

# Move scripts from /usr/bin to /usr/lib/gnome-power-manager as part of libexec directory.
mkdir $RPM_BUILD_ROOT%{_libdir}/gnome-power-manager
mv $RPM_BUILD_ROOT%{_bindir}/gnome-power-*.sh $RPM_BUILD_ROOT%{_libdir}/gnome-power-manager

%if %build_l10n
%else
# REMOVE l10n FILES
rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
rm -r $RPM_BUILD_ROOT%{_datadir}/gnome/help/gnome-power-manager/[a-z][a-z]
rm $RPM_BUILD_ROOT%{_datadir}/omf/gnome-power-manager/gnome-power-manager-[a-z][a-z].omf
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%post
%include icon-cache.script
%include desktop-database-install.script
%include scrollkeeper-update.script

%postun
test -x $BASEDIR/lib/postrun || exit 0
%include desktop-database-uninstall.script
%include scrollkeeper-update.script

%post root
%include gconf-install.script

%preun root
test -x $BASEDIR/var/lib/postrun/postrun || exit 0
( echo 'test -x $PKG_INSTALL_ROOT/usr/bin/gconftool-2 || {';
  echo '  echo "WARNING: gconftool-2 not found; not uninstalling gconf schemas"';
  echo '  exit 0';
  echo '}';
  echo 'umask 0022';
  echo 'GCONF_CONFIG_SOURCE=xml:merged:$BASEDIR/etc/gconf/gconf.xml.defaults';
  echo 'GCONF_BACKEND_DIR=$PKG_INSTALL_ROOT/usr/lib/GConf/2';
  echo 'LD_LIBRARY_PATH=$PKG_INSTALL_ROOT/usr/lib';
  echo 'export GCONF_CONFIG_SOURCE GCONF_BACKEND_DIR LD_LIBRARY_PATH';
  echo 'SDIR=$BASEDIR%{_sysconfdir}/gconf/schemas';
  echo 'schemas="$SDIR/gnome-power-manager.schemas"';
  echo '$PKG_INSTALL_ROOT/usr/bin/gconftool-2 --makefile-uninstall-rule $schemas > /dev/null'
) | $BASEDIR/var/lib/postrun/postrun -i -c JDS_wait -a


%files
%doc -d gnome-power-manager-%{gpm.version} README AUTHORS
%doc(bzip2) -d gnome-power-manager-%{gpm.version} COPYING NEWS ChangeLog po/ChangeLog help/ChangeLog
%dir %attr (0755, root, other) %{_datadir}/doc
%defattr (-, root, bin)
%{_bindir}/*
%{_libdir}/gnome-*-applet
%{_libdir}/gnome-power-manager/gnome-power-*.sh
%{_libdir}/bonobo/servers/GNOME_BrightnessApplet.server
%dir %attr (0755, root, sys) %{_datadir}
%dir %attr (0755, root, other) %{_datadir}/gnome
%{_datadir}/gnome/autostart/gnome-power-manager.desktop
%{_datadir}/gnome/help/gnome-power-manager/C/*
%{_datadir}/gnome-2.0/ui/GNOME_BrightnessApplet.xml
%{_datadir}/gnome-power-manager/*
%if %with_xmlto
%{_datadir}/doc/gnome-power-manager-*/*
%endif
%{_datadir}/dbus-1/services/gnome-power-manager.service
%{_datadir}/omf/gnome-power-manager/*-C.omf
%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/*
%{_mandir}/*/*

%files root
%defattr (-, root, sys)
%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
%dir %attr (0755, root, other) %{_datadir}/gnome
%{_datadir}/gnome/help/gnome-power-manager/[a-z]*/*
%{_datadir}/omf/gnome-power-manager/*-[a-z][a-z].omf
%endif

%changelog
* Thu Mar 27 2008 - [email protected]
- Add copyright.
* Wed Mar 05 2008 - [email protected]
- Remove help file when build_l10n option is false.
* Tue Mar 04 2008 - [email protected]
- Modify %files l10n entry to add l10n helps.
* Mon Mar 03 2008 - [email protected]
- Add an option to build doc if xmlto is installed.
* Sun Mar 02 2008 - [email protected]
- Correct package version number.
* Wed Feb 27 2008 - [email protected]
- Add SUNWgnome-media/-devel to dependency list 
  as gpm requires gstreamer.
* Fri Feb 15 2008 - [email protected]
- Delete redundant statement.
* Thu Feb 14 2008 - [email protected]
- Add manpage.
- Use install script.
- Correct the package name.
* Thu Feb 14 2008 - [email protected]
- Move to gnome spec repository from sourceforge.
* Wed Dec 26 2007 - [email protected]
- Let patch gnome-power-manager-08-brightness-install.diff 
  do moving applets.
* Fri Dec 21 2007 - [email protected]
- Remove redundant CFLAGS and LDFLAGS.
* Mon Dec 17 2007 - [email protected]
- Move gnome-brightness-applet into /usr/lib.
* Thu Dec 12 2007 - [email protected]
- Disable gnome-inhibit-applet, remove relevant files.
* Tue Nov 27 2007 - [email protected]
- Removed man installation dir.
* Sun Nov 18 2007 - [email protected]
- Fix %files.
* Thu Nov 08 2007 - [email protected]
- Ensure doc dir is not installed
* Wed Nov 7 2007 - [email protected]
- Fix %post icon-cache.
* Thu Oct 25 2007 - [email protected]
- Delete installation files under /usr/share/docs.
* Wed Oct 17 2007 - [email protected]
- add /usr/gnu to search paths
* Wed Sep 19 2007 - [email protected]
- Fix %post/%preun typos
* Thu Aug 30 2007 - [email protected]
- Add missing doc dir
* Thu Mar 29 2007 - [email protected]
- Include l10n files.
* Tue Mar 27 2007 - [email protected]
- Create