File openpilotgcs.spec of Package openpilotgcs
#
# spec file for package companion
#
# Copyright (c) 2015 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/
#
Name: openpilotgcs
Version: 15.05
Release: 0
Summary: OpenPilot Ground Control Station
License: GPL-3.0
Group: Development/Tools/IDE
Url: https://www.openpilot.com
Source: %name-%{version}.tar.xz
Patch1: fix-install.patch
%if 0%{?fedora_version}
BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qtsvg-devel
BuildRequires: qt5-qtscript-devel
BuildRequires: qt5-qttools-devel
BuildRequires: qt5-qtwebkit-devel
BuildRequires: qt5-qtmultimedia-devel
BuildRequires: qt5-qtserialport-devel
BuildRequires: SDL-devel
BuildRequires: udev-devel
BuildRequires: usb-devel
%else
BuildRequires: libqt5-qtbase-common-devel
BuildRequires: libqt5-qtbase-devel
BuildRequires: libqt5-qtsvg-devel
BuildRequires: libqt5-qtscript-devel
BuildRequires: libqt5-qttools-devel
BuildRequires: libQt5Widgets-devel
BuildRequires: libQt5WebKitWidgets-devel
BuildRequires: libQt5OpenGL-devel
BuildRequires: libqt5-qtmultimedia-devel
BuildRequires: libqt5-qtserialport-devel
BuildRequires: libSDL-devel
BuildRequires: libudev-devel
BuildRequires: libusb-devel
%endif
%description
Current version supports Revo Nano, but not the CC3D
%prep
%setup -q
# fix install pathes and avoid header files of internal lib
%patch1 -p1
mkdir build
%build
cd build
qmake-qt5 PREFIX=/usr LIBDIR=%_libdir ../ground/ground.pro
make %{?_smp_mflags}
%install
cd build
mkdir -p %{buildroot}/usr
cp -av openpilotgcs/{bin,lib,share} %{buildroot}/usr/
rm %{buildroot}/usr/share/Makefile*
%if "%_libdir" == "/usr/lib64"
# workaround wrong built in defaults for now
mv %{buildroot}/usr/lib %{buildroot}/usr/lib64
mkdir -p %{buildroot}/usr/lib
ln -sf ../lib64/openpilotgcs %buildroot/usr/lib/openpilotgcs
%endif
%files
%defattr(-,root,root)
/usr/bin/*
%if "%_libdir" == "/usr/lib64"
/usr/lib/openpilotgcs
%endif
%_libdir/openpilotgcs
/usr/share/openpilotgcs