Name:           gnome-compiz-manager
Version:        0.10.4
Release: 1%{?_dist_release}
Summary:        Compiz configuration utility
Summary(ja):    Compiz 設定ユーティリティ

Group:          User Interface/Desktops
License:        GPL
URL:            http://gandalfn.wordpress.com/gnome-compiz-manager/
Source0:        http://download.gna.org/gcm/gnome-compiz-manager/gnome-compiz-manager-%{version}.tar.gz
Source1:	desktop.png
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

BuildRequires:  intltool
BuildRequires:  GConf2 
BuildRequires:  pkgconfig
BuildRequires:  libglade2-devel
BuildRequires:  libwnck-devel
BuildRequires:  libgnomeui-devel
BuildRequires:  libgnome-devel
BuildRequires:  gnome-desktop-devel
BuildRequires:  librsvg2-devel
BuildRequires:  gob2
BuildRequires:  gettext
BuildRequires:  desktop-file-utils
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
Requires(pre): GConf2
Requires(post): GConf2
Requires(preun): GConf2


%description
Gnome compiz manager is small utility, which manages GL Desktop configurations
on XGL/AiGLX. It is composed of two applications :

- compiz-tray-icon : which launches and stops compiz
- gnome-compiz-preferences : which adjusts GL effects

The goal is not to expose all compiz options but allow a simple
configuration of compiz.

%package devel
Summary:  Development files for gnome-compiz-manager
Summary(ja):  gnome-compiz-manager の開発ファイル
Group:    Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig
%description devel
Development files for gnome-compiz-manager

%prep
%setup -q

cp %{SOURCE1} data

%build
%configure --disable-rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
make install DESTDIR=$RPM_BUILD_ROOT
desktop-file-install --vendor="fedora"                          \
        --delete-original                                       \
        --dir=${RPM_BUILD_ROOT}%{_datadir}/applications         \
        $RPM_BUILD_ROOT%{_datadir}/applications/gnome-compiz-preferences.desktop
rm $RPM_BUILD_ROOT/%{_libdir}/*.la
rm $RPM_BUILD_ROOT/%{_libdir}/%{name}/*.la
# kill static libs
rm $RPM_BUILD_ROOT/%{_libdir}/%{name}/*.a
rm $RPM_BUILD_ROOT/%{_libdir}/*.a
# empty
rm $RPM_BUILD_ROOT/%{_docdir}/%{name}/README

%find_lang %{name}

%clean
rm -rf $RPM_BUILD_ROOT

%pre
if [ "$1" -gt 1 ]; then
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-uninstall-rule \
  %{_sysconfdir}/gconf/schemas/gnome-compiz-preferences.schemas >/dev/null || :
# If the schema file has ever been renamed::
#gconftool-2 --makefile-uninstall-rule \
#  %{_sysconfdir}/gconf/schemas/[OLDNAME].schemas > /dev/null || :
killall -HUP gconfd-2 &> /dev/null || :
fi

%post 
/sbin/ldconfig
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule \
  %{_sysconfdir}/gconf/schemas/gnome-compiz-preferences.schemas > /dev/null || :
  killall -HUP gconfd-2 &> /dev/null || :
  
%preun
if [ "$1" -eq 0 ]; then
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-uninstall-rule \
%{_sysconfdir}/gconf/schemas/gnome-compiz-preferences.schemas > /dev/null || :
killall -HUP gconfd-2 &> /dev/null || :
fi

%postun -p /sbin/ldconfig

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc %{_docdir}/*
%{_bindir}/*
%{_mandir}/*/*
%{_sysconfdir}/gconf/schemas/*
%{_libdir}/*.so.*
%dir %{_libdir}/%{name}/
%{_libdir}/%{name}/*.so
%{_libdir}/%{name}/*.plugin
%{_datadir}/%{name}
%{_datadir}/applications/*

%files devel
%defattr(-,root,root,-)
%{_includedir}/%{name}/
%{_libdir}/*.so
%{_libdir}/pkgconfig/*

%changelog
* Sat May 10 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 0.10.4-1
- initial build for Vine Linux

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.10.4-4
- Autorebuild for GCC 4.3

* Sun Dec  9 2007 Denis Leroy <denis@poolshark.org> - 0.10.4-3
- Fix duplicate desktop entries
- Made gconf killall silent

* Fri Oct 12 2007 Matthias Clasen <mclasen@redhat.com> - 0.10.4-2
- Don't ship Ubuntu branding

* Sat Jul 14 2007 John Mahowald <jpmahowald@gmail.com> - 0.10.4-1
- 0.10.4

* Wed May 23 2007 John Mahowald <jpmahowald@gmail.com> - 0.9.14-1
- 0.9.14

* Tue Nov 28 2006 John Mahowald <jpmahowald@gmail.com> - 0.9.13.1-1
- 0.9.13.1
- dropped upstreamed libdir patch

* Thu Nov 16 2006 John Mahowald <jpmahowald@gmail.com> - 0.9.10-1
- initial rpm
