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
Version:        1.0.7.21
Release:        1
License:        GPLv2+
Summary:        A Structured WYSIWYG Scientific Text Editor
Group:          Productivity/Editors/Other
Url:            http://www.texmacs.org/
Source:         %{name}-%{version}-src.tar.bz2
## PATCH-OPENSUSE-FIX -- hunj@gmx.us - 22.02.2014 - Updated Patch
Patch0:         TeXmacs-fix_function_returns.patch
## PATCH-OPENSUSE-FIX -- hunj@gmx.us - 22.02.2014 - Updated Patch
Patch1:         TeXmacs-fix_arg_enable.patch
## PATCH-OPENSUSE-FIX -- hunj@gmx.us - 22.02.2014 - force guile1 (otherwise looks for guile now)
Patch2:         TeXmacs-fix_impose_guile1.patch
BuildRequires:  automake
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
Requires:       texlive
# 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:       pkgconfig(guile-1.8)
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:        GPLv2+
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
%patch0 -p1
%patch1 -p1
%patch2 -p1

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
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