summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnish Bhatt2015-04-24 01:44:01 -0700
committerAnish Bhatt2015-04-24 01:44:01 -0700
commitb5c46b25a678343bd11a700f11174377f91b403a (patch)
tree32760aa9de6239c48c081e709a4ec23b2d9b2c60
downloadaur-b5c46b25a678343bd11a700f11174377f91b403a.tar.gz
Add piaware-git package
-rw-r--r--.SRCINFO31
-rw-r--r--0001-Add-ability-to-specify-custom-install-prefix-for-pac.patch133
-rw-r--r--0002-Add-fix-for-adept-error-from-mutability-piaware.patch27
-rw-r--r--PKGBUILD58
-rw-r--r--piaware-git.install8
5 files changed, 257 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..0bec538abcd1
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,31 @@
+pkgbase = piaware-git
+ pkgdesc = Client-side package and programs for forwarding ADS-B data to FlightAware
+ pkgver = 1.18.1.r30.g43ca50a
+ pkgrel = 1
+ url = https://github.com/flightaware/piaware
+ install = piaware-git.install
+ arch = i686
+ arch = x86_64
+ arch = armv6h
+ arch = armv7h
+ license = BSD
+ makedepends = git
+ makedepends = autoconf
+ makedepends = tcl
+ depends = dump1090_mr-git
+ depends = tcl
+ depends = tcllib
+ depends = tclx
+ depends = tk
+ depends = tls
+ source = piaware::git+git://github.com/flightaware/piaware
+ source = tcllauncher::git+git://github.com/flightaware/tcllauncher.git
+ source = 0001-Add-ability-to-specify-custom-install-prefix-for-pac.patch
+ source = 0002-Add-fix-for-adept-error-from-mutability-piaware.patch
+ md5sums = SKIP
+ md5sums = SKIP
+ md5sums = 57d43fc9803c99bd7f32f882bf42fc08
+ md5sums = e8a43e9a5f22d52bb2c47168b00d92ac
+
+pkgname = piaware-git
+
diff --git a/0001-Add-ability-to-specify-custom-install-prefix-for-pac.patch b/0001-Add-ability-to-specify-custom-install-prefix-for-pac.patch
new file mode 100644
index 000000000000..e6c551cc2569
--- /dev/null
+++ b/0001-Add-ability-to-specify-custom-install-prefix-for-pac.patch
@@ -0,0 +1,133 @@
+From 9e854fb3c346d8e4afc63c30fdc277b8c7ddbeb4 Mon Sep 17 00:00:00 2001
+From: Anish Bhatt <anish7@gmail.com>
+Date: Thu, 23 Apr 2015 22:29:55 -0700
+Subject: [PATCH] Add ability to specify custom install prefix, for packaging
+ purposes
+
+---
+ Makefile | 14 +++++++++++++-
+ doc/Makefile | 3 ++-
+ package/Makefile | 4 ++--
+ programs/piaware-config/Makefile | 5 ++---
+ programs/piaware-status/Makefile | 5 ++---
+ programs/piaware/Makefile | 5 ++---
+ 6 files changed, 23 insertions(+), 13 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 3937de4..d875ce2 100644
+--- a/Makefile
++++ b/Makefile
+@@ -5,6 +5,18 @@
+ # locate the config directory of the init system
+ SYSTEMD := $(shell ls -d /etc/systemd/system/ 2>/dev/null)
+ SYSVINIT := $(shell ls -d /etc/init.d/ 2>/dev/null)
++TCLSH=$(shell which tclsh || which tclsh8.5 || which tclsh8.6)
++USR_DIR := /usr
++
++ifeq ($(PREFIX),)
++ PREFIX_DIR := $(USR_DIR)
++else
++ PREFIX_DIR := $(PREFIX)/$(USR_DIR)
++ $(warning Installing to $(PREFIX))
++endif
++
++export TCLSH
++export PREFIX_DIR
+
+ all:
+ @echo "'make install' as root to install client package and program"
+@@ -21,7 +33,7 @@ ifdef SYSVINIT
+ install scripts/piaware-rc-script $(SYSVINIT)piaware
+ else
+ ifdef SYSTEMD
+- install scripts/piaware.service $(SYSTEMD)
++ install scripts/piaware.service $(PREFIX)/$(SYSTEMD)
+ else
+ @echo "No init service found"
+ endif
+diff --git a/doc/Makefile b/doc/Makefile
+index de37361..dff13c3 100644
+--- a/doc/Makefile
++++ b/doc/Makefile
+@@ -2,7 +2,7 @@
+ # makefile for piaware doc files
+ #
+
+-DOCDIR=/usr/share/man/man1
++DOCDIR=$(PREFIX_DIR)/share/man/man1
+
+ MANPAGES= faup1090.1 piaware.1 piaware-config.1 piaware-status.1
+
+@@ -11,6 +11,7 @@ all:
+
+ install:
+ @echo ---- installing docs
++ install -d $(DOCDIR)
+ cp $(MANPAGES) $(DOCDIR)
+ @echo --- compressing docs
+ cd $(DOCDIR); gzip --force -9 $(MANPAGES)
+diff --git a/package/Makefile b/package/Makefile
+index ca36ad0..a79768f 100644
+--- a/package/Makefile
++++ b/package/Makefile
+@@ -1,7 +1,7 @@
+
+-LIB=/usr/lib/fa_adept_packages
+
+-TCLSH=$(shell which tclsh || which tclsh8.5 || which tclsh8.6)
++
++LIB=$(PREFIX_DIR)/lib/fa_adept_packages
+
+ FILES=fa_adept_config.tcl fa_adept_client.tcl piaware.tcl ca/DigiCertCA.crt
+
+diff --git a/programs/piaware-config/Makefile b/programs/piaware-config/Makefile
+index fcf01ee..e56fb61 100644
+--- a/programs/piaware-config/Makefile
++++ b/programs/piaware-config/Makefile
+@@ -3,9 +3,8 @@
+ # configure and do other stuff as a FlightAware adept client
+ #
+
+-LIB=/usr/lib
+-BIN=/usr/bin
+-TCLSH=tclsh8.5
++LIB=$(PREFIX_DIR)/lib
++BIN=$(PREFIX_DIR)/bin
+
+ CLIENT_INSTALLFILES= *.tcl
+
+diff --git a/programs/piaware-status/Makefile b/programs/piaware-status/Makefile
+index 0d434e1..5c341c7 100644
+--- a/programs/piaware-status/Makefile
++++ b/programs/piaware-status/Makefile
+@@ -3,9 +3,8 @@
+ # get the status of the piaware toolchain
+ #
+
+-LIB=/usr/lib
+-BIN=/usr/bin
+-TCLSH=tclsh8.5
++LIB=$(PREFIX_DIR)/lib
++BIN=$(PREFIX_DIR)/bin
+
+ CLIENT_INSTALLFILES= *.tcl
+
+diff --git a/programs/piaware/Makefile b/programs/piaware/Makefile
+index f9f3033..3dd4a44 100644
+--- a/programs/piaware/Makefile
++++ b/programs/piaware/Makefile
+@@ -3,9 +3,8 @@
+ # FA's simple aviation data exchange protocol
+ #
+
+-LIB=/usr/lib
+-BIN=/usr/bin
+-TCLSH=tclsh8.5
++LIB=$(PREFIX_DIR)/lib
++BIN=$(PREFIX_DIR)/bin
+
+ CLIENT_INSTALLFILES= *.tcl
+
+--
+2.3.5
+
diff --git a/0002-Add-fix-for-adept-error-from-mutability-piaware.patch b/0002-Add-fix-for-adept-error-from-mutability-piaware.patch
new file mode 100644
index 000000000000..b9b6ddd91f5c
--- /dev/null
+++ b/0002-Add-fix-for-adept-error-from-mutability-piaware.patch
@@ -0,0 +1,27 @@
+From baae92ae9c8abd546835a17a226aefe6effdc46d Mon Sep 17 00:00:00 2001
+From: Anish Bhatt <anish7@gmail.com>
+Date: Fri, 24 Apr 2015 01:32:18 -0700
+Subject: [PATCH 2/2] Add fix for adept error from mutability/piaware
+
+---
+ programs/piaware/helpers.tcl | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/programs/piaware/helpers.tcl b/programs/piaware/helpers.tcl
+index c4ff0da..2da3131 100644
+--- a/programs/piaware/helpers.tcl
++++ b/programs/piaware/helpers.tcl
+@@ -12,6 +12,10 @@ package require tls
+ proc logger {text} {
+ #::bsd::syslog log info $text
+ log_locally $text
++ if {[llength [info commands "adept"]] < 1} {
++ # adept client has not yet loaded
++ return 0
++ }
+ adept send_log_message $text
+ }
+
+--
+2.3.6
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..52ed2cc4b1b7
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,58 @@
+# Contributor : anish [ at ] gatech [dot] edu
+# Maintainer : anish [ at ] gatech [dot] edu
+
+pkgname=piaware-git
+_gitname=piaware
+pkgver=1.18.1.r30.g43ca50a
+pkgrel=1
+
+pkgdesc="Client-side package and programs for forwarding ADS-B data to FlightAware"
+
+arch=('i686' 'x86_64' 'armv6h' 'armv7h')
+url="https://github.com/flightaware/piaware"
+license=('BSD')
+
+depends=('dump1090_mr-git' 'tcl' 'tcllib' 'tclx' 'tk' 'tls')
+makedepends=('git' 'autoconf' 'tcl')
+
+source=('piaware::git+git://github.com/flightaware/piaware'
+ 'tcllauncher::git+git://github.com/flightaware/tcllauncher.git'
+ '0001-Add-ability-to-specify-custom-install-prefix-for-pac.patch'
+ '0002-Add-fix-for-adept-error-from-mutability-piaware.patch')
+md5sums=('SKIP'
+ 'SKIP'
+ '57d43fc9803c99bd7f32f882bf42fc08'
+ 'e8a43e9a5f22d52bb2c47168b00d92ac')
+install=piaware-git.install
+
+_gitname=piaware
+_gitname2=tcllauncher
+
+pkgver() {
+ cd "${srcdir}/${_gitname}"
+ git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ cd "${srcdir}/${_gitname}"
+ patch -p1 < ../0001-Add-ability-to-specify-custom-install-prefix-for-pac.patch
+ patch -p1 < ../0002-Add-fix-for-adept-error-from-mutability-piaware.patch
+
+ cd "${srcdir}/${_gitname2}"
+ autoconf
+ ./configure
+#--prefix=${pkgdir}/usr --exec-prefix=${pkgdir}/usr
+}
+
+package() {
+ cd "${srcdir}/${_gitname2}"
+ make install DESTDIR=${pkgdir}
+
+ mkdir -p "${pkgdir}/etc/systemd/system"
+ cd "${srcdir}/${_gitname}"
+ make install PREFIX=${pkgdir}
+
+ mv "${pkgdir}/etc/systemd/system" "${pkgdir}/usr/lib/systemd"
+ rmdir "${pkgdir}/etc/systemd"
+ rmdir "${pkgdir}/etc"
+}
diff --git a/piaware-git.install b/piaware-git.install
new file mode 100644
index 000000000000..5d16f782b815
--- /dev/null
+++ b/piaware-git.install
@@ -0,0 +1,8 @@
+post_install() {
+ systemctl enable piaware
+}
+
+pre_remove() {
+ systemctl stop piaware
+ systemctl disable piaware
+}