From 1461447cfa8b07f34d71dd248afd3aa363f84d1b Mon Sep 17 00:00:00 2001 From: Roy Bekken Date: Sat, 25 Jul 2015 18:46:19 +0200 Subject: [PATCH 1/4] Rebranding: Rename udev rules file to allow adding non OP hardware. --- package/Linux.mk | 2 +- package/linux/{45-openpilot-permissions.rules => 45-uav.rules} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename package/linux/{45-openpilot-permissions.rules => 45-uav.rules} (100%) diff --git a/package/Linux.mk b/package/Linux.mk index a2527ff28..7fb0529bd 100644 --- a/package/Linux.mk +++ b/package/Linux.mk @@ -57,7 +57,7 @@ package: debian debian: $(DEB_DIR) $(V1) rm -rf debian $(V1) cp -r $(DEB_DIR) debian - $(V1) cp -T package/linux/45-openpilot-permissions.rules debian/$(DEB_NAME).udev + $(V1) cp -T package/linux/45-uav.rules debian/$(DEB_NAME).udev $(V1) $(SED_SCRIPT) debian/changelog debian/control ifeq ($(DEB_DIST), trusty) $(V1) sed -i -e "$(TRUSTY_DEPS_SED)" debian/control diff --git a/package/linux/45-openpilot-permissions.rules b/package/linux/45-uav.rules similarity index 100% rename from package/linux/45-openpilot-permissions.rules rename to package/linux/45-uav.rules From 4c3d71d0a770ff11d19ed275d5d5687580851e4a Mon Sep 17 00:00:00 2001 From: Roy Bekken Date: Sat, 25 Jul 2015 20:56:55 +0200 Subject: [PATCH 2/4] Add option to install udev rules file on generic linux. --- package/Linux.mk | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/package/Linux.mk b/package/Linux.mk index 7fb0529bd..0fa178313 100644 --- a/package/Linux.mk +++ b/package/Linux.mk @@ -81,10 +81,13 @@ endif # Debian based distro? # Install OpenPilot # ############################## -prefix := /usr/local -bindir := $(prefix)/bin -libdir := $(prefix)/lib -datadir := $(prefix)/share +enable-udev-rules ?= no + +prefix := /usr/local +bindir := $(prefix)/bin +libdir := $(prefix)/lib +datadir := $(prefix)/share +sysconfdir := $(prefix)/etc INSTALL = cp -a --no-preserve=ownership LN = ln @@ -106,4 +109,7 @@ install: $(V1) $(INSTALL) -T $(ROOT_DIR)/package/linux/openpilot.png $(DESTDIR)$(datadir)/pixmaps/$(ORG_SMALL_NAME).png - +ifneq ($(enable-udev-rules), no) + $(V1) $(MKDIR) -p $(DESTDIR)$(sysconfdir)/udev/rules.d + $(V1) $(INSTALL) -T $(ROOT_DIR)/package/linux/45-uav.rules $(DESTDIR)$(sysconfdir)/udev/rules.d/45-$(ORG_SMALL_NAME).rules +endif From 07deb6623d5ab29c9b642c6f48b80da434bd68a9 Mon Sep 17 00:00:00 2001 From: Roy Bekken Date: Sat, 25 Jul 2015 22:49:42 +0200 Subject: [PATCH 3/4] Give more flexibility for udev rules file location installment. --- package/Linux.mk | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/package/Linux.mk b/package/Linux.mk index 0fa178313..13dc27b58 100644 --- a/package/Linux.mk +++ b/package/Linux.mk @@ -82,12 +82,11 @@ endif # Debian based distro? # ############################## enable-udev-rules ?= no - -prefix := /usr/local -bindir := $(prefix)/bin -libdir := $(prefix)/lib -datadir := $(prefix)/share -sysconfdir := $(prefix)/etc +prefix := /usr/local +bindir := $(prefix)/bin +libdir := $(prefix)/lib +datadir := $(prefix)/share +udevrulesdir := /etc/udev/rules.d INSTALL = cp -a --no-preserve=ownership LN = ln @@ -110,6 +109,6 @@ install: $(V1) $(INSTALL) -T $(ROOT_DIR)/package/linux/openpilot.png $(DESTDIR)$(datadir)/pixmaps/$(ORG_SMALL_NAME).png ifneq ($(enable-udev-rules), no) - $(V1) $(MKDIR) -p $(DESTDIR)$(sysconfdir)/udev/rules.d - $(V1) $(INSTALL) -T $(ROOT_DIR)/package/linux/45-uav.rules $(DESTDIR)$(sysconfdir)/udev/rules.d/45-$(ORG_SMALL_NAME).rules + $(V1) $(MKDIR) -p $(DESTDIR)$(udevrulesdir) + $(V1) $(INSTALL) -T $(ROOT_DIR)/package/linux/45-uav.rules $(DESTDIR)$(udevrulesdir)/45-$(ORG_SMALL_NAME).rules endif From 85522a595521b87d210b405611601b2076827b98 Mon Sep 17 00:00:00 2001 From: Roy Bekken Date: Sun, 26 Jul 2015 14:22:28 +0200 Subject: [PATCH 4/4] Initial rpmspec file made for Fedora. --- package/linux/librepilot.spec | 106 ++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 package/linux/librepilot.spec diff --git a/package/linux/librepilot.spec b/package/linux/librepilot.spec new file mode 100644 index 000000000..1330fba42 --- /dev/null +++ b/package/linux/librepilot.spec @@ -0,0 +1,106 @@ + +%global gitrev g07deb66 + +Name: LibrePilot +Summary: Ground Control Station +Version: 0.0 +Release: 1.git%{gitrev}%{?dist} + +Group: Applications/Scientific +License: GPLv3+ +URL: http://forum.librepilot.org/ + +Source0: https://github.com/librepilot/%{name}/archive/%{name}-%{version}-%{gitrev}.tar.gz + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + + +BuildRequires: libusbx-devel +BuildRequires: mesa-libGL-devel +BuildRequires: qt5-qtbase-devel +BuildRequires: qt5-qtdeclarative-devel +BuildRequires: qt5-qtmultimedia-devel +BuildRequires: qt5-qtquick1-devel +BuildRequires: qt5-qtscript-devel +BuildRequires: qt5-qtserialport-devel +BuildRequires: qt5-qtsvg-devel +BuildRequires: qt5-qttools-devel +BuildRequires: dwz +BuildRequires: pkgconfig +BuildRequires: python +BuildRequires: SDL-devel +BuildRequires: systemd-devel + +Requires: libusbx +Requires: SDL +Requires: qt5-qtdeclarative +Requires: qt5-qtmultimedia +Requires: qt5-qtscript +Requires: qt5-qtserialport +Requires: qt5-qtsvg + + +%description +LibrePilot is a next-generation Open Source UAV autopilot created by the +LibrePilot Community. It is a highly capable platform for +multirotors, helicopters, fixed wing aircraft, and other vehicles. +It has been designed from the ground up by a community of passionate developers +from around the globe, with its core design principles being quality, safety, +and ease of use. + + +%prep +%setup -q -n %{name}-%{version}-%{gitrev} + +# Fix hardcoded paths +sed -i 's!lib/$$GCS_SMALL_NAME!%{_lib}/$$GCS_SMALL_NAME!g' ground/openpilotgcs/openpilotgcs.pri +sed -i 's!lib/$(GCS_SMALL_NAME!%{_lib}/$(GCS_SMALL_NAME!g' package/Linux.mk + + +%build +make %{?_smp_mflags} gcs QMAKE=qmake-qt5 CC=%{__cc} CXX=%{__cxx} libdir=%{_libdir} +#make -j1 opfw_resource + + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT \ + prefix=%{_prefix} \ + libdir=%{_libdir} \ + enable-udev-rules=yes \ + udevrulesdir=%{_udevrulesdir} + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + + +%files +%doc README.txt GPLv3.txt +%{_bindir}/librepilot-gcs +%{_udevrulesdir}/45-librepilot.rules +%{_datadir}/applications/librepilot.desktop +%{_datadir}/librepilot-gcs//* +%{_datadir}/pixmaps/librepilot.png +%{_libdir}/librepilot-gcs/plugins/OpenPilot/*.pluginspec +%{_libdir}/librepilot-gcs/plugins/OpenPilot/*.so +# +%{_libdir}/librepilot-gcs/libAggregation.so.1* +%{_libdir}/librepilot-gcs/libExtensionSystem.so.1* +%{_libdir}/librepilot-gcs/libGLC_lib.so.1* +%{_libdir}/librepilot-gcs/libopmapwidget.so.1* +%{_libdir}/librepilot-gcs/libQScienceSpinBox.so.1* +%{_libdir}/librepilot-gcs/libQtConcurrent.so.1* +%{_libdir}/librepilot-gcs/libQwt.so.1* +%{_libdir}/librepilot-gcs/libsdlgamepad.so.1* +%{_libdir}/librepilot-gcs/libUtils.so.1* +%{_libdir}/librepilot-gcs/libVersionInfo.so.1* +# +%{_libdir}/librepilot-gcs/lib*.so + + +%changelog