File mingw64-grantlee5.spec of Package mingw64-grantlee5

#
# spec file for package mingw64-grantlee5
#
# Copyright (c) 2020 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


%bcond_with     tests

%{?!cmake_build:%global cmake_build() make %{?_smp_mflags} VERBOSE=1}
%{?!cmake_install:%global cmake_install() DESTDIR=%{buildroot} make install}

%define _name   grantlee5
Name:           mingw64-%{_name}
Version:        5.3.1
Release:        0
Summary:        Qt string template library
License:        LGPL-2.1-or-later
Group:          System/Libraries
URL:            http://grantlee.org/
Source:         http://www.grantlee.org/downloads/grantlee-%{version}.tar.gz
# PATCH-FIX-OPENSUSE includes.diff -- since upstream doesn't provide a way to install to custom directory, we cheat!
Patch0:         includes.diff
# PATCH-FIX-OPENSUSE grantlee-5.2.0-fix-ctest-ld-library-path.patch -- set ld library path for tests
Patch1:         grantlee-5.2.0-fix-ctest-ld-library-path.patch
BuildRequires:  mingw64-cross-cmake
BuildRequires:  mingw64-cross-gcc-c++
BuildRequires:  mingw64-kf5-filesystem
BuildRequires:  mingw64(cmake:Qt5Core) >= 5.3
BuildRequires:  mingw64(cmake:Qt5Gui) >= 5.3
BuildRequires:  mingw64(cmake:Qt5Qml) >= 5.3
%if %{with tests}
# BuildRequires:  /usr/bin/Xvfb
BuildRequires:  mingw64-cross-wine
BuildRequires:  mingw64(cmake:Qt5LinguistTools)
BuildRequires:  mingw64(cmake:Qt5Test) >= 5.3
%endif
%_mingw64_package_header_debug
BuildArch:      noarch

%description
Grantlee is a string template engine based on the Django template system and
written in Qt.

%package devel
Summary:        Include Files and Libraries Mandatory for Development with Grantlee
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       mingw64-cross-cmake
Requires:       mingw64(cmake:Qt5Core) >= 5.3
Requires:       mingw64(cmake:Qt5Gui) >= 5.3

%description devel
This package contains include files and libraries needed for development with
grantlee.

%_mingw64_debug_package

%prep
%autosetup -p1 -n grantlee-%{version}

%build
%_mingw64_cmake \
  %{!?with_tests:-DBUILD_TESTS:BOOL=OFF}

  %_mingw64_cmake_build

%install
%_mingw64_cmake_install

%if %{with tests}
%check
export CTEST_OUTPUT_ON_FAILURE=1
%_mingw64_cross_wine_run make test -C %{__builddir}
%endif


%files
%license COPYING.LIB
%doc AUTHORS CHANGELOG README*
%{_mingw64_bindir}/libGrantlee_TextDocument.dll
%{_mingw64_bindir}/libGrantlee_Templates.dll
%dir %{_mingw64_libdir}/grantlee/
%dir %{_mingw64_libdir}/grantlee/5.3
%{_mingw64_libdir}/grantlee/5.3/*.dll

%files devel
%license COPYING.LIB
%doc AUTHORS CHANGELOG README*
%{_mingw64_includedir}/grantlee5/
%{_mingw64_libdir}/libGrantlee_TextDocument.dll.a
%{_mingw64_libdir}/libGrantlee_Templates.dll.a
%{_mingw64_libdir}/cmake/Grantlee5/

%changelog
openSUSE Build Service is sponsored by