%define tomboy_dir %{_prefix}/lib
%define pkgconfigdir %{_datadir}/pkgconfig

Summary:	Tomboy is a desktop note-taking application for Linux and Unix.
Summary(ja): 	Linux 向けのデスクトップ用メモ取りアプリケーション
Name:		tomboy
Version:	1.14.1
Release: 	5%{?_dist_release}

License:	LGPLv2
Group:		Applications/Accessories
URL:		https://wiki.gnome.org/Apps/Tomboy

Source0:	http://download.gnome.org/sources/%{name}/1.14/%{name}-%{version}.tar.xz

# Vine Patch
# ad-hoc patch to build with dbus-sharp 0.8.0
Patch100:       tomboy-1.14.1-dbussharp2.patch

BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildRequires:	atk-devel >= 1.2.4
BuildRequires:	GConf2-devel
BuildRequires:	gtk-sharp2-devel >= 2.10.1
BuildRequires:	gtk2-devel >= 2.20
BuildRequires:	gtkspell-devel
BuildRequires:	dbus-devel
BuildRequires:	dbus-sharp-glib-devel
BuildRequires:	mono-core
BuildRequires:	mono-addins-devel
BuildRequires:	mono-devel
BuildRequires:	gnome-sharp2 >= 2.24
BuildRequires:	gconf-sharp2
BuildRequires:	art-sharp2
BuildRequires:	gnome-vfs-sharp2
BuildRequires:	docbook-dtds
BuildRequires:	gnome-doc-utils >= 0.17.3
BuildRequires:	libSM-devel
Requires:	gtkspell
Requires:	gconf-sharp2
# Requires:	gnome-panel-sharp
Requires:	mono-addins

Requires(post):	shared-mime-info
Requires(postun): shared-mime-info

Vendor:		Project Vine
Distribution:	Vine Linux
Packager:	kazutaka, Takemikaduchi

%description
Tomboy is a desktop note-taking application for Linux and Unix. Simple and easy
to use, but with potential to help you organize the ideas and information you
deal with every day.  The key to Tomboy's usefulness lies in the ability to
relate notes and ideas together.  Using a WikiWiki-like linking system,
organizing ideas is as simple as typing a name.  Branching an idea off is easy
as pressing the Link button. And links between your ideas won't break, even when
renaming and reorganizing them.

%description -l ja
Tomboy は Linux/Unix 向けのデスクトップ用メモ取りアプリケーションです。シンプルで使い易いですが、あなたが毎日扱うアイディアや情報を整理するのに役に立つ能力を持っています。Tomboy の使い易さのキーポイントは、ノートとアイディアを関連付ける点です。WikiWiki ライクなリンクシステムを使うことで、アイデアは名前を入力するだけで整理され、リンクボタンを押すだけでアイデア同士をつなげることができます。また名前を変えたり整理し直してもアイデア間のリンクが切れることはありません。


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

%description    devel
The %{name}-devel package contains development files for %{name}.


%prep
%setup -q
%patch100 -p0 -b .dbussharp2

autoreconf -fiv

%build
%configure \
	--disable-scrollkeeper \
	--disable-evolution \
	--disable-galago \
	--disable-update-mimedb \
	--libdir=%{_prefix}/lib

%{__make}


%install
%{__rm} -rf ${RPM_BUILD_ROOT}
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
%{__make} install \
	DESTDIR=${RPM_BUILD_ROOT} \
	pkgdatadir=%{_datadir} \
	libdir=%{tomboy_dir} \
	pkgconfigdir=%{pkgconfigdir}

unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL

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

%find_lang %{name}

%post
update-desktop-database &>/dev/null || :
update-mime-database >&/dev/null || :
scrollkeeper-update > /dev/null 2>&1 || :
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule \
    %{_sysconfdir}/gconf/schemas/tomboy.schemas > /dev/null
touch --no-create %{_datadir}/icons/hicolor
if [ -x /usr/bin/gtk-update-icon-cache ]; then
  gtk-update-icon-cache -q %{_datadir}/icons/hicolor
fi


%preun
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-uninstall-rule \
    %{_sysconfdir}/gconf/schemas/tomboy.schemas >/dev/null;

%postun
update-desktop-database &>/dev/null || :
update-mime-database >&/dev/null || :
scrollkeeper-update > /dev/null 2>&1 || :


%clean
%__rm -rf ${RPM_BUILD_ROOT}


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING ChangeLog NEWS README
%{_bindir}/tomboy
#%{_bindir}/tomboy-panel
%dir %{tomboy_dir}/tomboy
%dir %{tomboy_dir}/tomboy/addins
%{tomboy_dir}/tomboy/Tomboy.*
%{tomboy_dir}/tomboy/libtomboy.*
%{tomboy_dir}/tomboy/addins/*
#%{tomboy_dir}/bonobo/servers/GNOME_TomboyApplet.server
%{_datadir}/dbus-1/services/org.gnome.Tomboy.service
%{_datadir}/applications/tomboy.desktop
%{_datadir}/gnome/help/tomboy
%{_datadir}/icons/hicolor/
%{_datadir}/mime/packages/%{name}.xml
%{_mandir}/man1/tomboy.1.gz
%{_sysconfdir}/gconf/schemas/tomboy.schemas

%files devel
%defattr(-,root,root,-)
%{pkgconfigdir}/tomboy-addins.pc


%changelog
* Sun May 10 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.14.1-5
- remove *.la files

* Sat Mar 28 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 1.14.1-4
- rebuilt with mono 3.12.1 and mono-addins 1.2
- added Requires: gtk-sharp2-devel to devel subpackage

* Wed Dec 17 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 1.14.1-3
- added Patch100 to build with dbus-sharp 0.8.1 and dbus-shar-glib 0.6.0
- added BR: GConf2-devel

* Sat Jan 04 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.14.1-2
- rebuild with VineSeed environment

* Sun May 19 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.14.1-1
- new upstream release

* Sun Apr 21 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.14.0-1
- new upstream release

* Wed Nov 14 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.12.2-1
- new upstream release

* Tue Oct 16 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.12.1-1
- change BuildRequires: mono-addins-devel instead of mono-addins
- create %{name}-devel sub package

* Tue Oct 16 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.12.1-1
- new upstream release

* Sun Sep 30 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.12.0-1
- new upstream release

* Sun May 20 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.10.2-1
- new upstream release
- remove Patch0
- remove BuildRequires: ndesk-dbus, ndesk-dbus-glib
- add BuildRequires: dbus-sharp-glib-devel

* Sun Apr 22 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.10.1-1
- new upstream release

* Mon Nov 21 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.8.3-1
- new upstream release
- update Patch0 (tomboy-1.8.3-ndesk-dbus.patch)

* Fri Sep 30 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.8.0-1
- new upstream release
- add Patch0 (tomboy-1.8.0-ndesk-dbus.patch)
- remove BuildRequires: dbus-sharp-glib-devel
- add BuildRequires: ndesk-dbus, ndesk-dbus-glib

* Fri Sep 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.7.7-1
- new upstream release

* Sat Sep 03 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.7.5-1
- new upstream release

* Tue Aug 16 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.7.2-1
- new upstream release
- drop BuildRequires: gnome-panel-sharp
- add BuildRequires: dbus-sharp-glib-devel

* Mon Apr 25 2011 Shu KONNO <owa@bg.wakwak.com> 1.4.2-3
- rebuilt with mono-2.10.1-3

* Sun Apr 03 2011 Shu KONNO <owa@bg.wakwak.com> 1.4.2-2
- rebuilt with mono-2.10.1

* Sat Nov 20 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.4.2-1
- new upstream release

* Tue Oct 05 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.4.0-1
- new upstream release
- add BuildRequires: libSM-devel
- add Requires: gconf-sharp2, gnome-panel-sharp, ndesk-dbus, ndesk-dbus-glib, mono-addins
- add configure option (--enable-panel-applet=yes)
- fix %files

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

* Sat Apr 17 2010 Kazutaka HARADA <kazutaka@vinelinux.org> 1.2.0-1
- new upstream release
- add --disable-update-mimedb configure option
- run update-mime-database at %%post and %%postun
- add Requires(post/postun): shared-mime-info
- add BuildRequires: gnome-doc-utils, docbook-dtds (<BTS:VineLinux:904>)

* Sat Oct 10 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.0.0-1
- new upstream release

* Sat Aug 15 2009  0.14.2-3
- add BuildRequires: mono-devel
- run update-desktop-database and gtk-update-icon-cache as %post & %postun

* Fri Jul 10 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.14.2-2
- rebuild with latest rpm to update mono-dependencies

* Tue May 19 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.14.2-1
- new upstream release

* Fri May 01 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.14.1-1
- new upstream release
- add BuildRequires: gnome-panel-sharp >= 2.26.0
- add Packager tag

* Thu Mar 26 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.13.6-1
- new upstream release
- remove unneeded Requires:
- add --enable-dbus=yes to configure option

* Fri Jan 30 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.12.2-1
- new upstream release

* Mon Nov 03 2008 Shu KONNO <owa@bg.wakwak.com> 0.12.0-2
- dropt %%{_libdir}/tomboy/Mono.Addins.* in %%files
- added BuildRequires: mono-addins
- added Requires: mono-addins
- added macro %%pkgconfigdir

* Thu Oct 09 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.12.0-1
- source update
- add BuildRequires: gnome-sharp2, gconf-sharp2, art-sharp2, gnome-vfs-sharp2

* Tue Apr 22 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.10.1-1
- source update.
- add BuildRequires:ndesk-dbus, ndesk-dbus-glib
- apply new versioning policy

* Sat Oct 27 2007 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.8.1-0vl1
- source update.

* Sun Apr 29 2007 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.6.3-0vl1
- source update.

* Wed Oct 04 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.4.1-0vl2
- add mono-core in Requires and BuildRequres. <BTS:VineLinux:226>

* Sun Sep 24 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.4.1-0vl1
- source update.
- change Group to User Interface/Desktops.

* Sun Sep 24 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.3.5-0vl1
- initial build for Vine Linux

