%define	mainver		0.95.1

Name:		gnome-do
Version:	0.95.1
Release:	1%{?_dist_release}
Summary:	Quick launch and search
Summary(ja):	高速な起動及び検索を行うランチャー

License:	GPLv3+
Group:		Applications/Accessories	
URL:		http://do.cooperteam.net/
# http://launchpad.net/do/trunk/0.95.1/+download/gnome-do-0.95.1.tar.gz
Source0:	http://launchpad.net/do/trunk/%{mainver}/+download/gnome-do-%{version}.tar.gz

#Source1:	gnome-do.desktop
# Taken from cmigemo
Source2:	Migemo.cs.utf8
# https://gist.github.com/1021707, but modified for gnome-do-0.8,4
Patch3:         gnome-do-0.8.4-cmigemo.patch

# Vine patch
Patch70:	gnome-do-0.95.1-avoidas.patch

BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires:	mono-devel, mono-addins-devel
BuildRequires:	desktop-file-utils
BuildRequires:	dbus-sharp-devel
BuildRequires:	dbus-sharp-glib-devel
BuildRequires:	gtk-sharp2-devel
BuildRequires:	notify-sharp-devel
BuildRequires:	gconf-sharp2-devel
BuildRequires:	gnome-sharp2-devel, gnome-desktop-sharp2-devel >= 2.26
BuildRequires:	gnome-keyring-sharp-devel
BuildRequires:	gettext
BuildRequires:	perl-XML-Parser
BuildRequires:	intltool
BuildRequires:	gtk2-devel
BuildRequires:	desktop-file-utils
BuildRequires:  gio-sharp-devel
BuildRequires:  gkeyfile-sharp-devel
Requires:	cmigemo

Requires(pre):	GConf2
Requires(post): GConf2
Requires(preun):GConf2

#Requires:	gnome-keyring-sharp, gnome-desktop-sharp2
#Requires:	gnome-desktop, pkgconfig
#Requires:      gio-sharp, gkeyfile-sharp

Packager:	kazutaka

%description
GNOME Do (Do) is an intelligent launcher tool that makes performing
common tasks on your computer simple and efficient. Do not only
allows you to search for items in your desktop environment
(e.g. applications, contacts, bookmarks, files, music), it also
allows you to specify actions to perform on search results
(e.g. run, open, email, chat, play).

%description -l ja
GNOME Do (Do) は高機能なランチャーツールです。 PC を使った一
般的なタスクをシンプルかつ効率的に実行できるようにします。Do
はデスクトップ環境の様々なアイテム(例えばアプリケーションや
連絡先、ブックマーク、ファイル、音楽等)の検索だけでなく、検索
した結果をどう操作するのか(例えば開く、メールに添付、チャット、
再生する等)を指定することができます。

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

%description devel
Development files for GNOME Do

%description devel -l ja
GNOME Do の開発用ファイルです。

%prep
%setup -q
# apply cmigemo patch
%{__cp} %{SOURCE2} Do.Platform/src/Do.Platform/Migemo.cs
%patch3 -p1 -b .cmigemo

%patch70 -p1 -b .as

sed -i -e 's|dbus-sharp-1\.0|dbus-sharp-2\.0|g' configure
sed -i -e 's|dbus-sharp-glib-1\.0|dbus-sharp-glib-2\.0|g' configure

%build
%configure \
    --disable-schemas-install \
    --enable-release

make %{?_smp_mflags}


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

rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/libdo.la

desktop-file-install	\
	--dir $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart	\
	--add-only-show-in=GNOME				\
	$RPM_BUILD_ROOT%{_datadir}/applications/gnome-do.desktop
desktop-file-install --delete-original	\
	--dir $RPM_BUILD_ROOT%{_datadir}/applications	\
	--remove-category Application	\
	$RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop

#kdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/

%find_lang %{name}

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

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

touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
    %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi

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

%postun
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
    %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi

%clean
rm -rf $RPM_BUILD_ROOT

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING COPYRIGHT
%{_bindir}/gnome-do
%{_libdir}/gnome-do/
#{_datadir}/gnome-do/
%config(noreplace) %{_sysconfdir}/xdg/autostart/gnome-do.desktop
%config(noreplace) %{_sysconfdir}/gconf/schemas/*
%{_datadir}/icons/hicolor/*/apps/gnome-do.*
%{_datadir}/applications/*

%files devel
%defattr(-,root,root,-)
%{_libdir}/pkgconfig/*

%changelog
* Sun Apr 19 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 0.95.1-1
- updated to 0.95.1
- dropt Source1
- added Patch70

* Thu Jun 23 2011 Kazutaka HARADA <kazutaka@vinelinux.org> 0.8.4-3
- update Patch2 to fix Bad quantifier error of regex

* Wed Jun 22 2011 Kazutaka HARADA <kazutaka@vinelinux.org> 0.8.4-2
- add Source1 and Patch2: add cmigemo support

* Thu Jan 13 2011 Kazutaka HARADA <kazutaka@vinelinux.org> 0.8.4-1
- new upstream release
- drop Patch0 & 1
- add Patch2: fix compilation error (cs0200)
- add Source1: temporary fix for desktop-file-install failure.
               (Comment[kk] contains a bogus linebreak)

* Sat Nov 06 2010 Kazutaka HARADA <kazutaka@vinelinux.org> 0.8.3.1-4
- add Patch0 & 1 to fix compilation error (Seed only)

* Sat Sep 25 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.3.1-3
- rebuild with rpm-4.8.1 for pkg-config file
- add BuildRequires: gconf-sharp2, rsvg2-sharp

* Mon Jul 26 2010 Shu KONNO <owa@bg.wakwak.com> 0.8.3.1-2
- rebuilt with mono-addins-0.5

* Sun Jan 10 2010 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.8.3.1-1
- new upstream release

* Fri Jul 10 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.8.2-1
- new upstream release
- drop Patch0 (merged in upstream)

* Fri Jun 12 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.8.1.3-3
- change Group to Applications/Accessories

* Fri Jun 12 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.8.1.3-2
- add BuildRequires: wnck-sharp

* Thu Jun 11 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.8.1.3-1
- initial build for Vine Linux based on fedora development

* Fri Apr 10 2009 Sindre Pedersen Bj淡rdal <sindrepb@fedoraproject.org> - 0.8.1.3-5
- Fix .desktop issue, install in both autostart and applications
- Rebuild for new gnome-desktop-sharp
- Add missing gnome-desktop-sharp requires
- Fix Ndesk-dbus Requires

* Wed Apr 01 2009 Sindre Pedersen Bj淡rdal <sindrepb@fedoraproject.org> - 0.8.1.3-3
- Add patch to fix issue where applications wasn't being indexed

* Tue Mar 17 2009 Sindre Pedersen Bj淡rdal <sindrepb@fedoraproject.org> - 0.8.1.3-2
- New upstream release

* Tue Mar 3 2009 Sindre Pedersen Bj淡rdal <sindrepb@fedoraproject.org> - 0.8.0-4
- Own _datadir/gnome-do
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sat Feb  7 2009 Michel Salim <salimma@fedoraproject.org> - 0.8.0-2
- Rebuild against new mono-addins

* Fri Jan 30 2009 Sindre Pedersen Bj淡rdal <sindrepb@fedoraproject.org> - 0.8.0-1
- New upstream release

* Thu Jan 29 2009 Michel Salim <salimma@fedoraproject.org> - 0.6.1.0-3
- Remove Tomboy dependency (bz #481183)
- Updated description, from Do 

* Mon Oct 27 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.6.1.0-2
- rebuild against new gnome-sharp

* Wed Oct 08 2008 Sindre Pedersen Bj淡rdal <sindrepb@fedoraproject.org> - 0.6.1.0-1
- New Upstream Release

* Fri Oct 03 2008 Sindre Pedersen Bj淡rdal <sindrepb@fedoraproject.org> - 0.6.0.1-1
- New upstream release

* Wed Jun 11 2008 Sindre Pedersen Bj淡rdal <sindrepb@fedoraproject.org> - 0.6.0.0-1
- New upstream release

* Wed Jun 11 2008 Sindre Pedersen Bj淡rdal <sindrepb@fedoraproject.org> - 0.5.0.1-4
- New upstream release
- Add gnome-desktop-sharp dependency

* Wed Jun 04 2008 Caol叩n McNamara <caolanm@redhat.com> - 0.4.2.0-2
- rebuild for dependancies

* Tue Apr 22 2008 Sindre Pedersen Bj淡rdal <sindrepb@fedoraproject.org> - 0.4.2.0-1
- New upstream release

* Tue Apr 01 2008 David Nielsen <gnomeuser@gmail.com> - 0.4.0.1-2
- #439793 - correct URL

* Sat Mar 29 2008 David Nielsen <gnomeuser@gmail.com> - 0.4.0.1-1
- Bump to 0.4.0.1
- Hopefully bring an end to the endless dups of 432201

* Thu Feb 21 2008 David Nielsen <david@lovesunix.net> - 0.3.1-2
- Fix 432201

* Thu Feb 21 2008 David Nielsen <david@lovesunix.net> - 0.3.1-1
- Bump to 0.3.1

* Wed Feb 06 2008 David Nielsen <david@lovesunix.net> - 0.3.0.1-5
- #431589 - Force runtime dependency on ndesk-dbus(-glib)

* Mon Feb 04 2008 David Nielsen <david@lovesunix.net> - 0.3.0.1-4
- #431462 - Correctly pull in Tomboy runtime dependency

* Fri Jan 25 2008 David Nielsen <david@lovesunix.net> - 0.3.0.1-3
- autostart gnome-do in quiet mode with the user session
- to invoke gnome-do use super+space

* Tue Jan 22 2008 David Nielsen <david@lovesunix.net> - 0.3.0.1-2
- Fix BuildRequires

* Tue Jan 22 2008 David Nielsen <david@lovesunix.net> - 0.3.0.1-1
- bump to 0.3.0.1
- update patches

* Sat Nov 17 2007 David Nielsen <david@lovesunix.net> - 0.0.2-2
- updated libdir patch
- cleaned up desktop-file-install invocation
- correct BuildRequires

* Mon Nov 12 2007 David Nielsen <david@lovesunix.net> - 0.0.2-1
- Initial package
