%define pkg_version 3.2.2.1
%define pkg_release 1%{?_dist_release}

Summary:     Window management and application launching for GNOME
Name:        gnome-shell
Version:     %{pkg_version}
Release:     %{pkg_release}
Source0:     %{name}-%{version}.tar.xz

Patch0:      gnome-shell-3.2.1-shell_parse_argv.patch

# settings for Vine
Patch101:    gnome-shell-vine-settings.patch
Patch102:    gnome-shell-vine-customize.patch
Patch103:    gnome-shell-ja.po-date.patch

License:     GPLv2+
Group:       User Interface/Desktops
URL:         http://live.gnome.org/GnomeShell

Requires(post,postun): scrollkeeper >= 0.1.4
Requires(post,pre,preun): GConf2 >= 2.14
Requires: mutter
Requires: caribou
Requires: openssl

BuildRequires: gnome-common
BuildRequires: libtool
BuildRequires: automake
BuildRequires: autoconf

BuildRequires: pkgconfig
BuildRequires: gtk2-devel
BuildRequires: clutter-devel
BuildRequires: mutter-devel
BuildRequires: gjs-devel
BuildRequires: gnome-desktop3-devel
BuildRequires: gnome-menus-devel
BuildRequires: libSM-devel
BuildRequires: libffi-devel
BuildRequires: GConf2-devel
BuildRequires: startup-notification-devel
BuildRequires: gnome-doc-utils
BuildRequires: desktop-file-utils
BuildRequires: libcroco-devel
BuildRequires: librsvg2-devel
BuildRequires: gobject-introspection-devel
BuildRequires: gstreamer-devel
BuildRequires: dbus-glib-devel
BuildRequires: telepathy-logger-devel
BuildRequires: polkit-devel
BuildRequires: pulseaudio-libs-devel
BuildRequires: evolution-data-server-devel
BuildRequires: folks-devel
BuildRequires: NetworkManager-glib-devel
BuildRequires: libgudev1-devel
BuildRequires: openssl
BuildRequires: intltool

BuildRoot: %{_tmppath}/%{name}-%{version}-root

Vendor: Project Vine
Distribution: Vine Linux
Packager: Takemikaduchi


%description
GNOME Shell is the defining technology of the GNOME 3 desktop user experience.
It provides core interface functions like switching to windows and launching
applications. GNOME Shell takes advantage of the capabilities of modern graphics
hardware and introduces innovative user interface concepts to provide a delightful
and easy to use experience. 


%prep
%setup -q
%patch0 -p1 -b .spawn
%patch101 -p1 -b .vine
#%patch102 -p1 -b .vine
%patch103 -p1 -b .old_po2

%build
libtoolize --copy --force
autoreconf
%configure \
	--disable-static \
	--with-ca-certificates=%{_datadir}/ssl/certs/ca-bundle.crt

%{__make} %{?_smp_mflags} 


%install
%{__rm} -rf ${RPM_BUILD_ROOT}
%{__make} install DESTDIR=${RPM_BUILD_ROOT}

find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'

%find_lang %{name}



%clean
%{__rm} -rf ${RPM_BUILD_ROOT}


%post 
/sbin/ldconfig
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule \
    %{_sysconfdir}/gconf/schemas/gnome-shell.schemas \
    > /dev/null || :
touch --no-create %{_datadir}/icons/hicolor
if [ -x /usr/bin/gtk-update-icon-cache ]; then
  gtk-update-icon-cache -q %{_datadir}/icons/hicolor
fi

%pre
if [ "$1" -gt 1 ]; then
  export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
  gconftool-2 --makefile-uninstall-rule \
    %{_sysconfdir}/gconf/schemas/gnome-shell.schemas \
    > /dev/null || :
fi

%preun
if [ "$1" -eq 0 ]; then
  export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
  gconftool-2 --makefile-uninstall-rule \
    %{_sysconfdir}/gconf/schemas/gnome-shell.schemas \
    > /dev/null || :
fi

%postun
scrollkeeper-update -q || :
/sbin/ldconfig
touch --no-create %{_datadir}/icons/hicolor
if [ -x /usr/bin/gtk-update-icon-cache ]; then
  gtk-update-icon-cache -q %{_datadir}/icons/hicolor
fi
glib-compile-schemas %{_datadir}/glib-2.0/schemas ||:

%posttrans
glib-compile-schemas %{_datadir}/glib-2.0/schemas ||:


%files -f %{name}.lang
%defattr(-,root,root)
%doc COPYING NEWS README
%{_sysconfdir}/gconf/schemas/gnome-shell.schemas
%{_bindir}/gnome-shell
%{_bindir}/gnome-shell-extension-tool
%{_libdir}/gnome-shell/*
%{_libdir}/mozilla/plugins/libgnome-shell-browser-plugin.so
%{_libexecdir}/gnome-shell-calendar-server
%{_libexecdir}/gnome-shell-hotplug-sniffer
%{_libexecdir}/gnome-shell-perf-helper
%{_datadir}/applications/gnome-shell.desktop
%{_datadir}/dbus-1/services/org.gnome.Shell.CalendarServer.service
%{_datadir}/dbus-1/services/org.gnome.Shell.HotplugSniffer.service
%{_datadir}/glib-2.0/schemas/org.gnome.shell.gschema.xml
%{_datadir}/gnome-shell/*
%{_datadir}/man/man1/*.1.gz


%changelog
* Sat Jan 21 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.2.2.1-1
- new upstream release
- remove Patch1

* Sun Nov 27 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.2.1-2
- add Patch0 (gnome-shell-3.2.1-shell_parse_argv.patch)
- add Patch1 (gnome-shell-3.2.1-ja.po.patch)
- rename Patch103 (gnome-shell-ja.po-date.patch)
- drop Patch102

* Sat Oct 22 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.2.1-1
- new upstream release

* Fri Sep 30 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.2.0-1
- new upstream release

* Fri Sep 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.1.92-1
- new upstream release
- update Patch101
- update Patch102
- update Patch103 (gnome-shell-3.1.91.1-ja.po.patch)
- add BuildRequires: libgudev1-devel, openssl

* Sat Sep 03 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.1.90.1-1
- new upstream release
- add BuildRequires: folks-devel, NetworkManager-glib-devel
- add Requires: caribou
- remove Patch0
- update Patch101
- update Patch102
- update Patch103 (gnome-shell-3.1.90.1-ja.po.patch)

* Mon Aug 22 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.1.4-2
- rebuild with gnome-menus-3.1.5
- add Patch0 (gnome-shell-git20110821.patch)

* Sun Aug 14 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.1.4-1
- new upstream release
- add BuildRequires: telepathy-logger-devel, polkit-devel, pulseaudio-libs-devel, evolution-data-server-devel
- change BuildRequires: gnome-desktop3-devel instead of gnome-desktop-devel
- remove BuildRequires: xulrunner-devel
- add Patch101 (gnome-shell-vine-settings.patch)
- add Patch102 (gnome-shell-vine-customize.patch)
- add Patch103 (gnome-shell-3.1.4-ja.po.patch)

* Sun May 02 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.29.1-2
- add Requires: mutter

* Sun May 02 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.29.1-1
- new upstream release

* Sun Feb 28 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.28.0-1
- initial build for Vine Linux

