From 13c468f34571dc64c06eff967b85a371d097e0e1 Mon Sep 17 00:00:00 2001 From: Robin Lee Date: Tue, 7 Jun 2011 02:30:06 +0800 Subject: [PATCH] - Include an upstreamed qmake configuration patch - Fix myspell path - Install the manual to path specified upstream --- texworks-0.4.1-qmake.patch | 86 ++++++++++++++++++++++++++++++++++++++ texworks.spec | 32 +++++++------- 2 files changed, 103 insertions(+), 15 deletions(-) create mode 100644 texworks-0.4.1-qmake.patch diff --git a/texworks-0.4.1-qmake.patch b/texworks-0.4.1-qmake.patch new file mode 100644 index 0000000..a15954e --- /dev/null +++ b/texworks-0.4.1-qmake.patch @@ -0,0 +1,86 @@ +Index: TeXworks.pro +=================================================================== +--- TeXworks.pro (revision 831) ++++ TeXworks.pro (revision 832) +@@ -51,6 +51,11 @@ + + unix:!macx { + TARGET = texworks ++ isEmpty(INSTALL_PREFIX):INSTALL_PREFIX = /usr/local ++ isEmpty(DATA_DIR):DATA_DIR = $$INSTALL_PREFIX/share ++ isEmpty(TW_HELPPATH):TW_HELPPATH = $$DATA_DIR/texworks-help ++ isEmpty(TW_PLUGINPATH):TW_PLUGINPATH = $$INSTALL_PREFIX/lib/texworks ++ isEmpty(TW_DICPATH):TW_DICPATH = /usr/share/myspell/dicts + } else { + TARGET = TeXworks + QMAKE_CXXFLAGS += -fexceptions +@@ -101,9 +106,9 @@ + + # Enclose the path in \\\" (which later gets expanded to \", which in turn + # gets expanded to " in the c++ code) +- QMAKE_CXXFLAGS += -DTW_HELPPATH=\\\"/usr/local/share/texworks-help\\\" +- QMAKE_CXXFLAGS += -DTW_PLUGINPATH=\\\"/usr/local/lib/texworks\\\" +- QMAKE_CXXFLAGS += -DTW_DICPATH=\\\"/usr/share/myspell/dicts\\\" ++ QMAKE_CXXFLAGS += -DTW_HELPPATH=\\\"$$TW_HELPPATH\\\" ++ QMAKE_CXXFLAGS += -DTW_PLUGINPATH=\\\"$$TW_PLUGINPATH\\\" ++ QMAKE_CXXFLAGS += -DTW_DICPATH=\\\"$$TW_DICPATH\\\" + } + + linux-g++ { +@@ -234,22 +239,22 @@ + trans/TeXworks_zh_CN.ts + + unix:!macx { # installation on Unix-ish platforms +- isEmpty(INSTALL_PREFIX):INSTALL_PREFIX = /usr/local + isEmpty(BIN_DIR):BIN_DIR = $$INSTALL_PREFIX/bin +- isEmpty(DATA_DIR):DATA_DIR = $$INSTALL_PREFIX/share + isEmpty(DOCS_DIR):DOCS_DIR = $$DATA_DIR/doc/texworks + isEmpty(ICON_DIR):ICON_DIR = $$DATA_DIR/pixmaps + isEmpty(MAN_DIR):MAN_DIR = $$DATA_DIR/man/man1 + isEmpty(DESKTOP_DIR):DESKTOP_DIR = $$DATA_DIR/applications + + target.path = $$BIN_DIR +- documentation.files = COPYING README ++ documentation.files = COPYING README NEWS + documentation.path = $$DOCS_DIR ++ manual.files = manual/* ++ manual.path = $$TW_HELPPATH + icon.files = res/images/TeXworks.png + icon.path = $$ICON_DIR + man.files = man/texworks.1 + man.path = $$MAN_DIR + desktop.files = texworks.desktop + desktop.path = $$DESKTOP_DIR +- INSTALLS = target documentation icon man desktop ++ INSTALLS = target documentation manual icon man desktop + } +Index: plugins-src/TWLuaPlugin/TWLuaPlugin.pro +=================================================================== +--- plugins-src/TWLuaPlugin/TWLuaPlugin.pro (revision 831) ++++ plugins-src/TWLuaPlugin/TWLuaPlugin.pro (revision 832) +@@ -48,7 +48,9 @@ + CONFIG += link_pkgconfig + PKGCONFIG += lua5.1 + +- target.path = /usr/local/lib/texworks ++ isEmpty(INSTALL_PREFIX):INSTALL_PREFIX = /usr/local ++ isEmpty(TW_PLUGINPATH):TW_PLUGINPATH = $$INSTALL_PREFIX/lib/texworks ++ target.path = $$TW_PLUGINPATH + INSTALLS += target + } + +Index: plugins-src/TWPythonPlugin/TWPythonPlugin.pro +=================================================================== +--- plugins-src/TWPythonPlugin/TWPythonPlugin.pro (revision 831) ++++ plugins-src/TWPythonPlugin/TWPythonPlugin.pro (revision 832) +@@ -58,7 +58,9 @@ + # QMAKE_CXXFLAGS += -DPy_UNICODE_WIDE + # PKGCONFIG += python3 + +- target.path = /usr/local/lib/texworks ++ isEmpty(INSTALL_PREFIX):INSTALL_PREFIX = /usr/local ++ isEmpty(TW_PLUGINPATH):TW_PLUGINPATH = $$INSTALL_PREFIX/lib/texworks ++ target.path = $$TW_PLUGINPATH + INSTALLS += target + } + diff --git a/texworks.spec b/texworks.spec index a78c639..1839e84 100644 --- a/texworks.spec +++ b/texworks.spec @@ -3,7 +3,7 @@ Name: texworks Version: 0.4.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A simple IDE for authoring TeX documents @@ -11,6 +11,8 @@ Group: Applications/Editors License: GPLv2+ URL: http://tug.org/texworks/ Source0: http://texworks.googlecode.com/files/%{name}-%{version}-r%{rev}.tar.gz +# Improve installation routines, applied in upstream svn832 +Patch0: texworks-0.4.1-qmake.patch BuildRequires: hunspell-devel BuildRequires: poppler-qt4-devel @@ -29,34 +31,32 @@ You may install the texlive-* packages to make this program useful. %prep %setup -q +%patch0 -p0 # 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 +%_qt4_qmake TW_PLUGINPATH=%{_libdir}/texworks make %{?_smp_mflags} popd # build Python scripting plugin pushd plugins-src/TWPythonPlugin/ -%_qt4_qmake +%_qt4_qmake TW_PLUGINPATH=%{_libdir}/texworks 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\\\"' + TW_PLUGINPATH=%{_libdir}/texworks \ + TW_DICPATH=%{_datadir}/myspell \ + -after \ + 'QMAKE_CXXFLAGS -= -DTW_BUILD_ID=personal' \ + 'QMAKE_CXXFLAGS += -DTW_BUILD_ID=Fedora' make %{?_smp_mflags} @@ -75,10 +75,6 @@ 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} @@ -91,6 +87,7 @@ update-desktop-database &> /dev/null || : %files %defattr(-,root,root,-) %{_docdir}/%{name}-%{version}/ +%doc %{_datadir}/texworks-help/ %{_bindir}/%{name} %{_libdir}/%{name}/ %{_mandir}/man1/%{name}.1* @@ -99,6 +96,11 @@ update-desktop-database &> /dev/null || : %changelog +* Tue Jun 7 2011 Robin Lee - 0.4.1-2 +- Include an upstreamed qmake configuration patch +- Fix myspell path +- Install the manual to path specified upstream + * Mon May 30 2011 Robin Lee - 0.4.1-1 - Update to 0.4.1 - Obsolete texworks-0.4.0-64bit.patch, since default qmake configuration works