File xflr5.spec of Package xflr5

#
# spec file for package xflr5
#
# Copyright (c) 2024 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 http://bugs.opensuse.org/
#


Name:           xflr5
Version:        6.61
Release:        0
%define snapshot_name xflr5-code-r1488-tags-v6.61-xflr5
Summary:        Analysis tool for airfoils and planes operating at low Re numbers
License:        GPL-2.0
Group:          Productivity/Scientific/Other
URL:            http://www.xflr5.tech/xflr5.htm
# Source code only available as SVN snapshot from sourceforge
Source0:        https://sourceforge.net/code-snapshots/svn/x/xf/xflr5/code/%{snapshot_name}.zip
Source1:        %{name}.desktop

BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  libQt5Concurrent-devel
BuildRequires:  libQt5OpenGL-devel
BuildRequires:  libQt5Xml-devel
BuildRequires:  libqt5-linguist
BuildRequires:  unzip
# Disable aarch64, code uses GL_LINE_STIPPLE (not available on GLES)
ExcludeArch:    aarch64

%description
XFLR5 is a design tool intended for the design and analysis of reduced scaled model airplanes.
It includes the XFoil program for the analysis of airfoils.
It includes a non-linear Lifting Line method (LLT), two Vortex Lattice Methods (VLM),
and a 3D panel flat panel,first-order method for the analysis of wings and planes.
XFLR5 v5 is a re-write of XFLR5 v4 using Qt4 libraries instead of Microsoft's MFC.
XFLR5 v6 introduces stability and control analysis

%prep
%setup -q -n %{snapshot_name}
cp %{SOURCE1} .
# Fix spurious space in filename
sed -i -e 's/xflr5 v6.ts/xflr5v6.ts/' xflr5.pro

%build

cat > .qmake.cache <<EOF
QMAKE_CFLAGS_RELEASE = "%{optflags}"
QMAKE_CXXFLAGS_RELEASE = "%{optflags}"
EOF
qmake-qt5 -o Makefile %{name}.pro

%make_build
lrelease-qt5 %{name}.pro

%install
install -Dm 755 -t %{buildroot}%{_libdir}/ XFoil-lib/libXFoil.so.1
install -Dm 755 -t %{buildroot}%{_bindir}/ xflr5v6/%{name}              
install -Dm 644 xflr5v6/resources/images/%{name}_64.png    %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
install -Dm 644 xflr5v6/resources/images/%{name}_128.png    %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
install -Dm 644 %{name}.desktop       %{buildroot}%{_datadir}/applications/%{name}.desktop
install -Dm 644 -t %{buildroot}%{_datadir}/%{name}/translations translations/*.qm     

%post   -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%doc License.txt doc/ReleaseNotes.htm doc/*.odt
%{_bindir}/%{name}
%{_libdir}/libXFoil.so.1
%{_datadir}/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png

%changelog
openSUSE Build Service is sponsored by