File apm_planner.spec of Package apm_planner
#
# spec file for package qgroundcontrol
#
# Copyright (c) 2013 SUSE LINUX Products 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/
#
# See also http://en.opensuse.org/openSUSE:Specfile_guidelines
Name: apmplanner2
Version: 2.0.19~rc4
Release: 0
Summary: An operator control unit / ground control software for micro air vehicles
License: GPL-3.0
Group: Other
Url: https://github.com/diydrones/apm_planner
Source0: apm_planner-%{version}.tar.xz
Patch1: fix-qt55-build.diff
# Fix a compile error for 13.1
Patch2: JoystickInput.h.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-qtserialport-devel
BuildRequires: SDL2-devel
BuildRequires: protobuf-c-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: libqt5-qtserialport-devel
BuildRequires: libSDL2-devel
BuildRequires: libprotobuf-c-devel
%endif
BuildRequires: libudev-devel
BuildRequires: alsa-devel
BuildRequires: libsndfile-devel
BuildRequires: flite-devel
BuildRequires: openssl-devel
BuildRequires: protobuf-devel
BuildRequires: fdupes
%description
APM Planner is a special version of QGroundControl. It supports the latest APM and Pixhawk boards.
QGroundControl is an operator control unit / ground control software for micro air vehicles. It allows to visualize and control a micro air vehicle during development and operation, both indoors and outdoors. With a flexible software architecture it supports multiple MAV types/autopilot projects. QGroundControl was mainly developed by Lorenz Meier at ETH Zurich as the Ground Control Station software for the PIXHAWK Project. By now it evolved into an open-source application used at multiple
universities worldwide and with many active contributors.
%prep
%setup -q -n apm_planner-%version
#%patch1 -p1
%patch2
%build
mkdir build && cd build
qmake-qt5 PREFIX=/usr LIBDIR=%_libdir ../qgroundcontrol.pro
make %{?_smp_mflags}
%install
cd build
make INSTALL_ROOT=%{buildroot} install
sed -i -e 's/^Categories=.*/Categories=System;HardwareSettings;/' \
$RPM_BUILD_ROOT/usr/share/applications/apmplanner2.desktop
mkdir -p $RPM_BUILD_ROOT/usr/lib/udev/rules.d/
cat > $RPM_BUILD_ROOT/usr/lib/udev/rules.d/49-pixhawk.rules <<EOF
# /etc/udev/rules.d/49-pixhawk.rules
# 26ac:0011 - 3DR Pixhawk
ATTRS{idVendor}=="26ac", ATTRS{idProduct}=="0011", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="26ac", ATTRS{idProduct}=="0011", ENV{MTP_NO_PROBE}="1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="26ac", ATTRS{idProduct}=="0011", MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="26ac", ATTRS{idProduct}=="0011", MODE:="0666"
ATTRS{idVendor}=="26ac", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="1d50", ENV{ID_MM_DEVICE_IGNORE}="1"
EOF
%fdupes %{buildroot}
%files
%defattr(0644,root,root,-)
%doc license.txt README.md release_notes.txt
%attr(0755,root,root) %{_bindir}/apmplanner2
%{_datadir}/applications/apmplanner2.desktop
%{_datadir}/menu/apmplanner2
%{_datadir}/APMPlanner2
%dir /usr/share/menu
/usr/lib/udev/rules.d
# illegal...
/usr/bin/sik_uploader
%changelog