Summary:   CherryTree - note taking application
Summary(ja): CherryTree - ノート作成アプリケーション
Name:	   cherrytree
Version:   0.9.3
Release:   1%{?_dist_release}
License:   GPLv2+
Group:     Applications/Productivity
URL:	   http://open.vitaminap.it/en/cherrytree.htm
Source0:   %{name}_%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildArch: noarch

BuildRequires:  ImageMagick
Requires:  python
Requires:  pygtk2
Requires:  gtksourceview2
Requires:  pygtksourceview

#Obsoletes: %name < %version

%description
A hierarchical note taking application, featuring rich text and syntax highlighting.
Features:
- rich text (foreground color, background color and bold)
- syntax highlighting (only when the rich text is disabled in the current node)
- find a node, find in current node, find in all nodes
- replace in node names, replace in current node, replace in all nodes
- iteration of the latest find, iteration of the latest replace

%description -l ja
階層型ノートの作成アプリケーションで、リッチテキストや構文の強調表示を備えています。
特長：
- リッチテキスト（前景色、背景色、太字）
- 構文の強調表示（現在のノードではリッチテキストの場合だけ無効）
- ノードの検出、現在のノードからの検索、すべてのノードからの検索
- ノードの名前の置換、現在のノードで置換、すべてのノードで置換
- 最新の検索・置換の繰り返し

%prep
%setup -q -n %{name}

%build

%install
rm -rf %{buildroot}
%__install -dm 755 %{buildroot}%{_bindir}
%__install -m 755 %{name} %{buildroot}%{_bindir}
%__install -dm 755 %{buildroot}%{_datadir}/%{name}
cp -R glade %{buildroot}%{_datadir}/%{name}
%__install -dm 755 %{buildroot}%{_datadir}/mime-info
%__install -dm 755 %{buildroot}%{_datadir}/mime/packages/
%__install -dm 755 %{buildroot}%{_datadir}/application-registry
%__install -dm 755 %{buildroot}%{_datadir}/applications
%__install -dm 755 %{buildroot}%{_datadir}/pixmaps
cp -R modules %{buildroot}%{_datadir}/%{name}/modules
%__install -m  644 glade/%{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
convert %{buildroot}%{_datadir}/pixmaps/%{name}.png -resize 48x48 %{buildroot}%{_datadir}/pixmaps/%{name}.png

mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
cat > $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=CherryTree
Comment=Tree-way Notes Keeper
Comment[ja]=階層型ノートの作成
Exec=cherrytree %f
Icon=cherrytree
MimeType=text/cherrytree-ctd;
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Office;
EOF

#remove
rm -f %{buildroot}/%{_datadir}/%{name}/glade/*.desktop
rm -f %{buildroot}/%{_datadir}/%{name}/glade/README

%clean
rm -rf %{buildroot}

%post
update-desktop-database %{_datadir}/applications
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%postun
update-desktop-database %{_datadir}/applications
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :


%files 
%defattr(-,root,root)
%{_bindir}/%{name}
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/%{name}
%{_datadir}/application-registry
%{_datadir}/mime-info
%{_datadir}/mime/packages
%{_datadir}/applications/*.desktop


%changelog
* Sat Mar 20 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.9.3-1
- new upstream release
- applied new naming policy to spec 

* Sun Mar 7 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.9.2-1
- new upstream release
- added BuildRequires: ImageMagick

* Wed Feb 17 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.9.1-1
- new upstream release

* Mon Feb 15 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.9-1
- new upstream release

* Sat Feb 6 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.8.3-2
- rebuilt with python-2.6.4

* Thu Jan 21 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.8.3-1
- new upstream release

* Thu Jan 7 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.8.2-1
- new upstream release

* Wed Dec 23 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.8.1-1
- new upstream release

* Fri Dec 18 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.8-1
- initial build for Vine Linux

* Sun Dec 13 2009 slick50 <lxgator@gmail.com> 0.7.1-1pclos2010
- 0.7.1

* Sat Dec 12 2009 slick50 <lxgator@gmail.com> 0.7-1pclos2010
- 0.7

* Tue Dec 08 2009 slick50 <lxgator@gmail.com> 0.6.3-1pclos2010
- 0.6.3

* Fri Dec 05 2009 slick50 <lxgator@gmail.com> 0.6.2-1pclos2010
- 0.6.2

* Thu Nov 26 2009 slick50 <lxgator@gmail.com> 0.6-1pclos2010
- 0.6

* Fri Nov 20 2009 slick50 <lxgator@gmail.com> 0.5.1-1pclos2010
- 0.5.1

* Thu Nov 19 2009 slick50 <lxgator@gmail.com> 0.5-1pclos2010
- 0.5

* Thu Nov 12 2009 slick50 <lxgator@gmail.com> 0.4-1pclos2010
- 0.4

* Thu Nov 05 2009 slick50 <lxgator@gmail.com> 0.3-1pclos2010
- 0.3

* Fri Oct 30 2009 slick50 <lxgator@gmail.com> 0.2-1pclos2010
- 0.2

* Fri Oct 16 2009 Texstar <texstar at gmail.com> 0.1-2pclos2010
- add missing dependency gnome-python-gtksourceview

* Wed Oct 14 2009 slick50 <lxgator@gmail.com> 0.1-1pclos2010
- initial pkg

