File python-qwt5.spec of Package python-qwt5

#
# spec file for package PyQwt5 (Version 5.2.1)
#
# created by Hans-Peter Jansen <hpj@urpla.net>
#
# Copyright (c) 2002-2010 LISA GmbH, Bingen, 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.

# norootforbuild

%define prjname PyQwt
# comment out cvsdate like this: #%%define if buiding a release
%define cvsdate 20100927-101816
%define cvs %{?cvsdate:-cvs%{cvsdate}}

# Generating the docs for a cvs build:
# * osc build
# osc build --no-verify -j8 KDE_Distro_Stable_openSUSE_11.1 i586 python-qwt5.spec
# * install
# zypper in /var/tmp/build-root/usr/src/packages/RPMS/i586/python-qwt5-{,devel-}5.2.1-1.i586.rpm
# * unpack tarball
# tar -xvjpf PyQwt-5.2.1-cvs20100927-101816.tar.bz2
# * build doc (needs python-sphinx, latex)
# pushd PyQwt-5.2.1-cvs20100927-101816/sphinx
# make html latex
# pushd build/latex
# make all-pdf
# popd
# popd
# * recreate archive
# tarbc PyQwt-5.2.1-cvs20100927-101816.tar.bz2 PyQwt-5.2.1-cvs20100927-101816
# * rebuild this rpm

Name:		python-qwt5
License:	GPLv2
Group:		Development/Libraries/Python
Summary:	Python bindings for Qwt (Qt Widgets for Technical applications)
Requires:       python-sip >= %( echo `rpm -q --queryformat '%{VERSION}' python-sip`)
Requires:       python-qt4 >= %( echo `rpm -q --queryformat '%{VERSION}' python-qt4`)
Requires:       libqwt5 >= %( echo `rpm -q --queryformat '%{VERSION}' libqt4-x11`)
Requires:	python-numpy python-numarray
BuildRequires:  libqt4-devel python-devel python-sip-devel python-qt4-devel libqwt5-devel
BuildRequires:  python-numpy-devel python-numarray fdupes
Version:	5.2.1
Release:	1
Source0:	%{prjname}-%{version}%{cvs}.tar.bz2
Patch0:         fix_numpy_import.diff
Patch1:         fix-qwt.patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-build
%py_requires
%if %suse_version <= 1110
%define python_sitelib %{py_sitedir}
%endif

%description

Requiress a set of Python bindings for the Qwt C++ class library which extends
the Qt framework with widgets for scientific and engineering applications. It
provides a widget to plot 2-dimensional data and various widgets to display and
control bounded or unbounded floating point values.

%{?cvsdate:This is packaged from CVS of %{cvsdate} UTC.}

Qwt Authors:
--------
    Uwe Rathmann
    Josef Wilgen

PyQwt Authors:
--------
    Gerard Vermeulen <gav451@gmail.com>
    Mark Colclough <m.s.colclough@bham.ac.uk>


%package devel
License:	GPLv2
Group:		Development/Libraries/Python
Summary:	Devel part of PyQwt (Qt Widgets for Technical applications)
Requires:	libqt4-devel python-devel python-sip-devel python-qt4-devel

%description devel

Requiress a set of Python bindings for the Qwt C++ class library which extends
the Qt framework with widgets for scientific and engineering applications. It
provides a widget to plot 2-dimensional data and various widgets to display and
control bounded or unbounded floating point values.

%{?cvsdate:This is packaged from CVS of %{cvsdate} UTC.}

Qwt Authors:
--------
    Uwe Rathmann
    Josef Wilgen

PyQwt Authors:
--------
    Gerard Vermeulen <gav451@gmail.com>
    Mark Colclough <m.s.colclough@bham.ac.uk>


%prep
%setup -q -n %{prjname}-%{version}%{cvs}
%patch0
%patch1 -p1

%build
pushd configure
# generate sip tracable code with debug symbols for Qt4
python configure.py --debug --qt4 -lqwt
make %{?jobs:-j %jobs}
popd

%install
pushd configure
make DESTDIR=$RPM_BUILD_ROOT INSTALL_ROOT=$RPM_BUILD_ROOT install
# compatibility symlink (sip files for debug package)
ln -s ../sip
popd
# tidying
chmod +x $RPM_BUILD_ROOT/%{py_sitedir}/PyQt4/Qwt5/{grace.py,qplt.py}
mv qt4examples examples
# doc
echo > README << EOF
The documentation for %{prjname} is located in package %{name}-devel.
EOF
# copy docs manually in order to let fdupes succeed
DOCDIR=$RPM_BUILD_ROOT/usr/share/doc/packages/%{name}-devel
mkdir -p $DOCDIR
test -d sphinx/build && {
    # move doc in place
    mv sphinx/build/* .
    rm -f html/.buildinfo
    mv latex/PyQwt.pdf .
    cp -pr PyQwt.pdf html latex $DOCDIR
}
cp -pr examples $DOCDIR
%fdupes $DOCDIR

%files
%defattr(-,root,root)
%doc ANNOUNCEMENT-%{version} COPYING* README
%dir %{py_sitedir}/PyQt4/Qwt5
%{py_sitedir}/PyQt4/Qwt5/*
%{py_sitedir}/PyQt4/uic

%files devel
%defattr(-,root,root)
/usr/share/doc/packages/python-qwt5-devel
%dir /usr/share/sip/PyQt4/Qwt5
/usr/share/sip/PyQt4/Qwt5/*

%changelog
openSUSE Build Service is sponsored by