LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File TeXmacs.spec of Package TeXmacs (Project Publishing)

# Copyright (c) 8/2011 - now  open-slx GmbH <Sascha.Manns@open-slx.de>
# Copyright (c) 2009 - 7/2011 Sascha Manns <saigkill@opensuse.org>
# Copyright (c) 2008 - 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# # norootforbuild

%define build_qt 1

Name:           TeXmacs
Summary:        A Structured WYSIWYG Scientific Text Editor
Version:        1.0.7.16
Release:        1
License:        GPL v2 or later
Group:          Productivity/Editors/Other
Source:         %{name}-%{version}-src.tar.bz2
# PATCH-OPENSUSE-FIX -- pgajdos@suse.cz -12.1.2009
Patch5:         TeXmacs-makefile.patch
# PATCH-OPENSUSE-FIX -- saigkill@opensuse.org - 26.11.2010 - Rewritten Patch
Patch6:         TeXmacs-fix_function_returns_new.patch
# PATCH-OPENSUSE-FIX -- pth@suse.de 29.10.2010 
Patch7:         TeXmacs-library_order.patch
# PATCH-OPENSUSE-FIX -- Sascha.Manns@open-slx.de 21.09.2011 - Rewritten Patch
Patch8:         TeXmacs-fix_arg_enable.patch
# PATCH-OPENSUSE-FIX -- pth@suse.de 29.10.2010
Patch9:         TeXmacs-fix_tm_r.patch
BuildRequires:  fdupes
BuildRequires:  freetype2-devel
BuildRequires:  gcc-c++
BuildRequires:  ghostscript-devel
# guile-devel could perhaps be removed since only the 1.8 version is to be used, 
# but leaved here to be sure the build is also OK on systems where it is present
BuildRequires:  guile-devel
%if 0%{?suse_version} >= 1210
# for 12.1, need the update repo (done in meta information)
BuildRequires:  libguile1-devel
%endif
BuildRequires:  lzma
BuildRequires:  shared-mime-info
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-devel
%if %build_qt == 1
BuildRequires:  libqt4-devel
%endif
# guile could perhaps be removed since only the 1.8 version is to be used, 
# but leaved here to be sure the build is also OK on systems where it is present
Requires:       guile
# Requires:  guile1
Requires:       pkgconfig(guile-1.8)
Requires:       texlive
Url:            http://www.texmacs.org/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
GNU TeXmacs is a free scientific text editor, inspired by TeX and GNU
Emacs. The editor allows you to write structured documents via a
WYSIWYG (what-you-see-is-what-you-get) and user friendly interface. New
styles can be created by the user. The program implements high-quality
typesetting algorithms and TeX fonts, which help you to produce
professional looking documents.

The high typesetting quality still goes through for automatically
generated formulas, which makes TeXmacs suitable as an interface for
computer algebra systems. TeXmacs also supports the Guile/Scheme
extension language, so that you may customize the interface and write
your own extensions to the editor.

In the future, TeXmacs is planned to evolve towards a complete
scientific office suite, with spreadsheet capabilities, a technical
drawing editor, and a presentation mode.

%package examples
License:        GPL v2 or later
Summary:        A Structured WYSIWYG Scientific Text Editor
Group:          Productivity/Editors/Other

%description examples
GNU TeXmacs is a free scientific text editor, inspired by TeX and GNU
Emacs. The editor allows you to write structured documents via a
WYSIWYG (what-you-see-is-what-you-get) and user friendly interface. New
styles can be created by the user. The program implements high-quality
typesetting algorithms and TeX fonts, which help you to produce
professional looking documents.

The high typesetting quality still goes through for automatically
generated formulas, which makes TeXmacs suitable as an interface for
computer algebra systems. TeXmacs also supports the Guile/Scheme
extension language, so that you may customize the interface and write
your own extensions to the editor.

In the future, TeXmacs is planned to evolve towards a complete
scientific office suite, with spreadsheet capabilities, a technical
drawing editor, and a presentation mode.

%prep
%setup -q -n %{name}-%{version}-src
%patch5
%patch6 -p0
%patch7
%patch8
%patch9

rm -f config.cache

%build
%define configure_args_common --enable-optimize="%{optflags}" 
%define configure_args_qt --enable-qt --enable-qtpipes
%define configure_args_guile GUILE_CFLAGS="`pkg-config --static --cflags guile-1.8`" GUILE_LDFLAGS="`pkg-config --static --libs guile-1.8`" GUILE_DATA_PATH="`pkg-config --variable=datadir guile-1.8`" GUILE_VERSION="`pkg-config --modversion guile-1.8`"

autoreconf -f -i

%if %build_qt == 1
%define configure_args %{configure_args_common} %{configure_args_qt} %{configure_args_guile}
%else
%define configure_args %{configure_args_common} %{configure_args_guile}
%endif

%configure %{configure_args}
# make %{?jobs:-j%jobs}
# this the recommended way to use multiple jobs
make %{?_smp_mflags}

%install
%makeinstall STRIP=:
export GUILE_DATA_PATH=$(guile-config info pkgdatadir)
export GUILE_LOAD_PATH=$(find $GUILE_DATA_PATH -type d | grep ice-9)
mkdir -p %{buildroot}%{_datadir}/applications
mv %{buildroot}%{_datadir}/TeXmacs/misc/mime/*.desktop %{buildroot}%{_datadir}/applications
# These are already done by makeinstall => error
# mkdir -p %{buildroot}%{_datadir}/pixmaps
# ln -s %{_datadir}/TeXmacs/misc/pixmaps/TeXmacs.xpm %{buildroot}%{_datadir}/pixmaps
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/48x48/mimetypes
ln -s %{_datadir}/TeXmacs/misc/pixmaps/TeXmacs.xpm %{buildroot}%{_datadir}/icons/hicolor/48x48/mimetypes/gnome-mime-text-x-texmacs.xpm
# Convert GNOME MIME Info to Shared MIME Info
mkdir -p %{buildroot}%{_datadir}/application-registry
mv %{buildroot}%{_datadir}/TeXmacs/misc/mime/texmacs.applications %{buildroot}%{_datadir}/application-registry
mkdir -p %{buildroot}%{_datadir}/mime-info
mv %{buildroot}%{_datadir}/TeXmacs/misc/mime/texmacs.{keys,mime,xml} %{buildroot}%{_datadir}/mime-info
rmdir %{buildroot}%{_datadir}/TeXmacs/misc/mime
rmdir %{buildroot}%{_prefix}/lib/TeXmacs/lib
DESTDIR=%{buildroot} mime-info-to-mime
rm -r %{buildroot}%{_datadir}/application-registry %{buildroot}%{_datadir}/mime-info
chmod 755 %{buildroot}%{_datadir}/TeXmacs/langs/encoding/{scm-to-html.awk,ent-to-scm.awk}
rm %{buildroot}%{_includedir}/%{name}.h
rm %{buildroot}%{_datadir}/TeXmacs/LICENSE
mv %{buildroot}%{_datadir}/%{name}/plugins/octave/octave/{,dot}.octaverc
rm -r %{buildroot}%{_datadir}/%{name}/plugins/{maple/src.9,mathematica/src.lazy}
%suse_update_desktop_file texmacs Office WordProcessor
%fdupes -s %{buildroot}%{_datadir}/%{name}

# FIXME
# remove unneeded (really ?)  files 
# to avoid "Installed (but unpackaged) file(s) found:"
# There must a better way
rm %{buildroot}%{_datadir}/icons/gnome/scalable/apps/TeXmacs.svg
rm %{buildroot}%{_datadir}/icons/gnome/scalable/mimetypes/text-texmacs.svg
rm %{buildroot}%{_datadir}/mime/XMLnamespaces
rm %{buildroot}%{_datadir}/mime/aliases
rm %{buildroot}%{_datadir}/mime/generic-icons
rm %{buildroot}%{_datadir}/mime/globs
rm %{buildroot}%{_datadir}/mime/globs2
rm %{buildroot}%{_datadir}/mime/icons
rm %{buildroot}%{_datadir}/mime/magic
rm %{buildroot}%{_datadir}/mime/mime.cache
rm %{buildroot}%{_datadir}/mime/subclasses
rm %{buildroot}%{_datadir}/mime/text/x-texmacs.xml
rm %{buildroot}%{_datadir}/mime/treemagic
rm %{buildroot}%{_datadir}/mime/types
rm %{buildroot}%{_datadir}/mime/version


%clean
rm -rf %{buildroot}

%post
if test -x usr/bin/update-mime-database ; then
  usr/bin/update-mime-database usr/share/mime >/dev/null
fi

%postun
if test -x usr/bin/update-mime-database ; then
  usr/bin/update-mime-database usr/share/mime >/dev/null
fi

%files
%defattr(-, root, root)
%doc TeXmacs/COPYING LICENSE TeXmacs/README TeXmacs/TEX_FONTS
%{_bindir}/*
%{_prefix}/lib/TeXmacs
%{_datadir}/applications/*.desktop
# NOTE: Own directory - we do not want to depend on gnome-icon-theme
%{_datadir}/icons/hicolor
#%%{_datadir}/icons/hicolor/48x48/mimetypes/gnome-mime-text-x-texmacs.xpm
%{_datadir}/mime/packages/*.xml
%{_datadir}/pixmaps/*.xpm
%dir %{_datadir}/TeXmacs
%{_datadir}/TeXmacs/doc
%{_datadir}/TeXmacs/fonts
%{_datadir}/TeXmacs/langs
%{_datadir}/TeXmacs/misc
%{_datadir}/TeXmacs/packages
%{_datadir}/TeXmacs/plugins
%{_datadir}/TeXmacs/progs
%{_datadir}/TeXmacs/styles
%{_datadir}/TeXmacs/texts
%doc %{_mandir}/man?/*.*

%files examples
%defattr(-, root, root)
%{_datadir}/TeXmacs/examples

%changelog