File qwt.spec of Package qwt

#
# spec file for package qwt
#
# 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:           qwt
Version:        5.2.2
Release:        3
License:        Qwt License 1.0
Summary:        Qt Widgets for Technical Applications
Url:            http://qwt.sourceforge.net/
Group:          Development/Libraries/C and C++
Source:         %{name}-%{version}.tar.bz2
Source2:        %{name}-rpmlintrc
Source3:        %{name}-%{version}.pdf
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  fdupes
BuildRequires:  freetype2-devel
BuildRequires:  gcc-c++
BuildRequires:  libpng-devel
BuildRequires:  qt-devel

Requires:       libqwt5 = %{version}

%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 libqwt5


Summary:        Shared library for Qt Widgets
Group:          Development/Libraries/C and C++
Provides:       %{name} = %{version}
Obsoletes:      %{name} < %{version}

%description -n libqwt5
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:       %{name} = %{version}
Requires:       freetype2-devel
Requires:       gcc-c++
Requires:       libpng-devel
Requires:       qt-devel
Recommends:     %{name}-devel-doc
Recommends:     %{name}-devel-doc-pdf
Recommends:     %{name}-examples
Obsoletes:      libqwt5-devel < %{version}
Provides:       libqwt5-devel = %{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}
Requires:       qt-devel

%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.

%package devel-doc-pdf


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

%description devel-doc-pdf
This package contains the development documentation of the Qwt widgets
in pdf format.

%prep
%setup -q

%build
cp %{SOURCE3} ./
# 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
%makeinstall INSTALL_ROOT=%{buildroot}
# man
mkdir -p %{buildroot}/%{_mandir}
mv -v %{buildroot}/%{_docdir}/%{name}/devel-doc/man/man3 %{buildroot}/%{_mandir}/
# docu
mv -v examples %{buildroot}%{_docdir}/%{name}/
mkdir -p %{buildroot}%{_docdir}/%{name}/devel-doc-pdf
mv -v %{name}-%{version}.pdf  %{buildroot}%{_docdir}/%{name}/devel-doc-pdf/
# designer plugin
mkdir -p %{buildroot}/%{_libdir}/qt4/plugins/designer
mv -v %{buildroot}/%{_libdir}/libqwt_designer_plugin.so %{buildroot}/%{_libdir}/qt4/plugins/designer/
%fdupes %{buildroot}

%post -n libqwt5 -p /sbin/ldconfig

%postun -n libqwt5 -p /sbin/ldconfig

%clean
rm -rf %{buildroot}

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

%files designer
%defattr(-,root,root)
%{_libdir}/qt4/plugins/designer/libqwt_designer_plugin.so

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

%files examples
%defattr(-,root,root)
%dir %{_docdir}/%{name}
%{_docdir}/%{name}/examples

%files devel-doc-pdf
%defattr(-,root,root)
%dir %{_docdir}/%{name}
%{_docdir}/%{name}/devel-doc-pdf

%files devel-doc
%defattr(-,root,root)
%dir %{_docdir}/%{name}
%{_docdir}/%{name}/devel-doc

%changelog
openSUSE Build Service is sponsored by