File qwt.spec of Package qwt

#
# spec file for package qwt
#
# Copyright (c) 2012 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/
#


Name:           qwt
%define lname   libqwt5
Summary:        Qt Widgets for Technical Applications
License:        SUSE-QWT-1.0
Group:          Development/Libraries/C and C++
Version:        5.2.2
Release:        13.1.1
Url:            http://qwt.sourceforge.net/
Source:         http://switch.dl.sourceforge.net/sourceforge/qwt/qwt-%{version}.tar.bz2
Source2:        qwt-rpmlintrc
#Source3:        %{name}-%{version}.pdf
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  freetype2-devel
BuildRequires:  gcc-c++
BuildRequires:  libpng-devel

%if 0%{?mandriva_version} || 0%{?mdkversion}
BuildRequires:  libqt-devel
%else
BuildRequires:  qt-devel
%endif

%if 0%{?suse_version} >= 1100
BuildRequires:  fdupes
%endif

%description
The Qwt library contains GUI Components and utility classes which are
primarily useful for programs with a technical background. Beside a 2D
plot widget it provides scales, sliders, dials, compasses, thermometers,
wheels and knobs to control or display values, arrays, or ranges of type
double.

%package -n %{lname}
Summary:        Shared library for Qt Widgets
Group:          Development/Libraries/C and C++

%description -n %{lname}
This package contains the shared library to run Technical Applications
developed with/for qwt.

%package devel
Summary:        Include headers and Qt Designer plugin for Qwt
Group:          Development/Libraries/C and C++
Requires:       %{lname} = %{version}
Requires:       freetype2-devel
Requires:       gcc-c++
Requires:       libpng-devel
%if 0%{?mandriva_version} || 0%{?mdkversion}
Requires:       libqt-devel
%else
Requires:       qt-devel
%endif
%if 0%{?suse_version} >= 1100
Recommends:     %{name}-devel-doc
Recommends:     %{name}-examples
%endif
Obsoletes:      libqwt5-devel < %{version}
Provides:       libqwt5-devel = %{version}
Provides:       qwt = %{version}

%description devel
This package contains the header files of Qwt and its Qt designer plugin
in order to create Qt applications using the Qwt widgets.

%package examples
Summary:        Example programs using Qwt
Group:          Development/Libraries/C and C++
Requires:       %{name}-devel = %{version}
Obsoletes:      libqwt5-examples < %{version}
Provides:       libqwt5-examples = %{version}

%description examples
This package contains example programs demonstrating the Qwt widgets.

%package designer
Summary:        Plugin for the Qt Interface designer
Group:          Development/Tools/IDE
Requires:       %{name}-devel = %{version}
%if 0%{?mandriva_version} || 0%{?mdkversion}
Requires:       libqt-devel
%else
Requires:       qt-devel
%endif

%description designer
The %{name}-designer package contains the plugin for the Qt User Interface
designer tool.

%package devel-doc
Summary:        Development documentation for Qwt
Group:          Development/Libraries/C and C++
Requires:       %{name}-devel = %{version}
Obsoletes:      libqwt5-devel-doc < %{version}
Provides:       libqwt5-devel-doc = %{version}

%description devel-doc
This package contains the development documentation of the Qwt widgets
as is it created by doxygen.

%prep
%setup -q

%build
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
export PATH=%{_libdir}/qt4/bin/:$PATH
%endif
%if 0%{?mandriva_version} == 2008 || 0%{?mdkversion} == 200800
export PATH=/usr/lib/qt4/bin/:$PATH
%endif

# Now build the qwt5 library
qmake \
   INSTALLBASE=%{_prefix} \
   CONFIG+=QwtExamples CONFIG+=QwtSVGItem -after \
   QMAKE_CXXFLAGS="%{optflags}" \
   target.path=%{_libdir} \
   headers.path=%{_includedir}/%{name}5 \
   doc.path=%{_docdir}/%{name}-devel-doc

make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install INSTALL_ROOT=%{buildroot}
# man
mkdir -p %{buildroot}/%{_mandir}
mv -v %{buildroot}/%{_docdir}/%{name}-devel-doc/man/man3 %{buildroot}/%{_mandir}/
# docu
#install -m0644 %{SOURCE3} %{buildroot}%{_docdir}/%{name}-devel-doc/%{name}.pdf
# designer plugin
%if 0%{?mandriva_version} == 2008 || 0%{?mdkversion} == 200800
mkdir -p %{buildroot}/%{_prefix}/lib/qt4/plugins/designer
mv -v %{buildroot}/%{_libdir}/libqwt_designer_plugin.so %{buildroot}/%{_prefix}/lib/qt4/plugins/designer/
%else
mkdir -p %{buildroot}/%{_libdir}/qt4/plugins/designer
mv -v %{buildroot}/%{_libdir}/libqwt_designer_plugin.so %{buildroot}/%{_libdir}/qt4/plugins/designer/
%endif
%if 0%{?suse_version} >= 1100
%fdupes %{buildroot}
%endif

%post -n %{lname} -p /sbin/ldconfig

%postun -n %{lname} -p /sbin/ldconfig

%clean
rm -rf %{buildroot}

%files -n %{lname}
%defattr(-,root,root)
%doc CHANGES COPYING README
%{_libdir}/libqwt*.so.*

%files designer
%defattr(-,root,root)
%if 0%{?mandriva_version} == 2008 || 0%{?mdkversion} == 200800
%{_prefix}/lib/qt4/plugins/designer/libqwt_designer_plugin.so
%else
%if 0%{suse_version} < 1030
# directories not owned by a package:
%dir %{_libdir}/qt4
%dir %{_libdir}/qt4/plugins
%dir %{_libdir}/qt4/plugins/designer
%endif
%{_libdir}/qt4/plugins/designer/libqwt_designer_plugin.so
%endif

%files devel
%defattr(-,root,root)
%{_libdir}/libqwt*.so
%dir %{_includedir}/%{name}5
%{_includedir}/%{name}5/*.h

%files examples
%defattr(-,root,root)
%doc examples

%files devel-doc
%defattr(-,root,root)
%doc %{_docdir}/%{name}-devel-doc
%{_mandir}/man3/*

%changelog
* Tue Nov 20 2012 nico.kruber@gmail.com
- Fix the SLES build (%%make_install is not expanded on SLES)
* Wed Jun 20 2012 cfarrell@suse.com
- license update: SUSE-QWT-1.0
  SPDX format (or choose from list linked at license.opensuse.org)
* Wed Nov 30 2011 idoenmez@suse.de
- Add Provides for qwt package, no need for obsoletes since the base
  package never really existed.
- Simplify filelist
* Tue Nov 29 2011 Nico.Laus.2001@gmx.de
- removed dependency of the devel package to the (non-existing)
  base package
* Mon Nov 28 2011 idoenmez@suse.de
- Remove nearly empty qwt base package again
* Sat Nov 26 2011 chris@computersalat.de
- readd tests for other distributions
- cleanup doc files
  * mv pdf to devel-doc
  * mv man to devel-doc
- CHANGES, COPYING, README to qwt pkg
  * no extra files in libqwt5 pkg
- fix rpmlintrc file
- fix build for SLE_10
  * directories not owned by a package: %%{_libdir}/qt4/....
* Fri Oct 21 2011 mls@suse.de
- do not use /usr/src/packages in specfile
* Thu Aug  4 2011 toddrme2178@gmail.com
- Changed include dir from qwt to qwt5.
  This will make it more compatible with qwt6,
  which is out but not well-supported yet
- Removed build flags that are enabled by default.
- Added building of svg item support.
  This is needed by the bindings packages
- Cleaned up spec file formatting.
* Thu Aug  4 2011 toddrme2178@gmail.com
- updated to version 5.2.2
- add pdf documentation package
- remove tests for other distributions
- move contents of the "qwt" package into libqwt5
  it just had the license, readme, and changelog
- remove patch (enable-svg.diff) that is now included upstream
* Wed Apr 14 2010 koprok@nand.bg
- updated to version 5.2.1
- fix parallel make patch is not needed any more
* Fri Jan  1 2010 chris@computersalat.de
- spec mods
  o added header
  o cleanup
  o fixed fdupes deps >= 1100
  o replaced libqt4-devel >= 4.3 to qt-devel
  * Qwt 5.x might be usable in all environments where you find Qt.
    It is compatible with Qt 3.3.x and Qt 4.x
* Tue Nov 24 2009 koprok@nand.bg
- fix parallel make
* Sun Aug 30 2009 lars@linux-schulserver.de
- original taken from Education:Salome:Factory
- use the original name for the package and provide/obsolete
  the libqwt5* names
- use qmake vars instead of patching the sources
- split off designer package and put the lib to the right place
- added rpmlintrc
* Thu May  7 2009 Nico.Laus.2001@gmx.de
- made compile on Fedora, Mandriva
- removed unnecessary (Build)Requires
* Sun Mar 29 2009 Nico.Laus.2001@gmx.de
- updated to version 5.2.0
- changed config to enable QwtPlotSvgItem
* Tue Mar 24 2009 Nico.Laus.2001@gmx.de
- added sub-packages examples and devel-doc
- added documentation
  Fri May 16 00:00:00 CET 2008 - 0.pm.1
- rebuild for PackMan
* Wed Nov 21 2007 opensuse@dstoecker.de
- better installation
- some fixes
* Tue Jun 26 2007 opensuse@dstoecker.de
- updated to release 5.0.2
- now a openSUSE BuildService project
  Wed Jan 03 00:00:00 CET 2007 - Christian Härtwig 5.0.0
- updated to CVS20070103 (5.0.0)
- renamed package to libqwt5
- modified package to coexist together with libqwt-4.2.0 from Quentin Denis
- added examples to -devel package
  Mon Aug 28 00:00:00 CET 2006 - Christian Härtwig 5.0.0
- initial version CVS20060828 (5.0.0)
openSUSE Build Service is sponsored by