File crrcsim.spec of Package crrcsim

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


Name:           crrcsim
Version:        0.9.13
Release:        0
Summary:        A model-airplane flight simulation program
License:        GPL-2.0-or-later
Group:          Amusements/Games/3D/Simulation
URL:            https://sourceforge.net/projects/crrcsim/
Source0:        http://prdownloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
# PATCH-FEATURE-UPSTREAM https://sourceforge.net/p/crrcsim/patches/15/
Source1:        crrcsim.desktop
# PATCH-FEATURE-UPSTREAM https://sourceforge.net/p/crrcsim/patches/14/
Source2:        crrcsim.appdata.xml
# PATCH-FIX-UPSTREAM fix-c++14.patch -- https://sourceforge.net/p/crrcsim/bugs/35/
Patch0:         fix-c++14.patch
# PATCH-FIX-UPSTREAM fix-boost.patch -- Fix detecting new versions of boost thread library
Patch1:         fix-boost.patch
# PATCH-FIX-SUSE reproducable.patch -- Do not use date or time macros for https://en.wikipedia.org/wiki/Reproducible_builds
Patch2:         reproducable.patch
# PATCH-FIX-UPSTREAM fix-plib.patch -- Fix build with new version of plib
Patch3:         fix-plib.patch
BuildRequires:  SDL-devel
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  cgal-devel
BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  freeglut-devel
BuildRequires:  gcc-c++
BuildRequires:  libXi-devel
BuildRequires:  libXmu-devel
BuildRequires:  libXt-devel
BuildRequires:  libboost_thread-devel
BuildRequires:  libjpeg8-devel
BuildRequires:  plib-devel
BuildRequires:  portaudio
BuildRequires:  portaudio-devel
BuildRequires:  update-desktop-files

%description
CRRCSim is a model-airplane flight simulation program for Linux with ports to
other platforms. Using CRRCSim you can learn how to fly model aircraft, test
new aircraft designs, and improve your skills by practicing in the relative
safety of your pc.

%prep
%autosetup -p1
# Required for autoconf
touch ./ChangeLog
# Fix line endings
for i in \
    documentation/input_method/PARALLEL_1_to_3/crrcsim_at90s1200.hex \
    documentation/models/Readmefirst_Wasabi.txt \
    documentation/models/Readmefirst_Generic_F3F.txt \
    documentation/dlportio.txt; do
        dos2unix $i;
done

%build
autoreconf -fi
%configure
make %{?_smp_mflags}

%install
make %{?_smp_mflags} DESTDIR=%{buildroot} install

%suse_update_desktop_file -i crrcsim

install -Dm0644 %{S:2} %{buildroot}%{_datadir}/appdata/crrcsim.appdata.xml

%fdupes %{buildroot}%{_datadir}

%find_lang %{name}

rm -rf %{buildroot}%{_datadir}/doc/crrcsim/Install_Win32.txt

%post
%desktop_database_post

%postun
%desktop_database_postun

%files -f %{name}.lang
%defattr(-,root,root,-)
%{_bindir}/crrcsim
%{_datadir}/crrcsim/
%{_datadir}/doc/crrcsim/
%{_datadir}/locale/de/LC_MESSAGES/crrcsim.mo
%{_datadir}/locale/fr/LC_MESSAGES/crrcsim.mo
%{_datadir}/locale/it/LC_MESSAGES/crrcsim.mo
%{_mandir}/man1/crrcsim.1%{ext_man}
%{_datadir}/applications/crrcsim.desktop
%dir %{_datadir}/appdata/
%{_datadir}/appdata/crrcsim.appdata.xml

%changelog
openSUSE Build Service is sponsored by