%define name     medit
%define version  1.0.1

Name:        %{name}
Version:     %{version}
Release:     1%{?_dist_release}
Summary:     Multiplatform GTK+2 text editor
Summary(ja): マルチプラットフォームな GTK+2 テキストエディタ
Group:       Applications/Editors
License:     GPLv2+
URL:         http://mooedit.sourceforge.net/
Source0:     http://prdownloads.sourceforge.net/mooedit/%{name}-%{version}.tar.bz2
Source1:     medit_ja.po

BuildRoot:   %{_tmppath}/%{name}-%{version}-root

Buildrequires:   cairo-devel
BuildRequires:   desktop-file-utils
BuildRequires:   gettext
BuildRequires:   gtk2-devel glib2-devel
BuildRequires:   intltool
BuildRequires:   libxml2-devel
BuildRequires:   libX11-devel libXext-devel libICE-devel
BuildRequires:   libSM-devel
Buildrequires:   perl-XML-Parser pango-devel
BuildRequires:   pcre-devel
BuildRequires:   python-devel
BuildRequires:   pygtk2-devel

%description
Medit is a multiplatform GTK+2 text editor.

Features:
 * Configurable syntax highlighting.
 * Configurable keyboard accelerators.
 * Multiplatform - works both on unix and windows.
 * Plugins: can be written in C or Python.
 * Configurable tools available from the main and context menus. 
   They can be written in Python or Lua, or it can be a shell script.
 * Regular expression search/replace, grep and find frontends, builtin file selector, etc. 

%description -l ja
Medit はマルチプラットフォームな GTK+2 テキストエディタです。

機能一覧:
 * 設定可能な構文強調機能。
 * 設定可能なキーボードアクセラレータ。
 * マルチプラットフォーム - unix と windows の両者で動作。
 * プラグイン: C あるいは Python で作成可能。
 * メインメニューおよびコンテキストメニューから設定可能なツールを利用可能。
   Python あるいは lua 、シェルスクリプトで作成可能。
 * 正規表現による検索/置換、grep と find のフロントエンド、組み込みファイルセレクタなどなど。


%prep
%setup -q
sed -i 's|fr|fr\nja|g' po/LINGUAS

%__cp -f %{SOURCE1} po/ja.po

%build
#cmake -D CMAKE_INSTALL_PREFIX=/usr .
%configure
make %{?_smp_mflags}

%install
rm -rf %{buildroot}
make install DESTDIR=$RPM_BUILD_ROOT

desktop-file-install --vendor=""                          \
        --dir=${RPM_BUILD_ROOT}%{_datadir}/applications   \
        --mode 0644                                       \
        $RPM_BUILD_ROOT/%{_datadir}/applications/%{name}.desktop

%post
update-desktop-database %{_datadir}/applications
touch --no-create %{_datadir}/icons/hicolor
if [ -x /usr/bin/gtk-update-icon-cache ]; then
  gtk-update-icon-cache -q %{_datadir}/icons/hicolor ||:
fi

%postun
update-desktop-database %{_datadir}/applications
touch --no-create %{_datadir}/icons/hicolor
if [ -x /usr/bin/gtk-update-icon-cache ]; then
  gtk-update-icon-cache -q %{_datadir}/icons/hicolor ||:
fi

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc COPYING README
%{_bindir}/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/%{name}-1/*
%{_datadir}/icons/hicolor/48x48/
%exclude %{_datadir}/icons/hicolor/icon-theme.cache
%{_datadir}/locale/*
%{_docdir}/%{name}-1/*
%{_mandir}/man?/

%changelog
* Mon Feb 28 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.0.1-1
- new upstream release

* Sat Feb 12 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.0.0-1
- new upstream release
- updated Source1
- dropt BuildRequires: cmake
- added BuildRequires: libSM-devel
- fixed %%files

* Sun Oct 17 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.10.5-2
- updated Source1

* Fri Oct 8 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.10.5-1
- new upstream release
- cleaned up spec

* Sat Jul 3 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.10.4-2
- updated Source1
- added BuildRequires: cairo-devel, gettext, libX11-devel, perl-XML-Parser, pango-devel
- changed BuildRequires: cmake >= 2.6

* Wed May 5 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.10.4-1
- new upstream release
- added Japanese language file
- added man directory in %files

* Sun Mar 21 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.10.1-1
- new upstream release
- applied new naming policy to spec

* Fri Mar 5 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.10.0-1
- initial build for VineSeed

* Mon Jan 21 2008 Funda Wang <fundawang@mandriva.org> 0.9.2-1mdv2008.1
+ Revision: 155675
- New version 0.9.2
- rediff patch0

  + Olivier Blin <oblin@mandriva.com>
    - restore BuildRoot

  + Thierry Vignaud <tvignaud@mandriva.com>
    - kill re-definition of %%buildroot on Pixel's request

* Sat Dec 01 2007 Funda Wang <fundawang@mandriva.org> 0.9.0-1mdv2008.1
+ Revision: 114221
- New version 0.9.0

* Sat Nov 17 2007 Jérôme Soyer <saispo@mandriva.org> 0.8.11-1mdv2008.1
+ Revision: 109208
- New release 0.8.11

* Tue Aug 07 2007 Funda Wang <fundawang@mandriva.org> 0.8.10-1mdv2008.0
+ Revision: 59667
- New version 0.8.10

* Wed Aug 01 2007 Funda Wang <fundawang@mandriva.org> 0.8.9-1mdv2008.0
+ Revision: 57568
- New version 0.8.9

* Thu Jul 12 2007 Funda Wang <fundawang@mandriva.org> 0.8.8-1mdv2008.0
+ Revision: 51500
- Fix file list
- New version

* Thu Jun 14 2007 Funda Wang <fundawang@mandriva.org> 0.8.6-1mdv2008.0
+ Revision: 39539
- SILent renew tarball
- New version
- New version
  add dirty patch that skips update-icon-cache and mime database when building

  + Jérôme Soyer <saispo@mandriva.org>
    - Import medit




* Tue May 09 2006 UTUMI Hirosi <utuhiro78@dummy.org> 0.6.98-1mdk
- new release

* Mon May 08 2006 UTUMI Hirosi <utuhiro78@dummy.org> 0.6.97-1mdk
- first spec for Mandriva
