#% global gitcommit 905382e

## Summary/Description adopted from Debian with modification

Name:           texworks
Version:        0.6.3
Release:        2%{?gitcommit:.git%gitcommit}%{?_dist_release}
Summary:        An environment for authoring TeX (LaTeX, ConTeXt, etc) documents
Summary(ja):    TeX ドキュメント制作のための総合環境

Group:          Applications/Editors
License:        GPLv2+
URL:            http://tug.org/texworks/
#Source0:        %{name}-%{version}%{?gitcommit:.git%gitcommit}.tar.%{?gitcommit:xz}%{!?gitcommit:gz}
Source0:        texworks-release-%{version}.tar.gz

# Desktop file adopted from Debian with modification
Source1:        %{name}.desktop

## vine
Patch100:       texworks-0.5-ptex2pdf.patch
#Patch101:       texworks-0.4.6-addDefaultBinPaths.patch

BuildRequires:  cmake >= 2.8.6
BuildRequires:  lua-devel
BuildRequires:  hunspell-devel
BuildRequires:  dbus-devel
BuildRequires:  poppler-qt4-devel
# BuildRequires:  python-devel
BuildRequires:  desktop-file-utils

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

Distribution:  Vine
Vendor:    Project Vine
Packager:  munepi


%description
TeXworks is an environment for authoring TeX (LaTeX, ConTeXt, etc) documents,
with a Unicode-based, TeX-aware editor, integrated PDF viewer, and a clean,
simple interface accessible to casual and non-technical users.

You may install the texlive-* packages to make this program useful.

%description -l ja
TeXworks は TeX (LaTeX, ConTeXt, etc) ドキュメント制作のための総合環境です。
ユニコードベースで編集する TeX に特化したエディタに、
PDF プレビュアーが統合されており、不慣れな非技術系のユーザへの
簡潔で操作しやすいインタフェースを備えています。

TeXworks を利用するためには、TeX 環境が必要です。


%prep
%setup -qn %{name}-release-%{version}%{?gitcommit:.git%gitcommit}

%patch100 -p1 -b .vine
#% patch101 -p1 -b .vine

%build
%cmake .
%__make %{?_smp_mflags}


%install
%__rm -rf %{buildroot}
%__make install DESTDIR=%{buildroot}

## install document files
%__mkdir_p %{buildroot}%{_docdir}/%{name}-%{version}

## drop some files
%__rm -f %{buildroot}%{_datadir}/doc/texworks/COPYING
%__rm -f %{buildroot}%{_datadir}/doc/texworks/NEWS
%__rm -f %{buildroot}%{_datadir}/doc/texworks/README.md

%clean
%__rm -rf %{buildroot}

%post
update-desktop-database &> /dev/null || :

%postun
update-desktop-database &> /dev/null || :


%files
%defattr(-,root,root,-)
%doc COPYING NEWS README.md
%{_bindir}/%{name}
%{_usr}/lib/%{name}/lib*.so
%{_datadir}/applications/%{name}.desktop
%{_datadir}/metainfo/%{name}.appdata.xml
%{_datadir}/pixmaps/*
%{_mandir}/man1/texworks.1.gz


%changelog
* Tue Oct 29 2019 Toshiaki Ara <ara_t@384.jp> 0.6.3-2
- rebuild with hunspell-1.7.0

* Wed Jan 03 2018 Toshiaki Ara <ara_t@384.jp> 0.6.3-1
- update to 0.6.3
- update Patch100

* Wed Jan 03 2018 Toshiaki Ara <ara_t@384.jp> 0.6.1-3
- rebuild with poppler-0.61.1

* Tue Jun 28 2016 Munehiro Yamamoto <munepi@vinelinux.org> 0.6.1-2
- rebuilt with new toolchain

* Tue May 10 2016 Munehiro Yamamoto <munepi@vinelinux.org> 0.6.1-1
- new upstream release

* Mon May 09 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.5-7.git905382e
- rebuild with poppler-0.43.0

* Sun Jan 24 2016 Munehiro Yamamoto <munepi@vinelinux.org> 0.5-6.git905382e
- source snapshot git905382e

* Thu May 28 2015 Munehiro Yamamoto <munepi@vinelinux.org> 0.5-5.git046b6bb
- source snapshot git046b6bb based on 0.4.6

* Sat Nov  2 2013 Munehiro Yamamoto <munepi@vinelinux.org> 0.5-4.svn1302
- dropped R/BR: texlive

* Thu Sep 19 2013 Munehiro Yamamoto <munepi@vinelinux.org> 0.5-3.svn1302
- source snapshot r1302
- added BuildRequires: lua-devel

* Fri Mar  9 2012 Munehiro Yamamoto <munepi@vinelinux.org> 0.5-2.svn950
- rebuild with hunspell-devel

* Sun Dec  4 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.5-1.svn950
- source snapshot r950
- updated pdfplatex.sh
  - support SyncTeX
- TeX Live 2011

* Fri Jul 01 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.4.3-1
- new upstream release
- added BuildRequires: texlive-common
- added Requires: texlive-common

* Sat Jun 25 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.4.1-2
- added some Japanese templates

* Sat Jun 18 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.4.1-1
- new upstream release

* Wed Mar 30 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.4.0-1
- new upstream release

* Fri Dec 17 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.3-1.svn724
- source snapshot r724

* Sat Oct 02 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.3-1.svn671
- source snapshot r671
  - dropped obsolete/upstreamed patches
- added texworks-snapshot.sh

* Sat Aug 07 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.2.3-1
- initial build

* Sat Apr 24 2010 Robin Lee <robinlee.sysu@gmail.com> - 0.2.3-3
- Move to menu category 'Office'
- License tag revised to 'GPLv2+'
- Initial import to Fedora repositories

* Thu Apr 22 2010 Robin Lee <robinlee.sysu@gmail.com> - 0.2.3-2
- Fix some strange characters in README
- Patch TeXworks.pro to use qmake mechanism to install files and fix DSO linking
  problem

* Sun Apr 11 2010 Robin Lee <robinlee.sysu@gmail.com> - 0.2.3-1
- Initial packaging
