Name:           gtranslator
Version:        2.91.6
Release:        3%{?_dist_release}
Summary:	Gettext po file editor for GNOME
Summary(ja):    GNOME 用の po ファイルエディタ

License:        GPLv2+ and GPLv3+
Group:          Applications/Development
URL:            http://www.gtranslator.org/
Source0:	http://ftp.gnome.org/pub/GNOME/sources/gtranslator/2.91/%{name}-%{version}.tar.xz
Source1:	gtranslator.master.ja.po

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

BuildRequires:  glib2-devel >= 2.25.10
BuildRequires:  gtk3-devel >= 3.0.3
BuildRequires:  gtksourceview3-devel >= 3.0.0
BuildRequires:  gdl-devel >= 2.91.1
BuildRequires:  libxml2-devel >= 2.4.12
BuildRequires:  libgda-devel >= 5.0.0
BuildRequires:  libpeas-devel >= 1.0.0
BuildRequires:  gobject-introspection-devel
BuildRequires:  gsettings-desktop-schemas-devel
BuildRequires:  iso-codes
BuildRequires:  itstool
BuildRequires:	intltool desktop-file-utils

# for documentation
BuildRequires:  gtk-doc
BuildRequires:  gnome-doc-utils >= 0.20.2

# for open-tran plugin
BuildRequires:  json-glib-devel >= 0.12.0

# for dictionary plugin
#BuildRequires: gnome-utils-devel
BuildRequires:	gnome-dictionary-devel

# for spell support
#Requires: gtkspell >= 2.0.16
#BuildRequires: gtkspell-devel >= 2.0.16

Requires:       gda-sqlite
Requires:       gsettings-desktop-schemas
Requires:	hicolor-icon-theme


Vendor:	        Project Vine
Distribution:   Vine Linux
Packager:       inagaki, yasumichi


%description
gtranslator is an enhanced gettext po file editor for the GNOME
desktop environment. It handles all forms of gettext po files and
features many comfortable everyday usage features like find and
replace functions, auto translation, and translation learning,


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

%description devel
This package contains the headers that programmers will need to develop
applications which will use %{name}.

%prep
%setup -q
cp %{SOURCE1} po/ja.po


%build
%configure \
    --disable-static \
    --disable-scrollkeeper \
    --enable-debug=no \
    --enable-introspection=yes \
    --with-gda=5.0

make %{?_smp_mflags} CFLAGS="%{optflags}"

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'

desktop-file-install --delete-original \
	--dir $RPM_BUILD_ROOT%{_datadir}/applications \
	$RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop

%find_lang %{name} --with-gnome
# Convert to utf-8
for file in doc/UMTF/*.UMTF; do
    iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \
    touch -r $file $file.new && \
    mv $file.new $file
done
rm -rf UMTF
mkdir -p UMTF
cp -p doc/UMTF/{README.UMTF,ChangeLog,example.xml} UMTF

%clean
rm -rf $RPM_BUILD_ROOT


%post 
update-desktop-database &>/dev/null || :
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
/sbin/ldconfig

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || :

%postun
update-desktop-database &>/dev/null || :
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
    glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || :
fi
/sbin/ldconfig


%files -f %{name}.lang
%defattr(-, root, root, 0755)
%doc AUTHORS ChangeLog COPYING NEWS README THANKS
%doc UMTF
%{_bindir}/gtranslator
%{_libdir}/gtranslator
%{_datadir}/applications/*.desktop
%{_datadir}/glib-2.0/schemas/org.gnome.gtranslator.*gschema.xml
%{_datadir}/gtranslator
%{_datadir}/icons/hicolor/*/apps/gtranslator.*
%{_mandir}/man?/*

%files devel
%defattr(-, root, root, -)
%{_includedir}/gtranslator-3.0
%{_libdir}/pkgconfig/*.pc
%{_datadir}/gtk-doc/html/gtranslator

%changelog
* Fri Feb 20 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 2.91.6-3
- rebuilt on current VineSeed
- changed BR: gnome-dictionary-devel instead of gnome-utils-devel
- added BR: desktop-file-utils

* Wed May 15 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.91.6-2
- add Source1 (gtranslator.master.ja.po)

* Mon May 06 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.91.6-1
- new upstream release
- remove Patch0 (gtranslator-2.91.5-gdl.patch)
- add BuildRequires: yelp-tools

* Thu Nov 15 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.91.5-3
- add Patch0 (gtranslator-2.91.5-gdl.patch)

* Sun Oct 07 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.91.5-2
- rebuild with gdl-3.6.0

* Sun Aug 05 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.91.5-1
- new upstream release

* Sun May 06 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.91.4-1
- new upstream release

* Mon Apr 30 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.91.3-1
- new upstream release

* Sat Apr 28 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.91.2-1
- new upstream release

* Thu Nov 03 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.90.7-1
- new upstream release
- change BuildRequires: gtk3-devel instead of gtk2-devel
- change BuildRequires: gtksourceview3-devel instead of gtksourceview2-devel
- add BuildRequires: libpeas-devel, iso-codes, json-glib-devel

* Wed Oct 20 2010 Yasumichi Akahoshi <yasumichi@vinelinux.org> 1.9.12-2
- add (Build)Requires gsettings-desktop-schemas.
- add Requires gda-sqlite instead of libgda.

* Wed Oct 13 2010 Yasumichi Akahoshi <yasumichi@vinelinux.org> 1.9.12-1
- new upstream release
- rebuild dependency
- replace GConf2 by glib-compile-schemas
- care desktop-files

* Thu Mar 11 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.9.9-1
- new upstream release
- add BuildRequires: unique-devel
- drop Patch0

* Thu Nov 19 2009 Yasumichi Akahoshi <yasumichi@vinelinux.org> 1.9.6-2
- add libuuid to Requires.
- add libuuid-devel and gnome-doc-utils to BR.
- add Patch0 (https://bugzilla.gnome.org/show_bug.cgi?id=591587)
- export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 when install.

* Thu Nov 19 2009 Yasumichi Akahoshi <yasumichi@vinelinux.org> 1.9.6-1
- new upstream release
- add Requires glib2,gtksourceview2,gdl,gtkspell,gucharmap,apr,apr-util,neon,subversion

* Sat May 16 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.9.5-1
- applied new versioning policy, spec in UTF-8
- new upstream release
- updated BuildRequires:
- split devel subpackage
- changed Group to Applications/Development

* Sat Oct  8 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.1.6-0vl1
- new upstream release
- added BuildRequires: gtkspell-devel

* Thu Jan 29 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.1.4-0vl1
- new upstream snapshot, tarball is taken from debian pool
- add Patch10 from debian package

* Tue Sep 09 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.0-1vl1
- build for VineSeedPlus

* Thu Sep 04 2003 Dag Wieers <dag@wieers.com> - 1.0-1
- Updated to release 1.0.

* Tue Sep 02 2003 Dag Wieers <dag@wieers.com> - 1.0-0.pre1
- Updated to release 1.0pre1.

* Fri Jun 27 2003 Dag Wieers <dag@wieers.com> - 1.0-0.cvs20030626
- Updated to release 1.0CVS-20030626.

* Sat Jun 14 2003 Dag Wieers <dag@wieers.com> - 0.99-0
- Updated to release 0.99.

* Tue Mar 18 2003 Dag Wieers <dag@wieers.com> - 0.43-0
- Initial package. (using DAR)
