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

Summary:     Window and compositing manager based on Clutter
Name:        mutter
Version:     %{pkg_version}
Release:     %{pkg_release}
Source0:     %{name}-%{version}.tar.bz2
License:     GPLv2+
Group:       User Interface/Desktops
URL:         http://git.gnome.org/browse/mutter

Requires(post,postun): scrollkeeper >= 0.1.4
Requires(post,pre,preun): GConf2 >= 2.14
BuildRequires: pkgconfig
BuildRequires: gtk2-devel
BuildRequires: clutter-devel
BuildRequires: libSM-devel
BuildRequires: GConf2-devel
BuildRequires: gir-repository-devel
BuildRequires: python-devel
BuildRequires: startup-notification-devel
BuildRequires: libcanberra-devel
BuildRequires: gnome-doc-utils
BuildRequires: desktop-file-utils
BuildRoot: %{_tmppath}/%{name}-%{version}-root

Vendor: Project Vine
Distribution: Vine Linux
Packager: Takemikaduchi


%description
Mutter is a minimal X window manager aimed at nontechnical users and is designed to integrate well with the GNOME desktop. Mutter lacks some features that may be expected by traditional UNIX or other technical users; these users may want to investigate other available window managers for use with GNOME or standalone.


%package devel
Summary:     Development files of the mutter library.
Group:       Development/Libraries

Requires: %{name} = %{version}-%{release}
Requires: pkgconfig
Requires: gtk-doc
Requires: clutter-devel

%description devel
Development files of the mutter library.


%prep
%setup -q


%build
%configure --disable-static
%{__make} %{?_smp_mflags} 


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

%find_lang %{name}

%{__rm} -rf $RPM_BUILD_ROOT%{_libdir}/*.la


%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/mutter.schemas \
  > /dev/null || :
/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

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


%files -f %{name}.lang
%defattr(-,root,root)
%doc COPYING ChangeLog NEWS README
%{_bindir}/mutter
%{_bindir}/mutter-message
%{_libdir}/lib*.so.*
%{_libdir}/mutter/*
%{_datadir}/applications/*
%{_datadir}/gnome/wm-properties/*
%{_datadir}/mutter/*
%{_sysconfdir}/gconf/schemas/*
%{_mandir}/man1/mutter.1.gz
%{_mandir}/man1/mutter-message.1.gz

%files devel
%defattr(-,root,root,-)
%{_bindir}/mutter-theme-viewer
%{_bindir}/mutter-window-demo
%{_includedir}/mutter/*
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*
%{_mandir}/man1/mutter-theme-viewer.1.gz
%{_mandir}/man1/mutter-window-demo.1.gz

%changelog
* Thu Apr 29 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.29.1-1
- new upstream release
- add BuildRequires: libcanberra-devel
- Requires: clutter-devel (devel package)

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

