File gwenhywfar.spec of Package gwenhywfar

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

%bcond_without qt4

%define	libversion	60
%define devversion 4.18
Name:           gwenhywfar
Version:        4.18.0
Release:        0
Summary:        Multiplatform helper library for other libraries
License:        GPL-2.0+ and LGPL-2.1+
Group:          System/Libraries
Url:            http://www.aqbanking.de/
Source:         %{name}-%{version}.tar.gz
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  gnutls-devel >= 3.0
BuildRequires:  gtk2-devel >= 1.4
BuildRequires:  libgcrypt-devel >= 1.2.0
BuildRequires:  libopenssl-devel
%if %{with qt4}
%if 0%{?suse_version} >= 1500
#!BuildIgnore:  libopenssl-1_0_0-devel
%endif
BuildRequires:  libqt4-devel
%endif
BuildRequires:  cmake(Qt5Concurrent)
BuildRequires:  cmake(Qt5Core)
BuildRequires:  cmake(Qt5DBus)
BuildRequires:  cmake(Qt5Gui)
BuildRequires:  cmake(Qt5Network)
BuildRequires:  cmake(Qt5OpenGL)
BuildRequires:  cmake(Qt5PrintSupport)
BuildRequires:  cmake(Qt5Sql)
BuildRequires:  cmake(Qt5Test)
BuildRequires:  cmake(Qt5Widgets)
BuildRequires:  cmake(Qt5Xml)
%if 0%{?fedora} == 15
BuildRequires:  fox-devel >= 1.6
%else
BuildRequires:  fox16-devel
%endif
# For doc graphs
BuildRequires:  graphviz
BuildRequires:  graphviz-gd
BuildRequires:  xorg-x11-fonts
Recommends:     lib%{name}%{libversion}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Gwenhywfar is a base library used to provide OS abstraction functions
for Linux, FreeBSD, OpenBSD, NetBSD, and Windows. It also includes some
often needed functions (for example, handling and parsing of
configuration files, reading and writingof XML files, and interprocess
communication).

%package tools
Summary:        Multiplatform Helper Library for Other Libraries - Tools
License:        GPL-2.0+ and LGPL-2.1+
Group:          System/Libraries
Requires:       lib%{name}%{libversion} = %{version}

%description tools
Gwenhywfar is a base library used to provide OS abstraction functions
for Linux, FreeBSD, OpenBSD, NetBSD, and Windows. It also includes
some often needed functions (for example, for handling and parsing of
configuration files, reading and writing of XML files, and interprocess
communication).

%package -n lib%{name}%{libversion}-plugins
Summary:        Multiplatform Helper Library for Other Libraries - Plugins
License:        LGPL-2.1+
Group:          System/Libraries
Requires:       %{name} = %{version}

%description -n lib%{name}%{libversion}-plugins
Gwenhywfar is a base library used to provide OS abstraction functions
for Linux, FreeBSD, OpenBSD, NetBSD, and Windows. It also includes
some often needed functions (for example, for handling and parsing of
configuration files, reading and writing of XML files, and interprocess
communication).

%package -n lib%{name}%{libversion}
Summary:        Multiplatform Helper Library for Other Libraries
License:        LGPL-2.1+
Group:          System/Libraries
Recommends:     %{name}-lang
Recommends:     lib%{name}%{libversion}-plugins = %{version}

%description -n lib%{name}%{libversion}
Gwenhywfar is a base library used to provide OS abstraction functions
for Linux, FreeBSD, OpenBSD, NetBSD, and Windows. It also includes
some often needed functions (for example, for handling and parsing of
configuration files, reading and writing of XML files, and interprocess
communication).

%package -n libgwengui-cpp0
Summary:        C++ interface for Gwenhywfar
License:        GPL-2.0+ and LGPL-2.1+
Group:          System/Libraries

%description -n libgwengui-cpp0
This package contains the C++ GUI interface for Gwenhywfar.

%package -n libgwengui-gtk2-0
Summary:        Multiplatform Helper Library for Other Libraries -- GTK+ UI Backend
License:        LGPL-2.1+
Group:          System/Libraries

%description -n libgwengui-gtk2-0
Gwenhywfar is a base library used to provide OS abstraction functions
for Linux, FreeBSD, OpenBSD, NetBSD, and Windows. It also includes
some often needed functions (for example, for handling and parsing of
configuration files, reading and writing of XML files, and interprocess
communication).

This package provides the GTK+ implementation of the generic UI toolkit.

%package -n libgwengui-qt4-0
Summary:        Multiplatform Helper Library for Other Libraries -- Qt4 UI Backend
License:        LGPL-2.1+
Group:          System/Libraries

%description -n libgwengui-qt4-0
Gwenhywfar is a base library used to provide OS abstraction functions
for Linux, FreeBSD, OpenBSD, NetBSD, and Windows. It also includes
some often needed functions (for example, for handling and parsing of
configuration files, reading and writing of XML files, and interprocess
communication).

This package provides the Qt4 implementation of the generic UI toolkit.

%package -n libgwengui-qt5-0
Summary:        Multiplatform Helper Library for Other Libraries -- Qt5 UI Backend
License:        LGPL-2.1+
Group:          System/Libraries

%description -n libgwengui-qt5-0
Gwenhywfar is a base library used to provide OS abstraction functions
for Linux, FreeBSD, OpenBSD, NetBSD, and Windows. It also includes
some often needed functions (for example, for handling and parsing of
configuration files, reading and writing of XML files, and interprocess
communication).

This package provides the Qt5 implementation of the generic UI toolkit.

%package -n libgwengui-fox16-0
Summary:        FOX interface for Gwenhywfar
License:        GPL-2.0+ and LGPL-2.1+
Group:          System/Libraries

%description -n libgwengui-fox16-0
This package contains the interface to the FOX toolkit
for Gwenhywfar.

%package devel
Summary:        Multi-Platform Helper Library for Other Libraries
License:        LGPL-2.1+
Group:          Development/Libraries/C and C++
Requires:       glibc-devel
Requires:       lib%{name}%{libversion} = %{version}
Requires:       libgwengui-fox16-0 = %{version}
Requires:       libgwengui-gtk2-0 = %{version}
%if %{with qt4}
Requires:       libgwengui-qt4-0 = %{version}
%endif
Requires:       libgwengui-qt5-0 = %{version}

%description devel
Gwenhywfar is a base library used to provide OS abstraction functions
for Linux, FreeBSD, OpenBSD, NetBSD, and Windows. It also includes
some often needed functions (e.g. for handling and parsing of
configuration files, reading/writing of XML files, interprocess
communication etc).

%lang_package
%prep
%setup -q

%build
export PATH=%{_libqt5_bindir}:$PATH
# quick fix for $CPP being unset and configure failing to handle include dirs properly
CPP=`which cpp`
export CPP
%configure\
	--enable-release\
	--enable-full-doc\
	--with-docpath=%{_docdir}/%{name}/api \
	--disable-static \
%if %{with qt4}
	--with-qt4-libs=%{_libdir} \
	--with-guis="fox16 qt4 qt5 gtk2" \
%else
	--with-guis="fox16 qt5 gtk2" \
%endif
	--with-plugins-cfgmgr=all \
	--with-pic
%__make %{?smp_mflags}
%__make srcdoc %{?smp_mflags}

%install
%makeinstall
%makeinstall install-srcdoc
pushd %{buildroot}%{_docdir}/%{name}/api
    # we don't want another 'gwenhywfar' dir below docpath
    %__mv %{name}/* ./
    rm -rf %{name}
    # remove empty files
    `find -maxdepth 1 -type f -empty -print0 | xargs -0 echo %__rm -f`
popd
find %{buildroot} -type f -name "*.la" -delete -print
%find_lang %{name}
%fdupes %{buildroot}%{_datadir}/%{name}/apidoc

%clean
rm -rf %{buildroot}

%post -n lib%{name}%{libversion} -p /sbin/ldconfig

%postun -n lib%{name}%{libversion} -p /sbin/ldconfig

%post -n libgwengui-cpp0 -p /sbin/ldconfig

%postun -n libgwengui-cpp0 -p /sbin/ldconfig

%post -n libgwengui-gtk2-0 -p /sbin/ldconfig

%postun -n libgwengui-gtk2-0 -p /sbin/ldconfig

%if %{with qt4}
%post -n libgwengui-qt4-0 -p /sbin/ldconfig

%postun -n libgwengui-qt4-0 -p /sbin/ldconfig
%endif

%post -n libgwengui-fox16-0 -p /sbin/ldconfig

%postun -n libgwengui-fox16-0 -p /sbin/ldconfig

%files
%defattr (-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README TODO
%dir %{_datadir}/%{name}/
%{_datadir}/%{name}/ca-bundle.crt
%{_datadir}/%{name}/dialogs/
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/plugins
%dir %{_libdir}/%{name}/plugins/%{libversion}
%exclude %{_docdir}/%{name}/api

%files tools
%defattr (-, root, root)
%{_bindir}/gct-tool
%{_bindir}/gsa
%{_bindir}/mklistdoc
%{_bindir}/typemaker
%{_bindir}/typemaker2
%{_bindir}/xmlmerge
%{_datadir}/%{name}/typemaker2/

%files -n lib%{name}%{libversion}-plugins
%defattr (-, root, root)
%{_libdir}/%{name}/plugins/%{libversion}/*

%files -n lib%{name}%{libversion}
%defattr (-,root,root)
%{_libdir}/lib%{name}.so.*

%files -n libgwengui-cpp0
%defattr (-,root,root)
%{_libdir}/libgwengui-cpp.so.*

%files -n libgwengui-gtk2-0
%defattr (-, root, root)
%{_libdir}/libgwengui-gtk2.so.*

%if %{with qt4}
%files -n libgwengui-qt4-0
%defattr (-, root, root)
%{_libdir}/libgwengui-qt4.so.*
%endif

%files -n libgwengui-qt5-0
%defattr (-, root, root)
%{_libdir}/libgwengui-qt5.so.*

%files -n libgwengui-fox16-0
%defattr (-,root,root)
%{_libdir}/libgwengui-fox16.so.*

%files devel
%defattr (-, root, root)
%{_bindir}/%{name}-config
%dir %{_datadir}/aclocal
%{_datadir}/aclocal/%{name}.m4
%doc %{_docdir}/%{name}/api/
%{_includedir}/%{name}4/
%{_libdir}/*.so
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/pkgconfig/gwengui-gtk2.pc
%if %{with qt4}
%{_libdir}/pkgconfig/gwengui-qt4.pc
%{_libdir}/cmake/gwengui-qt4-%{devversion}
%endif
%{_libdir}/pkgconfig/gwengui-qt5.pc
%{_libdir}/pkgconfig/gwengui-fox16.pc
%dir %{_libdir}/cmake
%{_libdir}/cmake/%{name}-%{devversion}
%{_libdir}/cmake/gwengui-cpp-%{devversion}
%{_libdir}/cmake/gwengui-qt5-%{devversion}

%files lang -f %{name}.lang

%changelog