mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
Merged in rbekken/librepilot/LP-101_RPM (pull request #41)
LP-101 - Use prebuilt firmware for RPM packaging.
This commit is contained in:
commit
6cf4a8990c
@ -10,7 +10,8 @@ SED_SCRIPT := sed -i -e ' \
|
||||
s/<VERSION>/$(UPSTREAM_VER)/g; \
|
||||
s/<NAME>/$(RPM_NAME)/g; \
|
||||
s/<RELEASE>/$(RPM_REL)/g; \
|
||||
s/<SOURCE>/$(notdir $(DIST_TAR_GZ))/g; \
|
||||
s/<SOURCE0>/$(notdir $(DIST_TAR_GZ))/g; \
|
||||
s/<SOURCE1>/$(notdir $(FW_DIST_TAR_GZ))/g; \
|
||||
s/<ARCHIVE_PREFIX>/$(PACKAGE_NAME)/g; \
|
||||
'
|
||||
|
||||
@ -36,8 +37,8 @@ $(RPM_PACKAGE_FILE): RPMBUILD_OPTS := -bb
|
||||
package_src: $(RPM_PACKAGE_SRC)
|
||||
$(RPM_PACKAGE_SRC): RPMBUILD_OPTS := -bs
|
||||
|
||||
$(RPM_PACKAGE_FILE) $(RPM_PACKAGE_SRC): $(SPEC_FILE) $(DIST_TAR_GZ) | $(RPM_DIRS)
|
||||
$(RPM_PACKAGE_FILE) $(RPM_PACKAGE_SRC): $(SPEC_FILE) $(DIST_TAR_GZ) $(FW_DIST_TAR_GZ) | $(RPM_DIRS)
|
||||
@$(ECHO) "Building $(call toprel,$@), please wait..."
|
||||
$(V1) ln -sf $(DIST_TAR_GZ) $(PACKAGE_DIR)/SOURCES
|
||||
$(V1) ln -sf $(FW_DIST_TAR_GZ) $(PACKAGE_DIR)/SOURCES
|
||||
$(V1) rpmbuild $(RPMBUILD_OPTS) --define "_topdir $(PACKAGE_DIR)" $(SPEC_FILE)
|
||||
|
||||
|
@ -7,7 +7,8 @@ Group: Applications/Scientific
|
||||
License: GPLv3+
|
||||
URL: http://forum.librepilot.org/
|
||||
|
||||
Source0: <SOURCE>
|
||||
Source0: <SOURCE0>
|
||||
Source1: <SOURCE1>
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
@ -49,43 +50,25 @@ and ease of use.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -n <ARCHIVE_PREFIX>
|
||||
%setup -q -T -a 1 -c -n <ARCHIVE_PREFIX>/build
|
||||
%setup -q -D -n <ARCHIVE_PREFIX>
|
||||
|
||||
|
||||
%build
|
||||
make config_new \
|
||||
enable-udev-rules=yes \
|
||||
libbasename=%{_lib} \
|
||||
prefix=%{_prefix} \
|
||||
QMAKE=qmake-qt5 \
|
||||
udevrulesdir=%{_udevrulesdir} \
|
||||
WITH_PREBUILT_FW=$(pwd)/build/firmware
|
||||
|
||||
%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}
|
||||
make %{?_smp_mflags} opfw_resource gcs
|
||||
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make install DESTDIR=$RPM_BUILD_ROOT \
|
||||
prefix=%{_prefix} \
|
||||
libbasename=%{_lib} \
|
||||
enable-udev-rules=yes \
|
||||
udevrulesdir=%{_udevrulesdir}
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%clean
|
||||
|
Loading…
x
Reference in New Issue
Block a user