From b9d36988755397eee8286664e1000f9cd2cd15a6 Mon Sep 17 00:00:00 2001 From: Roy Bekken Date: Wed, 5 Aug 2015 15:52:00 +0200 Subject: [PATCH] LP-62 - Implement RPM specfile. - Gives the option to build firmware. $ make package RPMBUILD_OPTS="-bb --with firmware" --- package/linux/rpmspec.in | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/package/linux/rpmspec.in b/package/linux/rpmspec.in index 78de5e8c1..396905360 100644 --- a/package/linux/rpmspec.in +++ b/package/linux/rpmspec.in @@ -53,7 +53,30 @@ and ease of use. %build -make %{?_smp_mflags} gcs QMAKE=qmake-qt5 CC=%{__cc} CXX=%{__cxx} libbasename=%{_lib} + +%if 0%{?_with_firmware:1} +# If you want to build firmware you will need to install the arm-none-eabi-gcc tool chain. +# You can not install the default system version available via dnf, since it don't have +# the features needed to compile the firmware. +# +# The easiest way to install a working arm tool chain is to fetch a package from +# launchpad.net: https://launchpad.net/gcc-arm-embedded. +# +# LibrePilot currently use gcc-arm-none-eabi-4_9-2014q4-20141203-linux.tar.bz2 +# +# Unpack the file and move to /opt/: +# tar xjvf gcc-arm-none-eabi-4_9-2014q4-20141203-linux.tar.bz2 +# sudo mv gcc-arm-none-eabi-4_9-2014q4 /opt/arm +# echo "PATH=/opt/arm/bin:$PATH" >> ~/.bashrc +# echo "export PATH" >> ~/.bashrc +# source ~/.bashrc +# +# NOTE: You need to have glibc 32bit + +make %{?_smp_mflags} opfw_resource +%endif + +make %{?_smp_mflags} gcs QMAKE=qmake-qt5 libbasename=%{_lib} %install