Self-Contained Piaware Packaging Script
Builds following components in one package
- Piaware data feeder
- faup1090
- fa-mlat-client
The build script consists of following 3 files in same folder (change ownership of this folder and files in it to yourself)
sudo chown -R abcd /home/abcd/piaware-combo
- PKGBUILD
- piaware.install
- piaware.conf
To build the package, enter the folder containing the above 3 files, and give following command:
makepkg -si
1- PKGBUILD
#Contributor: abcd567
#Maintainer: abcd567
pkgname=piaware
pkgver=latest
pkgrel=1
pkgdesc="Flightaware ADS-B data feeder"
arch=('i686' 'i386' 'x86_64' 'armv6h' 'armv7h' 'armv8h' 'aarch64')
url="https://github.com/flightaware/piaware"
license=('BSD')
depends=('git' 'autoconf' 'tcl' 'tcllib' 'tclx' 'tcltls'
'python' 'tk' 'tcllauncher' 'net-tools')
source=('piaware::git+git://github.com/flightaware/piaware'
'faup1090::git+git://github.com/flightaware/dump1090'
'fa-mlat-client::git://github.com/mutability/mlat-client.git')
md5sums=('SKIP' 'SKIP' 'SKIP')
install=piaware.install
pkgver() {
cd ${srcdir}/piaware
git describe --tags | sed 's/-.*//'
}
package() {
## Build faup1090
cd ${srcdir}/faup1090
make faup1090
install -Dm755 ${srcdir}/faup1090/faup1090 ${pkgdir}/usr/lib/piaware/helpers/faup1090
## Build fa-mlat-client
cd ${srcdir}/fa-mlat-client
./setup.py install --prefix=${pkgdir}/usr
install -Dm755 ${pkgdir}/usr/bin/fa-mlat-client ${pkgdir}/usr/lib/piaware/helpers/fa-mlat-client
rm -rf ${pkgdir}/usr/bin/
## Build piaware
cd ${srcdir}/piaware
make install DESTDIR=${pkgdir} SYSTEMD=/usr/lib/systemd/system
install -dm755 ${pkgdir}/var/cache/piaware
install -dm750 ${pkgdir}/etc/sudoers.d/
install -Dm644 etc/piaware.sudoers ${pkgdir}/etc/sudoers.d/01piaware
install -Dm640 ../../piaware.conf ${pkgdir}/etc/piaware.conf
chmod -x ${pkgdir}/usr/lib/systemd/system/piaware.service
install -Dm644 LICENSE.txt ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}
2 - piaware.install
post_install() {
useradd --system piaware
chown piaware /var/cache/piaware
chown piaware /etc/piaware.conf
systemctl enable piaware
systemctl start piaware
}
pre_remove() {
systemctl stop piaware
systemctl disable piaware
userdel piaware
}
post_upgrade() {
post_install
}
3 - piaware.conf
# This file configures piaware and related software.
# You can edit it directly or use piaware-config from the command line
# to view and change settings.
#
# If /boot/piaware-config.txt also exists, then settings present in
# that file will override settings in this file.
Packages To Be Installed before building piaware package
(1) BUILD TOOLS to be installed before building any package
sudo pacman --needed -Sy fakeroot binutils git autoconf gcc make patch
(2) Install Piaware dependencies available in Arch Linux Repository
sudo pacman --needed -Sy tcl python tk
(3) Piaware depencies not available in repository. Build and install these as follows.
NOTE: Building these requires build tools [item (1) above] be installed first.
git clone https://aur.archlinux.org/tcllib
cd tcllib
makepkg -si
cd ../
git clone https://aur.archlinux.org/tclx
cd tclx
makepkg -si
cd ../
git clone https://aur.archlinux.org/tcltls
cd tcltls
makepkg -si
cd ../
git clone https://aur.archlinux.org/tcllauncher
cd tcllauncher
makepkg -si
cd ../