File gle-graphics.spec of Package gle-graphics

#
# spec file for package gle-graphics
#
# Copyright (c) 2011 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


Name:           gle-graphics
Version:        4.2.3b
Release:        3
Summary:        GLE is a graphics scripting language
Group:          Productivity/Graphics/Visualization/Graph
License:        BSD licence
Url:            http://www.gle-graphics.org/
Source:         http://prdownloads.sourceforge.net/glx/gle-graphics-%{version}f-src.tar.gz
Source1:        gle.vim
#Source2:    GLE-4.0.13-manual.pdf
Source3:        GLEusersguide.pdf
Source4:        makeani.pl
Source5:        bbox_gle.sh
Source6:        %{name}.xml
Source7:        qgle.desktop
Source1000:     gle-graphics-rpmlintrc
# PATCH-UPSTREAM: needs for build with gcc4.4 - was sent to upstream
Patch0:         gle-graphics-gcc44.patch
# use the QMAKE_LIB_DYNLOAD variable: suggested by Dirk
Patch1:         gle-graphics-qgle.pro.in.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  unzip
BuildRequires:  perl
BuildRequires:  c++_compiler
BuildRequires:  xorg-x11-libs
BuildRequires:  libpng-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libtiff-devel
BuildRequires:  ncurses-devel
BuildRequires:  libqt4-devel
BuildRequires:  cairo-devel
BuildRequires:  ghostscript-library
BuildRequires:  texlive-latex
BuildRequires:  dos2unix

%if %defined suse_version
BuildRequires:  update-desktop-files
%endif

Requires:       ghostscript
Requires:       perl
Requires:       lib%{name} = %{version}

# The old libgle-graphics package
Provides:       libgle-graphics = %{version}
Obsoletes:      libgle-graphics < %{version}
Provides:       libgle-graphics-4_1_1 = %{version}
Obsoletes:      libgle-graphics-4_1_1 < %{version}
Provides:       libgle-graphics-4_2_0 = %{version}
Obsoletes:      libgle-graphics-4_2_0 < %{version}

%if %defined suse_version
Suggests:       LaTeX
%endif

%description
GLE (Graphics Layout Engine) is a graphics scripting language designed for
creating publication quality graphs, plots, diagrams, figures and slides. GLE
supports various graph types (function plots, histograms, bar graphs, scatter
plots, contour lines, color maps, surface plots, ...) through a simple but
flexible set of graphing commands. More complex output can be created by
relying on GLE's scripting language, which is full featured with subroutines,
variables, and logic control. GLE relies on LaTeX for text output and supports
mathematical formulea in graphs and figures. GLE's output formats include EPS,
PS, PDF, JPEG, and PNG. GLE is licenced under the BSD license.

A suggested dependency is a LaTeX package.

%package -n qgle


Summary:        User interface for %{name}
Group:          Productivity/Graphics/Visualization/Graph
Requires:       %{name} = %{version}

%description -n qgle
QGLE, the GLE user interface, is licenced under the GPL license.

%package doc


Summary:        Documentation for %{name}
Group:          Documentation/Other

%description doc
User guide and reference manual for GLE

%prep
%setup -q

%patch0 -b .gcc44
%patch1 -p 1 -b .qgle.pro.in

cp %{SOURCE3} .

# wrong end of line encoding
dos2unix \
        gle-refman/utilities/fig/volcano.z \
        gle-refman/advanced/fig/join.gle \
        gle-refman/primitives/fig/gc_arrstyle.gle \
        gle-refman/appendix/fig/color_sample.gle \
        gle-refman/graph/fig/gc_loglabels.gle \
        gle-refman/prog/fig/axisformat.gle \
        src/samples/sample_compare.eps \
        src/samples/qgle_keyboard.gle 

%build
%{configure} \
  --with-extrafonts 
#make %{?_smp_mflags}
make 
make doc

cd src/samples/
make -f Makefile.gcc
find . -type 'd' -iname '.gle' | xargs rm -rf
rm Makefile.{os2,vc}
cd ..

%install
make DESTDIR=%{buildroot} install

rm -f %{buildroot}/%{_libdir}/pkgconfig/%{name}.pc
# will be handled via %doc in filelist
rm -rf %{buildroot}/%{_datadir}/doc/%{name}/

# vim syntax file
install -d -m755 %{buildroot}/%{_datadir}/vim/site/syntax/
install -m644 %{SOURCE1} %{buildroot}/%{_datadir}/vim/site/syntax/

# tools
install -d -m755 %{buildroot}/%{_bindir}
install -m755 %{SOURCE4} %{SOURCE5} %{buildroot}/%{_bindir}

# mime type
install -d -m 755 %{buildroot}%{_datadir}/mime/application
install -m 644 %{SOURCE6} %{buildroot}%{_datadir}/mime/application/%{name}.xml

# icon
install -d -m755 %{buildroot}/%{_datadir}/pixmaps/
install -m644 src/gui/images/gle.png %{buildroot}/%{_datadir}/pixmaps/qgle.png

# menu
%if %defined suse_version
%suse_update_desktop_file -i qgle
%endif

%post
if [ -f /usr/bin/update-mime-database ]; then
  /usr/bin/update-mime-database /usr/share/mime > /dev/null
fi

%postun
if [ -f /usr/bin/update-mime-database ]; then
  /usr/bin/update-mime-database /usr/share/mime > /dev/null
fi

%files
%defattr(-,root,root,0755)
%doc README.txt LICENSE.txt
%dir %{_datadir}/%{name}/
%dir %{_datadir}/%{name}/%{version}
%dir %{_datadir}/%{name}/%{version}/font
%dir %{_datadir}/%{name}/%{version}/gleinc
%{_bindir}/gle
%{_bindir}/glebtool
%{_bindir}/manip
%{_bindir}/makeani.pl
%{_bindir}/bbox_gle.sh
%{_datadir}/%{name}/%{version}/font/*
%{_datadir}/%{name}/%{version}/gleinc/*
%{_datadir}/%{name}/%{version}/glerc
%{_datadir}/vim/
%{_datadir}/%{name}/%{version}/init.tex
%{_datadir}/%{name}/%{version}/inittex.ini
%{_datadir}/%{name}/%{version}/manip.hlp
%{_mandir}/man1/gle.1.gz
%{_libdir}/libgle-graphics-%{version}.so

%files -n qgle
%defattr(-,root,root,0755)
%{_bindir}/qgle
%{_datadir}/applications/*
%{_datadir}/pixmaps/qgle.png
%{_datadir}/mime/application

%files doc
%defattr(-,root,root,0755)
%doc GLEusersguide.pdf gle-refman/gle-manual.pdf
%doc src/samples/

%changelog
openSUSE Build Service is sponsored by