File sabayon.spec of Package sabayon

#
# spec file for package sabayon (Version 2.22.1)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           sabayon
Version:        2.22.1
Release:        1
Summary:        Tool to maintain user profiles in a GNOME desktop
Group:          System/GUI/GNOME
License:        GPL v2 or later
Url:            http://www.gnome.org/projects/sabayon/
Source:         http://ftp.gnome.org/pub/GNOME/sources/sabayon/2.19/sabayon-%{version}.tar.bz2
BuildRequires:  desktop-file-utils
BuildRequires:  fdupes
BuildRequires:  gettext
BuildRequires:  gnome-common
BuildRequires:  gtk2-devel
BuildRequires:  intltool
BuildRequires:  python-cairo
BuildRequires:  python-devel
BuildRequires:  python-gnome
BuildRequires:  python-gtk-devel
BuildRequires:  python-ldap
BuildRequires:  shadow-utils
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11
BuildRequires:  xorg-x11-Xnest
BuildRequires:  xorg-x11-devel
%define gtk2_version 2.10.0
%define pygtk2_version 2.10.0
%define gnome_python2_version 2.18.0
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       libxml2-python
Requires:       python-gtk >= %{pygtk2_version}
Requires:       python-ldap
Requires:       python-gnome >= %{gnome_python2_version}
Requires:       python-cairo
Requires:       %{name}-lang = %{version}
PreReq:         shadow-utils gconf2 grep
PreReq:         gtk2 >= %{gtk2_version}
Patch1:         sabayon-desktop-file-name.diff
Patch2:         sabayon-desktop-file-categories.diff
%py_requires

%description
Sabayon is a tool to help system administrators and users change and
maintain the default behaviour of the GNOME desktop.



Authors:
--------
    Daniel Veillard <veillard@redhat.com>
    John Dennis <jdennis@redhat.com>
    Mark McLoughlin <markmc@redhat.com>

%package admin
License:        GPL v2 or later
Summary:        Graphical tools for Sabayon profile management
Group:          System/GUI/GNOME
Requires:       %{name} = %{version}-%{release}
Requires:       xorg-x11-Xnest
Requires:       shadow-utils

%description admin
The sabayon-admin package contains the graphical tools which a sysadmin
should use to manage Sabayon profiles.



Authors:
--------
    Daniel Veillard <veillard@redhat.com>
    John Dennis <jdennis@redhat.com>
    Mark McLoughlin <markmc@redhat.com>

%lang_package
%prep
%setup -q
%patch1 -p1
%patch2 -p1
chmod -x doc/*

%build
autoreconf -f -i
intltoolize --force
%configure\
	--libexecdir=%{_prefix}/lib/%{name}\
	--enable-consolehelper=yes\
	--with-prototype-user=%{name}-admin\
	--with-distro=suse
make %{?_smp_mflags}

%install
%makeinstall PAM_PREFIX=$RPM_BUILD_ROOT%{_sysconfdir}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/gconf/2
rm $RPM_BUILD_ROOT%{py_sitedir}/%{name}/xlib.*a
echo DocPath=sabayon >> $RPM_BUILD_ROOT/usr/share/applications/sabayon.desktop
%suse_update_desktop_file -G "Desktop Profile Administration" %{name} SystemSetup
%find_lang %{name}
%fdupes $RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT

%pre admin
/usr/sbin/groupadd -r %{name}-admin &>/dev/null || :
/usr/sbin/useradd  -r -s /sbin/nologin -c "Sabayon user" -g %{name}-admin -d /var/lib/%{name}-admin %{name}-admin &>/dev/null || :

%post
# Support for not customized gconf2 package (i. e. unpatched upstream):
# Remove old sabayon local settings, if it has structured comments.
if test -f %{_sysconfdir}/gconf/2/local-defaults.path ; then
  if grep -q '^# BEGIN sabayon$' %{_sysconfdir}/gconf/2/local-defaults.path ; then
    sed -i '/^# BEGIN sabayon$/,/# END sabayon/d' %{_sysconfdir}/gconf/2/local-defaults.path
    if ! test -s %{_sysconfdir}/gconf/2/local-defaults.path ; then
      rm %{_sysconfdir}/gconf/2/local-defaults.path
    fi
  fi
fi
if test -f %{_sysconfdir}/gconf/2/local-mandatory.path ; then
  if grep -q '^# BEGIN sabayon$' %{_sysconfdir}/gconf/2/local-mandatory.path ; then
    sed -i '/^# BEGIN sabayon$/,/# END sabayon/d' %{_sysconfdir}/gconf/2/local-mandatory.path
    if ! test -s %{_sysconfdir}/gconf/2/local-mandatory.path ; then
      rm %{_sysconfdir}/gconf/2/local-mandatory.path
    fi
  fi
fi
# Include new sabayon local settings, only if gconf2 does not support it.
if ! fgrep -q 'include "$(HOME)/.gconf.path.defaults"' %{_sysconfdir}/gconf/2/path ; then
  echo -e '# BEGIN sabayon\ninclude "$(HOME)/.gconf.path.defaults"\n# END sabayon' >>%{_sysconfdir}/gconf/2/local-defaults.path
fi
if ! fgrep -q 'include "$(HOME)/.gconf.path.mandatory"' %{_sysconfdir}/gconf/2/path ; then
  echo -e '# BEGIN sabayon\ninclude "$(HOME)/.gconf.path.mandatory"\n# END sabayon' >>%{_sysconfdir}/gconf/2/local-mandatory.path
fi

%postun
# Support for not customized gconf2 package (<= SuSE Linux 10.1, <= SLED10):
# Remove old sabayon local settings on remove.
if test $1 = 0 ; then
  if test -f %{_sysconfdir}/gconf/2/local-defaults.path ; then
    if grep -q '^# BEGIN sabayon$' %{_sysconfdir}/gconf/2/local-defaults.path ; then
      sed -i '/^# BEGIN sabayon$/,/# END sabayon/d' %{_sysconfdir}/gconf/2/local-defaults.path
      if ! test -s %{_sysconfdir}/gconf/2/local-defaults.path ; then
        rm %{_sysconfdir}/gconf/2/local-defaults.path
      fi
    fi
  fi
  if test -f %{_sysconfdir}/gconf/2/local-mandatory.path ; then
    if grep -q '^# BEGIN sabayon$' %{_sysconfdir}/gconf/2/local-mandatory.path ; then
      sed -i '/^# BEGIN sabayon$/,/# END sabayon/d' %{_sysconfdir}/gconf/2/local-mandatory.path
      if ! test -s %{_sysconfdir}/gconf/2/local-mandatory.path ; then
        rm %{_sysconfdir}/gconf/2/local-mandatory.path
      fi
    fi
  fi
fi

%files
%defattr(-, root, root, 755)
%doc AUTHORS ChangeLog NEWS README TODO ISSUES
%config(noreplace) /etc/X11/xinit/xinitrc.d/%{name}*
%{_sbindir}/%{name}-apply
%{_sysconfdir}/desktop-profiles
%dir %{py_sitedir}/%{name}
%{py_sitedir}/%{name}/__init__.py*
%{py_sitedir}/%{name}/config.py*
%{py_sitedir}/%{name}/cache.py*
%{py_sitedir}/%{name}/debuglog.py*
%{py_sitedir}/%{name}/dirmonitor.py*
%{py_sitedir}/%{name}/errors.py*
%{py_sitedir}/%{name}/mozilla_bookmarks.py*
%{py_sitedir}/%{name}/storage.py*
%{py_sitedir}/%{name}/userdb.py*
%{py_sitedir}/%{name}/userprofile.py*
%{py_sitedir}/%{name}/util.py*
%dir %{py_sitedir}/%{name}/sources/
%{py_sitedir}/%{name}/sources/*.py*

%files lang -f %{name}.lang

%files admin
%defattr(-, root, root, 755)
%doc doc/index.html doc/testing.html doc/helping.html doc/developing.html
%doc doc/sabayon.css doc/*.jpg doc/*.gif
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
%{_datadir}/icons/hicolor/22x22/apps/%{name}.png
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/%{name}
%{_prefix}/lib/%{name}
%{py_sitedir}/%{name}/xlib.so
%{py_sitedir}/%{name}/aboutdialog.py*
%{py_sitedir}/%{name}/changeswindow.py*
%{py_sitedir}/%{name}/editorwindow.py*
%{py_sitedir}/%{name}/fileviewer.py*
%{py_sitedir}/%{name}/gconfviewer.py*
%{py_sitedir}/%{name}/profilesdialog.py*
%{py_sitedir}/%{name}/protosession.py*
%{py_sitedir}/%{name}/saveconfirm.py*
%{py_sitedir}/%{name}/sessionwidget.py*
%{py_sitedir}/%{name}/sessionwindow.py*
%{py_sitedir}/%{name}/usermod.py*
%{py_sitedir}/%{name}/usersdialog.py*
%{py_sitedir}/%{name}/lockdownappliersabayon.py*
%{py_sitedir}/%{name}/lockdown

%changelog
* Tue Sep 23 2008 maw@suse.de
- Update to version 2.22.1:
  + Improve login performance when sabayon is running
  + Updated translations.
* Mon May 19 2008 federico@novell.com
- Added sabayon-bnc384840-speedup-sabayon-apply.diff to fix
  https://bugzilla.novell.com/show_bug.cgi?id=384840 - Avoid running
  sabayon-apply during login if /etc/desktop-profiles/users.xml is not
  present.  This way we avoid launching the entire Python stack for
  faster login on machines that don't use Sabayon profiles.
  Patch by Michael Meeks <michael.meeks@novell.com> (bnc#384840)
* Fri Mar 14 2008 maw@suse.de
- Update to version 2.22.0:
  + Bugs fixed: bgo#476761 and bgo#479771
  + Updated translations.
* Thu Mar 06 2008 maw@suse.de
- Don't call autoreconf.
* Tue Feb 19 2008 maw@suse.de
- Update to version 2.21.0:
  + sabayon-apply now returns exit code 3 when a user profile
  cannot be found for the user (bgo#474666)
  + Fix syntax errors that were only caught at runtime :(
  + Fix the mandatory attribute in the metadata file; it wasn't
  case-insensitive as it should be (brc#253996)
  + Create directories recursively in the storage module (bgo#486216)
  + Remove shebang python lines from files that are not meant to
  be executable (bgo#424328)
  + Fix gettext/ngettext for Python 2.4 (bgo#480508)
  + Make Sabayon work on Slackware (bgo#497471)
  + Fix the lists of files/directories to ignore
  + Updated translations
- Remove some spurious executable permissions.
* Wed Sep 19 2007 federico@novell.com
- Updated to sabayon-2.20.1.
- Removed sabayon-301941-ignore-directories.diff, which is already in
  the base tarball.
* Thu Sep 13 2007 federico@novell.com
- Added sabayon-301941-ignore-directories.diff to fix
  https://bugzilla.novell.com/show_bug.cgi?id=301941 - Sabayon was not
  ignoring .fontconfig and .beagle, leading to huge and incorrect user
  profiles.
* Tue Aug 14 2007 federico@novell.com
- Updated to sabayon-2.19.2; this is simply 2.18.x plus all of the
  Novell patches sent upstream.
- Remade sabayon-desktop-file-name.diff and
  sabayon-desktop-file-categories.diff.
- Removed obsolete patches.
* Tue Aug 07 2007 maw@suse.de
- Use %%fdupes
- Split off a -lang subpackage.
* Thu Jun 07 2007 sbrabec@suse.cz
- Removed invalid desktop Category "Application" (#254654).
* Wed May 09 2007 pgajdos@suse.cz
- removed gnome-icon-theme from BuildRequieres [#247450]
* Thu Apr 12 2007 maw@suse.de
- Update to version 2.18.1 which fixes a broken Arabic translation.
* Tue Mar 27 2007 maw@suse.de
- Add sabayon-2.18.0-desktop.patch.
* Fri Mar 16 2007 federico@suse.de
- Updated to sabayon-2.18.0.
- Removed sabayon-2.12.3-use-subprocess.patch and
  sabayon-2.12.3-notice-dir-creation.patch, as they are already in the
  base tarball.
- Removed sabayon-2.12.3-python-site-modules-path.patch, since it was
  useful only when installing outside of /usr.
- Updated sabayon-2.12.3-ooo-support.patch to apply to the new sources.
* Fri Mar 09 2007 sbrabec@suse.cz
- Removed obsolete hicolor icon symlink (#248676).
* Tue Jan 23 2007 sbrabec@suse.cz
- Spec file cleanup.
* Tue Jan 23 2007 aj@suse.de
- Move to /usr.
- Cleanup BuildRequires.
* Sat Oct 14 2006 danw@suse.de
- Remove dead patch
* Tue Sep 26 2006 cthiel@suse.de
- fix build with python 2.5
* Tue Aug 29 2006 jhargadon@suse.de
- update to version 2.12.4
- Add support for Frugalware Linux
- Remove unneeded #! in python files
- distribute schema
- handle new Xsession path in Fedora Core 5
* Wed Aug 16 2006 cthiel@suse.de
- buildrequire python-gtk-devel instead of python-gtk
* Tue Aug 15 2006 ro@suse.de
- added python-gobject2-devel to BuildRequires
* Tue Aug 01 2006 schwab@suse.de
- Remove newline from substituted variable.
* Thu Jun 22 2006 hpj@suse.de
- Fixed use-subprocess patch again. gconftool should really be
  invoked correctly now. Fixes Novell bug #184919 again.
* Sat Jun 17 2006 hpj@suse.de
- Fixed gnome-vfs patch to unescape URI special characters. Fixes
  remainder of Novell bug #177464.
- Added patch to prevent race with gconf on exit. Fixes Novell bug
  [#186008].
- Added patch to ensure that $HOME/.local exists for the temp
  user. Fixes Novell bug #183353.
- Fixed use-subprocess patch so gconftool is invoked correctly.
  Fixes Novell bug #184919.
* Thu May 25 2006 hpj@suse.de
- Added patch to make it pick up directory creation. Fixes Novell
  bug #177464.
* Mon May 22 2006 hpj@suse.de
- Added patch to make it ignore usernames ending in $. Prevents us
  from showing hosts as if they were users on ADS setups. Fixes
  Novell bug #176830.
* Wed May 17 2006 hpj@suse.de
- Added patch to reset Sabayon's GConf key overrides before
  (optinally) applying a profile and logging the user in. Fixes
  Novell bug #173929.
* Mon May 15 2006 sbrabec@suse.cz
- Do not own gconf files reserved for sysadmin (#167282).
* Wed May 03 2006 hpj@suse.de
- Added patch to use gnome-vfs instead of gamin for file change
  monitoring (Novell bug #167621).
* Thu Apr 13 2006 jpr@suse.de
- Regenerate patch with new file (#163735)
* Fri Mar 24 2006 hpj@suse.de
- Add support for OO.o lockdown, patch from mmeeks.
* Mon Mar 20 2006 ro@suse.de
- lib64 buildfix
* Mon Mar 20 2006 ro@suse.de
- removed gamin from BuildReq and Requires (dropped package)
* Fri Mar 17 2006 ro@suse.de
- revert PreReqs back to old syntax (no Requires(post):)
- do _not_ remove user in postun
- use /var/lib/$USERNAME as homedir like for all other system users
* Mon Mar 13 2006 hpj@suse.de
- Initial revision: 2.12.3.
openSUSE Build Service is sponsored by