File mingw32-aqbanking.spec of Package mingw32-aqbanking

#
# spec file for package mingw32-aqbanking
#
# 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/
#


%define          build_ebics 0
%define          build_ofx 1
%define          aq_plugindir   %{_mingw32_libdir}/aqbanking/plugins/35
%define          fronts_libdir  %{aq_plugindir}/frontends
%define          imex_plugindir %{aq_plugindir}/imexporters
%define          imex_datadir   %{_mingw32_datadir}/%{_name}/imexporters
%define          fronts_datadir %{_mingw32_datadir}/%{_name}/frontends
%define          qb_cfgmoddir   %{fronts_libdir}/qbanking/cfgmodules
%define          q4b_cfgmoddir  %{fronts_libdir}/q4banking/cfgmodules

%define _name   aqbanking
Name:           mingw32-%{_name}
Version:        5.8.1
Release:        0
Summary:        Library for Online Banking Functions and Financial Data Import and Export
License:        GPL-2.0-only or GPL-3.0-only
Group:          Productivity/Office/Finance
Url:            http://www.aquamaniac.de/aqbanking/
Source:         %{_name}-%{version}.tar.gz
Source1:        aqbanking4-handbook-20091231.pdf
Patch0:         0001-Fix-not-finding-typemaker2-on-cross-compiling-for-Wi.patch
Patch1:         0001-fix-tumbleweed-compile-error.patch
BuildRequires:  automake autoconf libtool
BuildRequires:  doxygen
BuildRequires:  mingw32-cross-gcc-c++
BuildRequires:  mingw32-cross-pkg-config
BuildRequires:  mingw32-gmp-devel
BuildRequires:  mingw32-gwenhywfar-devel >= 4.10.0
BuildRequires:  mingw32-gwenhywfar-tools >= 4.10.0
# required by kmymoney
Requires:       mingw32-libgwengui-cpp0 >= 4.10.0
Requires:       mingw32-libgwenhywfar60-plugins
BuildRequires:  mingw32-gwenhywfar-tools >= 4.10.0
# xmlmerge
BuildRequires:  gwenhywfar-tools
BuildRequires:  mingw32-ktoblzcheck-devel >= 1.10
BuildRequires:  mingw32-win_iconv-devel
BuildRequires:  mingw32-libintl-devel
BuildRequires:  mingw32-pkg-config
%if %build_ofx
BuildRequires:  mingw32-libofx-devel
%endif
%if %build_ebics
BuildRequires:  mingw32-libltdl-devel
BuildRequires:  mingw32-xmlsec1-gnutls-devel
%endif
Recommends:     %{name}-lang
%_mingw32_package_header_debug
BuildArch:      noarch

%description
AqBanking is a generic online banking interface. It allows multiple
back-ends (currently HBCI) and multiple front-ends (such as KDE, GNOME,
or console) to be used.

%package devel
Summary:        Library for Online Banking Functions and Financial Data Import/Export
License:        GPL-2.0-or-later
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       cmake
#Requires:       glibc-devel
Requires:       mingw32-gwenhywfar-devel >= 4.10.0
Requires:       mingw32-ktoblzcheck-devel
%if %build_ofx
Requires:       mingw32-libofx-devel
%endif

%description devel
AqBanking is a generic OnlineBanking interface. It allows multiple
backends (currently HBCI) and multiple frontends  (e.g. KDE, GNOME,
console) to be used.

%package doc
Summary:        Library for Online Banking Functions and Financial Data Import/Export
License:        SUSE-Free-Art-1.3
Group:          Productivity/Office/Finance
Requires:       %{name} = %{version}

%description doc
AqBanking is a generic OnlineBanking interface. It allows multiple
backends (currently HBCI) and multiple frontends  (e.g. KDE, GNOME,
console) to be used.

This package contains a handbook.

%if %build_ofx

%package ofx
Summary:        Library for Online Banking Functions and Financial Data Import/Export
License:        GPL-2.0-or-later
Group:          Productivity/Office/Finance
Requires:       %{name} = %{version}

%description ofx
AqBanking is a generic OnlineBanking interface. It allows multiple
backends (currently HBCI) and multiple frontends  (e.g. KDE, GNOME,
console) to be used.

%package -n mingw32-libaqofxconnect7
Summary:        Connector between Aqbanking and OFX
License:        GPL-2.0-only or GPL-3.0-only
Group:          Development/Libraries/C and C++

%description -n mingw32-libaqofxconnect7
Conncetor between Aqbanking and OFX. Necessary for OFX direct connect
access.

%endif

%if %build_ebics

%package ebics
Summary:        Library for Online Banking Functions and Financial Data Import/Export
License:        GPL-2.0-or-later
Group:          Productivity/Office/Finance
Requires:       %{name} = %{version}

%description ebics
AqBanking is a generic OnlineBanking interface. It allows multiple
backends (currently HBCI) and multiple frontends  (e.g. KDE, GNOME,
console) to be used.

%package -n mingw32-libaqebics0
Summary:        Connector between Aqbanking and EBICS
License:        GPL-2.0-only or GPL-3.0-only
Group:          Development/Libraries/C and C++

%description -n mingw32-libaqebics0
Conncetor between Aqbanking and EBICS. Necessary for EBICS access.

%endif

%lang_package

%_mingw32_debug_package

%prep
%setup -q -n %{_name}-%{version}
%patch -P 0 -p1
%patch -P 1 -p1

%build
BACKEND_LIST="aqhbci aqnone aqpaypal"
%if %build_ofx
BACKEND_LIST="$BACKEND_LIST aqofxconnect"
%endif
%if %build_ebics
BACKEND_LIST="$BACKEND_LIST aqebics"
%endif
# quick fix for $CPP being unset and configure failing to handle include dirs properly
CPP=`which cpp`
export CPP
echo "lt_cv_deplibs_check_method='pass_all'" >>%{_mingw32_cache}
autoreconf --force --install --symlink
%_mingw32_configure\
	--enable-release \
	--with-backends="$BACKEND_LIST"  \
	--enable-full-doc \
	--with-docpath=%{_mingw32_docdir}/%{_name} \
	--enable-gui-tests \
	--with-xmlmerge=/usr/bin/xmlmerge \
	--with-typemaker2-exe=/usr/bin/typemaker2 

make

%install
%_mingw32_makeinstall
mv %{buildroot}%{_mingw32_includedir}/aqpaypal %{buildroot}%{_mingw32_includedir}/%{_name}5/
%if %build_ebics
mv %{buildroot}%{_mingw32_includedir}/aqebics %{buildroot}%{_mingw32_includedir}/%{_name}5/
%endif
find %{buildroot} -type f -name "*.la" -delete -print
# Remove files that we'll have elsewhere
rm %{buildroot}%{_mingw32_datadir}/doc/%{_name}/{AUTHORS,COPYING,ChangeLog,README}
mv %{buildroot}%{_mingw32_datadir}/doc/aqhbci/aqhbci-tool/README README.aqhbci
mv %{buildroot}%{_mingw32_datadir}/doc/aqpaypal/aqpaypal-tool/README README.aqpaypal
%if %build_ebics
mv %{buildroot}%{_mingw32_datadir}/doc/aqebics/aqebics-tool/README README.aqebics
%endif
# Install the handbook
mkdir -p %{buildroot}/%{_mingw32_docdir}/%{_name}
%__install -m 644 %{S:1} %{buildroot}%{_mingw32_docdir}/%{_name}/aqbanking-handbook.pdf
%_mingw32_find_lang %{_name} || true
perl -pi -e 's,lib/libaqbanking.so,bin/libaqbanking-35.dll,g' %{buildroot}/%{_mingw32_libdir}/cmake/aqbanking-5.8/aqbanking-config.cmake

%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README TODO README.aqhbci README.aqpaypal
%dir %{_mingw32_docdir}/%{_name}
%exclude %{_mingw32_docdir}/%{_name}/%{_name}-handbook.pdf
### The original aqbanking files
%{_mingw32_bindir}/%{_name}-cli*.exe
%{_mingw32_bindir}/lib%{_name}*.dll
%dir %{aq_plugindir}/dbio
%{aq_plugindir}/dbio/dtaus*.dll
%{aq_plugindir}/dbio/swift*.dll
%{_mingw32_datadir}/%{_name}/aqbanking/
%{_mingw32_datadir}/%{_name}/bankinfo/
%{_mingw32_datadir}/%{_name}/dialogs/
%{_mingw32_datadir}/%{_name}/typemaker2/
%dir %{_mingw32_datadir}/%{_name}/backends
%dir %{aq_plugindir}/bankinfo
%{aq_plugindir}/bankinfo/*.dll
%{imex_plugindir}/ctxfile*.dll
%{imex_plugindir}/csv*.dll
%{imex_plugindir}/dtaus*.dll
%{imex_plugindir}/eri2*.dll
%{imex_plugindir}/openhbci1*.dll
%{imex_plugindir}/q43*.dll
%{imex_plugindir}/sepa*.dll
%{imex_plugindir}/swift*.dll
%{imex_plugindir}/xmldb*.dll
%{imex_plugindir}/yellownet*.dll
%{imex_datadir}/ctxfile
%{imex_datadir}/csv
%{imex_datadir}/dtaus
%{imex_datadir}/eri
%{imex_datadir}/eri2
%{imex_datadir}/openhbci1
%{imex_datadir}/q43
%{imex_datadir}/sepa
%{imex_datadir}/swift
%{imex_datadir}/xmldb/profiles/*
%{imex_datadir}/yellownet/profiles/*
### The aqhbci files
%{_mingw32_bindir}/aqhbci-tool4.exe
%{_mingw32_bindir}/libaqhbci*.dll
%{aq_plugindir}/providers/aqhbci*.dll
%{_mingw32_datadir}/%{_name}/backends/aqhbci
### The aqnone files
%{_mingw32_bindir}/libaqnone*.dll
%{aq_plugindir}/providers/aqnone*.dll
### The aqpaypal files
%{_mingw32_bindir}/aqpaypal-tool.exe
%{_mingw32_bindir}/libaqpaypal*.dll
%{aq_plugindir}/providers/aqpaypal*.dll
%{_mingw32_datadir}/%{_name}/backends/aqpaypal
%{aq_plugindir}/*/*.xml
## Directories
%dir %{_mingw32_libdir}/aqbanking
%dir %{_mingw32_libdir}/aqbanking/plugins
%dir %{aq_plugindir}
%dir %{aq_plugindir}/providers
%dir %{_mingw32_datadir}/%{_name}
%dir %{imex_plugindir}
%dir %{imex_datadir}
%dir %{imex_datadir}/xmldb
%dir %{imex_datadir}/xmldb/profiles
%dir %{imex_datadir}/yellownet
%dir %{imex_datadir}/yellownet/profiles
%if !%build_ofx
%{imex_datadir}/ofx
%endif

%files devel
%defattr(-,root,root)
### The aqbanking files
%{_mingw32_bindir}/%{_name}-config
%{_mingw32_includedir}/%{_name}5/
%{_mingw32_libdir}/cmake/%{_name}-5.8/
%{_mingw32_libdir}/libaqbanking*.dll.a
%{_mingw32_libdir}/libaqhbci*.dll.a
%{_mingw32_libdir}/libaqnone*.dll.a
%{_mingw32_libdir}/libaqpaypal*.dll.a
%if %build_ebics
%{_mingw32_libdir}/libaqebics*.dll.a
%endif
%{_mingw32_libdir}/pkgconfig/%{_name}.pc
%dir %{_mingw32_datadir}/aclocal
%{_mingw32_datadir}/aclocal/%{_name}.m4
### The aqhbci files
%{_mingw32_bindir}/hbcixml3.exe
# .dll.a files from sub-packages
%dir %{aq_plugindir}/bankinfo
%{aq_plugindir}/*/*.dll.a
%{imex_plugindir}/*.dll.a
%if %build_ofx
%{_mingw32_libdir}/libaqofxconnect*.dll.a
%endif

%files doc
%defattr(-,root,root)
%{_mingw32_docdir}/%{_name}/aqbanking-handbook.pdf

%files lang -f %{_name}.lang

%if %build_ofx

%files ofx
%defattr(-,root,root)
%{aq_plugindir}/providers/aqofxconnect*.dll
%{imex_plugindir}/ofx*.dll
%{imex_datadir}/ofx
%{_mingw32_datadir}/aqbanking/backends/aqofxconnect

%files -n mingw32-libaqofxconnect7
%defattr(-,root,root)
%{_mingw32_bindir}/libaqofxconnect*.dll

%endif

%if %build_ebics

%files ebics
%doc README.aqebics
%defattr(-,root,root)
%{_mingw32_bindir}/aqebics-tool.exe
%{aq_plugindir}/providers/aqebics.*
#%{imex_plugindir}/ebics.*
#%{imex_datadir}/ebics
%{_mingw32_datadir}/aqbanking/backends/aqebics

%files -n mingw32-libaqebics0
%defattr(-,root,root)
%{_mingw32_bindir}/libaqebics*.dll

%endif

%changelog
openSUSE Build Service is sponsored by