%define srcname exo

Summary: extension library to Xfce
Summary(ja): Xfce の拡張ライブラリ
Name: libexo
Version: 0.6.1
Release: 1%{?_dist_release}

Group: System Environment/Libraries
License: LGPLv2
URL: http://www.xfce.org/

Source0: http://archive.xfce.org/src/xfce/exo/0.6/%{srcname}-%{version}.tar.bz2

# FIXME: upstream this patch
Patch0:  exo-0.5.4-x86_64-build.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: glib2-devel >= 2.27.0
BuildRequires: gtk2-devel >= 2.14.0
BuildRequires: libSM-devel
BuildRequires: intltool >= 0.31
BuildRequires: libxfce4util-devel >= 4.8.0
BuildRequires: libnotify-devel >= 0.4.0
BuildRequires: python-devel
BuildRequires: pygtk2-devel
BuildRequires: perl-URI
BuildRequires: chrpath
Requires(post): gtk2
Requires(postun): gtk2

Provides: %{srcname} = %{version}-%{release}

Vendor: Project Vine
Distribution: Vine Linux

%description
libexo is the extension library to Xfce developed by os-cillation.
While Xfce ships with quite a few libraries that are primarly targeted
at desktop development, libexo is targeted at application development,
with a focus on applications for Xfce.

%description -l ja
libexo は os-cillation により開発された Xfce の拡張ライブラリです．
Xfce はデスクトップ環境の開発を第一の目的としたごくわずかのライブラリ
と共に作成されていますが，libexo はアプリケーションの開発，それも
Xfce 用のアプリケーション開発に焦点を定めています．

%package -n %{name}-devel
Summary: Header files and libraries for developing apps which will use %{name}
Summary(ja): libexo の開発用ヘッダファイル及びライブラリ
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: gtk2-devel >= 2.6.0
Requires: libxfce4util-devel >= 4.2.2
Provides: %{srcname}-devel = %{version}-%{release}

%description -n %{name}-devel
The libexo-devel package contains the header files and libraries needed
to develop programs that use the libexo library.

%description -n %{name}-devel -l ja
libexo-develはlibexoライブラリを用いるプログラムの開発に
必要なヘッダファイル及びライブラリを含むパッケージです。

%prep
%setup -q -n %{srcname}-%{version}
%patch0 -p1 -b .x86_64-build

%build
%configure --disable-static
%__make

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p'

rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.la
rm -f $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/icon-theme.cache

chrpath --delete $RPM_BUILD_ROOT%{_bindir}/exo-desktop-item-edit
chrpath --delete $RPM_BUILD_ROOT%{_bindir}/exo-open
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/xfce4/exo-*/exo-helper-*
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/exo-*/_exo.so
#chrpath --delete $RPM_BUILD_ROOT%{_libdir}/gio/modules/libexo-module-*.so

rm -rf _docs_to_include
mkdir -p _docs_to_include
mv $RPM_BUILD_ROOT%{_docdir}/exo/html _docs_to_include/
rm -rf $RPM_BUILD_ROOT%{_docdir}/exo

%find_lang exo-1

%clean
rm -rf $RPM_BUILD_ROOT

%post 
/sbin/ldconfig
touch --no-create %{_datadir}/icons/hicolor

%postun 
/sbin/ldconfig
if [ $1 -eq 0 ]; then
    touch --no-create %{_datadir}/icons/hicolor
    /usr/bin/gtk-update-icon-cache -qf %{_datadir}/icons/hicolor;
fi

%posttrans
gtk-update-icon-cache %{_iconsdir}/icons/hicolor &> /dev/null || :


%files -f exo-1.lang
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog README THANKS TODO
%doc _docs_to_include/*
%config(noreplace) %{_sysconfdir}/xdg/xfce4/helpers.rc
%{_bindir}/*
%{_libdir}/lib*.so.*
%{_libdir}/python?.?/site-packages/*
%{_libdir}/xfce4/*
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/*/apps/*.png
%{_datadir}/pixmaps/exo-1
%{_datadir}/pygtk/2.0/*
%{_datadir}/xfce4/helpers
%{_mandir}/man1/*

%files -n %{name}-devel
%defattr(-,root,root)
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/exo-1
%{_datadir}/gtk-doc/html/exo-1

%changelog
* Mon May 23 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.6.1-1
- new upstrem release

* Sun Apr 03 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.6.0-2
- add BuildRequires: libSM-devel

* Mon Mar 28 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.6.0-1
- new upstrem release

* Thu Sep 23 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.3.107-2
- rebuilt with rpm-4.8.1 for pkg-config

* Sun May 23 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.3.107-1
- new upstrem release
- built with new toolchain

* Mon Feb  8 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.3.106-1
- new upstrem release
- added BR: perl-URI

* Wed Feb 03 2010 Shu KONNO <owa@bg.wakwak.com> 0.3.105-2
- rebuilt with python-2.6.4

* Sun Nov  1 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.3.105-1
- new upstrem release

* Fri May 22 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.3.101-1
- new upstrem release
- removed lib*.a from devel package

* Sun Aug 17 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.3.4-1
- applied with new versioning policy
- spec in UTF-8

* Fri Jan 25 2008 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 0.3.4-0vl3
- add BuildRequires: libnotify >= 0.4.0, xfce-mcs-plugins >= 4.2.2

* Sun Dec 23 2007 UECHI Yasumasa <uechi@potaway.net> 0.3.4-0vl2
- new upstream release.

* Sun Jul 29 2007 UECHI Yasumasa <uechi@potaway.net> 0.3.2-0vl2
- build for VineSeed

* Sat Jul 28 2007 UECHI Yasumasa <uechi@potaway.net> 0.3.2-0vl1
- new upstream version
- add %{_sysconfdir}/xdg/xfce4/helpers.rc in files section.
- add %{_bindir}/* in files section.
- add %{_libdir}/xfce4 in files section.
- add %{_libexecdir}/* in files section.
- add %{_datadir}/icons/hicolor/*/apps/*.png in files section.
- add %{_mandir}/man1/* in files section.
- add %{_datadir}/xfce4/doc/*/* in files section.
- add %{_datadir}/xfce4/helpers in files section.
- remove %{_datadir}/gtk-doc/html/exo in files section.
- update icon-cache in %post and %postun.

* Fri Aug 25 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.3.0-0vl3
- changed Group to System Environment/Libraires
- changed devel Group to Development/Libraries
- added %post and %postun section

* Fri Apr 22 2005 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 0.3.0-0vl2
- rebuild for VineSeed

* Sun Apr 17 2005 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 0.3.0-0vl1
- initial build for Vine Linux
