texworks/texworks.spec
2011-05-25 11:13:50 +01:00

130 lines
3.6 KiB
RPMSpec

%global rev 759
%global py_ver %(%{__python} -c "import sys;sys.stdout.write(sys.version[:3])")
Name: texworks
Version: 0.4.0
Release: 3%{?dist}
Summary: A simple IDE for authoring TeX documents
Group: Applications/Editors
License: GPLv2+
URL: http://tug.org/texworks/
Source0: http://texworks.googlecode.com/files/%{name}-%{version}-r%{rev}.tar.gz
Patch0: %{name}-0.4.0-64bit.patch
BuildRequires: hunspell-devel
BuildRequires: dbus-devel
BuildRequires: poppler-qt4-devel
BuildRequires: python2-devel
BuildRequires: lua-devel
BuildRequires: desktop-file-utils
BuildRequires: perl
# Description adopted from Debian with modification
%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.
%prep
%setup -q
%patch0 -p1 -b .64bit
# pkg-config file of Lua
perl -pi -e 's/(?<=lua)5\..*//' plugins-src/TWLuaPlugin/TWLuaPlugin.pro
# Python version
perl -pi -e 's/2\.6/%{py_ver}/' plugins-src/TWPythonPlugin/TWPythonPlugin.pro
# library path
perl -pi -e 's,/usr/local/lib,%{_libdir},' \
plugins-src/TWPythonPlugin/TWPythonPlugin.pro \
plugins-src/TWLuaPlugin/TWLuaPlugin.pro
%build
# build Lua scripting plugin
pushd plugins-src/TWLuaPlugin/
%_qt4_qmake
make %{?_smp_mflags}
popd
# build Python scripting plugin
pushd plugins-src/TWPythonPlugin/
%_qt4_qmake
make %{?_smp_mflags}
popd
# build the main program
%_qt4_qmake INSTALL_PREFIX=%{_prefix} DOCS_DIR=%{_docdir}/%{name}-%{version} \
-after \
'QMAKE_CXXFLAGS -= -DTW_BUILD_ID=personal -DTW_HELPPATH=\\\"/usr/local/share/texworks-help\\\" -DTW_PLUGINPATH=\\\"/usr/local/lib/texworks\\\"' \
'QMAKE_CXXFLAGS += -DTW_BUILD_ID=Fedora -DTW_HELPPATH=\\\"%{_docdir}/%{name}-%{version}/manual\\\" -DTW_PLUGINPATH=\\\"%{_libdir}/texworks\\\"'
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
# install Lua scripting plugin
pushd plugins-src/TWLuaPlugin/
make install INSTALL_ROOT=%{buildroot}
popd
# install Python scripting plugin
pushd plugins-src/TWPythonPlugin/
make install INSTALL_ROOT=%{buildroot}
popd
# install the main program
make install INSTALL_ROOT=%{buildroot}
# install extra documents
cp -p -R NEWS manual/ %{buildroot}%{_docdir}/%{name}-%{version}/
%clean
rm -rf %{buildroot}
%post
update-desktop-database &> /dev/null || :
%postun
update-desktop-database &> /dev/null || :
%files
%defattr(-,root,root,-)
%{_docdir}/%{name}-%{version}/
%{_bindir}/%{name}
%{_libdir}/%{name}/
%{_mandir}/man1/%{name}.1*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/*
%changelog
* Wed May 25 2011 Caolán McNamara <caolanm@redhat.com> - 0.4.0-3
- rebuild for new hunspell
* Wed Mar 30 2011 Dan Horák <dan[at]danny.cz> - 0.4.0-2
- fix build on non-x86 64-bit platforms
* Fri Mar 25 2011 Robin Lee <cheeselee@fedoraproject.org> - 0.4.0-1
- Update to 0.4.0
- Use uptream desktop entry file
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* 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