File python-veusz.spec of Package python-veusz

#
# spec file for package python-veusz
#
# Copyright (c) 2016 SUSE LINUX 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/
#


%define appname veusz
%define         X_display         ":98"
%{?_sip_api:Requires: sip-api(%{_sip_api_major}) >= %{_sip_api}}
Name:           python-veusz
Version:        1.24
Release:        0
Summary:        Scientific plotting library for Python
License:        GPL-2.0+ and Python-2.0
Group:          Productivity/Scientific/Other
# The entire source code is GPL-2.0+ except helpers/src/_nc_cntr.c which is Python-2.0
Url:            http://home.gna.org/veusz/
Source0:        http://download.gna.org/veusz/veusz-%{version}.tar.gz
BuildRequires:  desktop-file-utils
BuildRequires:  fdupes
BuildRequires:  libqt4-devel
BuildRequires:  python-devel
BuildRequires:  python-h5py
BuildRequires:  python-numpy-devel
BuildRequires:  python-qt4-devel
BuildRequires:  python-setuptools
BuildRequires:  python-sip
Requires:       python-h5py
Requires:       python-numpy
Requires:       python-qt4
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Veusz is a scientific plotting package, designed to create
publication-ready Postscript/PDF/SVG output. It features GUI,
command-line, and scripting interfaces. Graphs are constructed from
widgets, allowing complex layouts to be designed. Veusz supports
plotting functions, data with errors, keys, labels, stacked plots,
multiple plots, contours, shapes and fitting data.

This package provides only the python module needed for
scripting using python.

%prep
%setup -q -n veusz-%{version}
find -name \*~ | xargs rm -f

%build
CFLAGS="%{optflags}"
python setup.py build

%install
python setup.py install -O1 --skip-build --prefix="%{_prefix}" \
                                              --root=%{buildroot}

# Mark some scripts as executable.
# This isn't really needed, but Veusz includes shebangs in scripts
# so that they can be run when not installed.
# Do this so that the scripts don't need modification.
chmod +x %{buildroot}%{python_sitearch}/veusz/veusz_main.py
chmod +x %{buildroot}%{python_sitearch}/veusz/veusz_listen.py

install -m0644 COPYING %{buildroot}%{python_sitearch}/veusz/

%fdupes -s %{buildroot}%{python_sitearch}
%fdupes %{buildroot}%{_datadir}/pixmaps/%{appname}/

# CLEAN-UP __pycache__ DIRS CONTAINING OBJECT FILES LEFT BY %%check WITHOUT THE CORRESPONDING SOURCES
rm -fr %{buildroot}%{python3_sitearch}/veusz/*/__pycache__
rm -fr %{buildroot}%{python3_sitearch}/veusz/__pycache__

# Drop GUI binaries, install python3-veusz for the GUI application instead
rm %{buildroot}%{_bindir}/%{appname}
rm %{buildroot}%{_bindir}/%{appname}_listen

%files
%defattr(-,root,root)
%doc README AUTHORS COPYING ChangeLog
%doc Documents/manual.html
%doc Documents/manimages/
%{python_sitearch}/veusz-%{version}-py*.egg-info
%{python_sitearch}/veusz/

%changelog
openSUSE Build Service is sponsored by