File xmgrace.spec of Package xmgrace

#
# spec file for package xmgrace (Version 5.1.22)
#
# Copyright (c) 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


Name:           xmgrace
BuildRequires:  libpng-devel libtiff-devel openmotif openmotif-devel t1lib-devel update-desktop-files xorg-x11
License:        PERMISSIVE-OSI-COMPLIANT ; BSD 3-clause (or similar) ; GPL v2 or later ; LGPL v2.1 or later
Group:          Productivity/Graphics/Visualization/Graph
AutoReqProv:    on
Version:        5.1.22
Release:        1
Summary:        A 2D-Plot-Program for Visualisation of Scientific Data
Source:         ftp://ftp.fu-berlin.de/unix/graphics/grace/src/grace-%{version}.tar.bz2
Source1:        %name.desktop
Source2:        xmgrace.png
Patch0:         xmgrace-null.patch
Patch1:         xmgrace-strip.patch
Patch2:         xmgrace-help.patch
Url:            http://plasma-gate.weizmann.ac.il/Grace/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Grace is a WYSIWYG 2D plotting tool for the X Window System and M*tif.
Grace is a descendant of ACE/gr, also known as Xmgr. It knows a lot of
different graph types and supports a lot of output formats.

For examples, see /usr/lib/xmgrace/examples.



Authors:
--------
    Paul J. Turner <pturner@teleport.com>
    GRACE Development Team, maintained by
    Evgeny Stambulchik <fnevgeny@plasma-gate.weizmann.ac.il>

%package devel
License:        PERMISSIVE-OSI-COMPLIANT ; BSD 3-clause (or similar) ; GPL v2 or later ; LGPL v2.1 or later
Group:          Productivity/Graphics/Visualization/Graph
Summary:        Grace library

%description devel
Grace is a WYSIWYG 2D plotting tool for the X Window System and M*tif.
Grace is a descendant of ACE/gr, also known as Xmgr. It knows a lot of
different graph types and supports a lot of output formats. This devel
package contains a library to work with grace from other applications.

For further information consult the main package.

%prep
%setup -n grace-%{version}
%patch0 -p0
%patch1 
%patch2

%build
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=/usr/%{_lib} --enable-grace-home=/usr/%{_lib}/xmgrace --bindir=/usr/bin --with-helpviewer="/usr/bin/desktop-launch %s" --mandir=%{_mandir}
make

%install
# rm -rf %{_defaultdocdir}/xmgrace
# rm -rf /usr/%{_lib}/xmgrace
make DESTDIR=$RPM_BUILD_ROOT install
make DESTDIR=$RPM_BUILD_ROOT install links
mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xmgrace
rm -rf $RPM_BUILD_ROOT/usr/man
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1
rm -f $RPM_BUILD_ROOT/usr/share/man/man1/*.1
mv $RPM_BUILD_ROOT/usr/%{_lib}/xmgrace/doc/*.1 $RPM_BUILD_ROOT/usr/share/man/man1
mv $RPM_BUILD_ROOT/usr/%{_lib}/xmgrace/doc $RPM_BUILD_ROOT/%{_defaultdocdir}/xmgrace
%if "%{_lib}" == "lib64"
mv $RPM_BUILD_ROOT/usr/lib/libgrace_np.a $RPM_BUILD_ROOT/usr/%{_lib}
%endif
cp CHANGES COPYRIGHT ChangeLog DEVELOPERS LICENSE README $RPM_BUILD_ROOT/%{_defaultdocdir}/xmgrace
install -dm 755 $RPM_BUILD_ROOT/%{_datadir}/pixmaps
install %{SOURCE2} -m 644 $RPM_BUILD_ROOT/%{_datadir}/pixmaps
install -dm 755 $RPM_BUILD_ROOT%{_datadir}/applications/
install %{SOURCE1} -m 644 $RPM_BUILD_ROOT%{_datadir}/applications/
%suse_update_desktop_file -r $RPM_BUILD_ROOT%{_datadir}/applications/xmgrace.desktop Edutainment Math

%files
%defattr(-,root,root)
%doc %{_defaultdocdir}/xmgrace
%doc /usr/share/man/man1/*
# %{_defaultdocdir}/xmgrace
%{_libdir}/xmgrace
%{_bindir}/gracebat
%{_bindir}/xmgrace
%{_bindir}/grace
%{_datadir}/applications/*.desktop
%{_datadir}/pixmaps/*png

%files -n xmgrace-devel
%defattr(-,root,root)
%{_includedir}/grace_np.h
%{_libdir}/libgrace_np.a

%changelog
openSUSE Build Service is sponsored by