Name:		latexila
Version:	2.2.2
Release:	1%{?_dist_release}
Summary:	Integrated LaTeX Environment for the GNOME desktop

Group:		Applications/Publishing
License:	GPLv3+
URL:		http://projects.gnome.org/latexila/
Source0:	http://ftp.gnome.org/pub/GNOME/sources/%{name}/2.2/%{name}-%{version}.tar.xz

BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:	gettext
BuildRequires:	cmake
BuildRequires:	gtksourceview2-devel
BuildRequires:	desktop-file-utils
BuildRequires:	libgee-devel 
BuildRequires:	unique-devel
BuildRequires:	itstool

Requires:	hicolor-icon-theme
Requires:	itstool
Requires:	latexmk
Requires:	rubber
Requires:	gsettings-desktop-schemas

Vendor: Project Vine
Distribution: Vine Linux


%description
LaTeXila is an Integrated LaTeX Environment for GNOME. The main features are:
  * Configurable buttons to compile, convert and view a document in one click
  * LaTeX commands auto-completion
  * Symbol tables (Greek letters, arrows, ...)
  * File browser integrated
  * Template managing
  * Menus with the most commonly used LaTeX commands
  * Easy projects management

%prep
%setup -q

%build
%cmake -DCMAKE_C_FLAGS:STRING="%{optflags}" .
make VERBOSE=1 %{?_smp_mflags}

%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
%find_lang %{name}

#Adding folders for .desktop file and icons
for s in 16 22 24 32 48; do
  install -Dp data/images/app/icon$s.png \
  %{buildroot}%{_datadir}/icons/hicolor/${s}x$s/apps/%{name}.png
done	

desktop-file-install \
	--dir %{buildroot}%{_datadir}/applications \
	 %{buildroot}%{_datadir}/applications/%{name}.desktop

%clean
rm -rf %{buildroot}

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

if [ $1 -eq 1 ] ; then
	glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
fi

%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 || :
fi

glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :

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

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING README NEWS HACKING TODO
%{_mandir}/man1/%{name}.1.*
%{_bindir}/*

%{_datadir}/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
%{_datadir}/icons/hicolor/22x22/apps/%{name}.png
%{_datadir}/icons/hicolor/24x24/apps/%{name}.png
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%{_datadir}/glib-2.0/schemas/org.gnome.%{name}.gschema.xml
%{_datadir}/gnome/help/%{name}

%changelog
* Mon Oct 10 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.2.2-1
- initial build for Vine Linux


* Tue Jul 12 2011 Thibault North <tnorth@fedoraproject.org> - 2.0.8-1
- Update to 2.0.8

* Thu Apr 7 2011 Thibault North <tnorth@fedoraproject.org> - 2.0.7-1
- Update to 2.0.7

* Sun Mar 20 2011 Thibault North <tnorth@fedoraproject.org> - 2.0.6-1
- Update to 2.0.6

* Tue Feb 15 2011 Thibault North <tnorth@fedoraproject.org> - 2.0.5-1
- Update to 2.0.5, thanks Sébastien Wilmet

* Thu Nov 25 2010 Thibault North <tnorth@fedoraproject.org> - 2.0.1-4
- A few more fixes

* Mon Nov 22 2010 Thibault North <tnorth@fedoraproject.org> - 2.0.1-3
- Use %%find_lang, fixes by Mohamed El Morabity

* Sun Nov 21 2010 Thibault North <tnorth@fedoraproject.org> - 2.0.1-2
- Small fixes

* Sun Nov 21 2010 Sébastien Wilmet <sebastien.wilmet@gmail.com> - 2.0.1-1
- Release 2.0.1

* Sun Nov 14 2010 Thibault North <tnorth@fedoraproject.org> - 2.0.0-1
- Release 2.0

* Mon Mar 1 2010 Sébastien Wilmet <sebastien.wilmet@gmail.com> - 0.2-1
- New upstream release
- Icons support

* Fri Dec 25 2009 Sébastien Wilmet <sebastien.wilmet@gmail.com> - 0.1-1
- Initial package for Fedora
