File texmacs.spec of Package texmacs

Name: texmacs
Version: #VERSION#
Release: 1
Summary: A structured wysiwyg scientific text editor

Group: Applications/Editors
License: GPL-3.0-or-later
URL: https://www.texmacs.org
Source: %{name}-%{version}.tar.gz
%if  0%{?is_opensuse}
Source1: %{name}-rpmlintrc
%endif

Patch0: my_current.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}

Packager: Denis Raux <raux@texmacs.org>
Distribution: GNU/Linux
Vendor: MaGiX software association

%define mypatch %{_sourcedir}/my_current.patch

%global _debugsource_packages 0
%global _debuginfo_subpackages 0 
%global debug_package %{nil} 

# for Fedora > 30
%undefine __brp_mangle_shebangs

# avoid python script compiling
%global __os_install_post %{nil}

%if 0%{?suse_version} == 0
Buildrequires: perl-core
%endif
Buildrequires: gcc-c++,libtool-ltdl-devel,ghostscript-devel,glib2-devel
Buildrequires: gmp-devel,shared-mime-info,git,xdg-utils,chrpath
%if 0%{?suse_version} || 0%{?sle_version} 
Buildrequires: update-desktop-files,libguile1-devel
%else
%if 0%{?scientificlinux_version} == 600
Buildrequires: desktop-file-utils,guile-devel
%else
Buildrequires: desktop-file-utils,compat-guile18-devel
%endif
%endif
BuildRequires:	-post-build-checks 
%{?fedora:Buildrequires: libffi-devel}
%{?fedora:Buildrequires: redhat-rpm-config}

# Python Version
%if 0%{?scientificlinux_version} == 600 || 0%{?centos_version} == 600 
Buildrequires: python2-devel
%else
%if 0%{?centos_version} == 800
Buildrequires: platform-python-devel
%else
Buildrequires: python3-devel
%endif
%endif

#Qt version
%if  0%{?is_opensuse}  && (0%{?sle_version} == 150200 || 0%{?sle_version} == 150100 || 0%{?sle_version} == 120200 || 0%{?sle_version} == 120300)
Buildrequires: libqt4-devel
%else
%if 0%{?centos_version} == 800 || 0%{?fedora} >= 36
Buildrequires: qt5-qtbase-devel qt5-qtsvg-devel
%else
# Suse tumbledweed
%if 0%{?suse_version} > 1500
Buildrequires: libQt5Gui-devel libQt5Core-devel libQt5Widgets-devel libQt5PrintSupport-devel libqt5-qtsvg-devel glibc-devel
%else
%if 0%{?is_opensuse}  && (0%{?sle_version} == 150300 || 0%{?sle_version} == 150400)
Buildrequires: libQt5Gui-devel libQt5Core-devel libQt5Widgets-devel libQt5PrintSupport-devel libqt5-qtsvg-devel glibc-devel
%else
%if 0%{?debian_version} >= 1100
Buildrequires: qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
%else
Buildrequires: qt4-devel >= 4.6
%endif
%endif
%endif
%endif
%endif

#freetype

%if 0%{?is_opensuse}  && (0%{?sle_version} == 150300 || 0%{?sle_version} == 150400)
Buildrequires:  freetype2-devel
%else
%if 0%{?suse_version} > 1500
Buildrequires:  freetype2-devel
%else
Buildrequires: freetype-devel
%endif
%endif

%if 0%{?rhel}
#centos includes rhel tag
%define _mandir  %{_prefix}/share/man
%{?scientificlinux_version:Buildrequires: libjpeg-turbo-devel} 
%if %{rhel} == 7
Buildrequires: libffi-devel,libpng-devel
%endif
%endif

%if  0%{?is_opensuse}
Requires: guile1
%endif

%description

GNU TeXmacs is a free wysiwyw (what you see is what you want) editing
platform with special features for scientists. The software aims to provide
a unified and user friendly framework for editing structured documents with
different types of content (text, graphics, mathematics, interactive content,
etc.). The rendering engine uses high-quality typesetting algorithms so as to
produce professionally looking documents, which can either be printed out
or presented from a laptop.

The software includes a text editor with support for mathematical formulas,
a small technical picture editor and a tool for making presentations from
a laptop. Moreover, TeXmacs can be used as an interface for many external
systems for computer algebra, numerical analysis, statistics, etc.
New presentation styles can be written by the user and new features can be

added to the editor using the Scheme extension language. A native spreadsheet
and tools for collaborative authoring are planned for later.

TeXmacs runs on all major Unix platforms and Windows. Documents can be
saved in TeXmacs, Xml or Scheme format and printed as Postscript or
Pdf files. Converters exist for TeX/LaTeX and Html/Mathml.

%prep
%setup -q -n %{name}-%{version}
#%patch1 -p1

%{echo: LIBDIR %{_libdir} : %{_libexecdir} : %{_datadir} "\n"}
##global _libexecdir %{_prefix}/libexec
%{echo: LIBDIR %{_libdir} : %{_libexecdir} "\n"}

%build
#autoreconf
git --work-tree=. apply %{mypatch}

CXXFLAGS=-fPIE LDFLAGS="-pthread -ldl -fPIE -Wl,--copy-dt-needed-entries" ./configure --prefix=%{_prefix} --libdir="%_libdir" --libexecdir="%{_libexecdir}"
CXXFLAGS=-fPIE LDFLAGS="-pthread -ldl -fPIE -Wl,--copy-dt-needed-entries" make %{_smp_mflags} TEXMACS

%install
export XDG_UTILS_INSTALL_MODE=system
#rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
chrpath --delete %{buildroot}%{_libexecdir}/TeXmacs/bin/texmacs.bin
mkdir -p %{buildroot}%{_datadir}/mime/packages &&
	cp TeXmacs/misc/mime/texmacs.xml %{buildroot}%{_datadir}/mime/packages/
%if 0%{?suse_version}|| 0%{?sle_version} 
%suse_update_desktop_file -i texmacs
%else
desktop-file-install --dir=%{buildroot}%{_datadir}/applications TeXmacs/misc/mime/texmacs.desktop
%endif

%files
%defattr(-,root,root)
%{_bindir}/fig2ps
%{_bindir}/texmacs
%{_includedir}/TeXmacs.h

%doc
%doc %{_mandir}/man1/fig2ps.1.gz
%doc %{_mandir}/man1/texmacs.1.gz
%{_libexecdir}
##{_libdir}
%doc %{_datadir}/TeXmacs/examples
%doc %{_datadir}/TeXmacs/doc
%doc %{_datadir}/TeXmacs/LICENSE
%doc %{_datadir}/TeXmacs/texts



%{_datadir}/icons/hicolor/*/*/*texmacs*
/usr/share/pixmaps/TeXmacs.xpm
/usr/share/applications/texmacs.desktop
/usr/share/mime/packages/texmacs.xml
%dir %{_datadir}/TeXmacs
##{_datadir}/TeXmacs/bin
%{_datadir}/TeXmacs/fonts
%{_datadir}/TeXmacs/langs
%{_datadir}/TeXmacs/packages
%{_datadir}/TeXmacs/misc
%{_datadir}/TeXmacs/plugins
%{_datadir}/TeXmacs/progs
%{_datadir}/TeXmacs/styles



%changelog

* Fri Jun 28 2019   Joris van der Hoeven <vdhoeven@texmacs.org>
- Many bug fixes
- Extended Css stylability when exporting to Html
- Drag and drop for images
- Unification of beamer and poster styles, work in progress
- Automatic retrieval of artwork from texmacs.org
- New background patterns and pictures
- Experimental pattern effects
- Experimental Sparkle support under MacOS
- Experimental and partial support for Git as a versioning tool
- Experimantal Graph plug-in for graphs drawn by various external tools
- User interface for new features in educational styles

openSUSE Build Service is sponsored by