Name: 		cinnamon
Summary: 	A Linux Desktop featuring a traditional layout and modern technology
Version: 	1.4
Release: 	1.UP1%{?_dist_release}

Group: 		User Interface/Desktops
License:	GPLv2+
URL: 		http://cinnamon.linuxmint.com/

Source0: 	%{name}-%{version}-UP1.tar.gz

Patch0:		cinnamon-1.4-session.patch
Patch1:		cinnamon-1.4-settings.patch

# vine patch
Patch101:	cinnamon-vine-settings.patch

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

BuildRequires: 	muffin-devel >= 1.0.2
BuildRequires: 	gjs-devel >= 1.29.18
BuildRequires: 	gstreamer-plugins-base-devel >= 0.10.16
BuildRequires: 	folks-devel >= 0.5.2
BuildRequires: 	evolution-data-server-devel >= 2.32.0
BuildRequires: 	telepathy-glib-devel >= 0.15.5
BuildRequires: 	telepathy-logger-devel >= 0.2.4
BuildRequires: 	polkit-devel >= 0.100
BuildRequires: 	startup-notification-devel >= 0.11
BuildRequires: 	gnome-menus-devel
BuildRequires: 	NetworkManager-glib-devel
BuildRequires: 	libgnome-keyring-devel
BuildRequires: 	libcroco-devel >= 0.6.2
BuildRequires: 	gnome-desktop3-devel >= 2.90.0
BuildRequires: 	pulseaudio-libs-devel
BuildRequires: 	libgudev1-devel
BuildRequires: 	gnome-common

Requires(post,pre,preun): GConf2
Requires:	glib2
Requires:	muffin

%description
Cinnamon is a Linux desktop which provides advanced innovative features and a traditional user experience.

The desktop layout is similar to Gnome 2. 
The underlying technology is forked from Gnome Shell.
The emphasis is put on making users feel at home and providing them with an easy to use and comfortable desktop experience.

%prep
%setup -q -n linuxmint-Cinnamon-af1653f
%patch0 -p1
%patch1 -p1 
%patch101 -p1 -b .vine

%build
NOCONFIGURE=1 ./autogen.sh
%configure \
	--disable-static \
	--with-ca-certificates=%{_datadir}/ssl/certs/ca-bundle.crt \
	 --enable-compile-warnings=minimum

make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
make install DESTDIR=$RPM_BUILD_ROOT
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL

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

%find_lang %{name}

%clean
rm -rf $RPM_BUILD_ROOT


%post
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/cinnamon.schemas > /dev/null || :

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

%postun
if [ $1 -eq 0 ]; then
  glib-compile-schemas %{_datadir}/glib-2.0/schemas ||:
fi

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


%files -f %{name}.lang
%defattr(-,root,root)
%doc README NEWS COPYING AUTHORS
%{_sysconfdir}/gconf/schemas/cinnamon.schemas
%{_sysconfdir}/xdg/menus/cinnamon-applications.menu
%{_sysconfdir}/xdg/menus/cinnamon-settings.menu
%{_bindir}/cinnamon
%{_bindir}/cinnamon-extension-tool
%{_bindir}/cinnamon-menu-editor
%{_bindir}/cinnamon-settings
%{_bindir}/gnome-session-cinnamon
%{_prefix}/lib/cinnamon-menu-editor
%{_prefix}/lib/cinnamon-settings
%{_libdir}/%{name}/Cinnamon-0.1.typelib
%{_libdir}/%{name}/Gvc-1.0.typelib
%{_libdir}/%{name}/St-1.0.typelib
%{_libdir}/%{name}/libcinnamon.so
%{_libdir}/mozilla/plugins/libcinnamon-browser-plugin.so
%{_libexecdir}/cinnamon-calendar-server
%{_libexecdir}/cinnamon-hotplug-sniffer
%{_libexecdir}/cinnamon-perf-helper
%{_datadir}/applications/cinnamon-settings.desktop
%{_datadir}/applications/cinnamon.desktop
%{_datadir}/%{name}/applets
%{_datadir}/%{name}/js
%{_datadir}/%{name}/search_providers
%{_datadir}/%{name}/shaders
%{_datadir}/%{name}/theme
%{_datadir}/dbus-1/services/org.Cinnamon.CalendarServer.service
%{_datadir}/dbus-1/services/org.Cinnamon.HotplugSniffer.service
%{_datadir}/desktop-directories
%{_datadir}/glib-2.0/schemas/org.cinnamon.gschema.xml
%{_datadir}/gnome-session/sessions/cinnamon.session
%{_datadir}/xsessions/cinnamon.desktop
%{_mandir}/man1/cinnamon.1.gz

%changelog
* Tue Jun 12 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.4-UP1-1
- initial build for Vine Linux
