Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,18 @@ Ensure that your build machine has the build dependencies mentioned in
package/debian/control. Something like this:

```
# apt install build-essential git devscripts debhelper tcl8.6-dev autoconf \
python3-dev python3-venv python3-setuptools libz-dev openssl \
sudo apt install build-essential git devscripts debhelper tcl8.6-dev \
autoconf python3-dev python3-venv python3-setuptools libz-dev openssl \
libboost-system-dev libboost-program-options-dev libboost-regex-dev \
libboost-filesystem-dev patchelf
```

Additional packages are needed in order to build PiAware on Debian Trixie:

```
sudo apt install python3-build python3-pyasyncore python3-filelock
```

If you use pdebuild it will do most of this for you.

## Caveat about tcl-tls
Expand Down Expand Up @@ -63,19 +69,19 @@ Change to the package directory on your build machine and build with a
debian package building tool of your choice:

```
$ dpkg-buildpackage -b
dpkg-buildpackage -b --no-sign
```

or

```
$ debuild
debuild
```

or

```
$ pdebuild
pdebuild
```

etc.
Expand Down
23 changes: 22 additions & 1 deletion sensible-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ shallow_clone() {
}

usage() {
echo "syntax: $0 <buster|bullseye|bookworm>" >&2
echo "syntax: $0 <buster|bullseye|bookworm|trixie>" >&2
exit 1
}

Expand Down Expand Up @@ -53,6 +53,11 @@ case $dist in
targetdist=bookworm
extraversion=""
;;
trixie)
debdist=trixie
targetdist=trixie
extraversion=""
;;
xenial)
# not tested
debdist=stretch
Expand All @@ -71,6 +76,12 @@ case $dist in
targetdist=disco
extraversion="~ubuntu1904+"
;;
noble)
# not tested
debdist=trixie
targetdist=noble
extraversion="~ubuntu2404+"
;;
*)
echo "unknown build distribution $1" >&2
usage
Expand Down Expand Up @@ -173,6 +184,16 @@ case $debdist in
https://github.com/marcelotduarte/cx_Freeze/archive/refs/tags/6.15.9.tar.gz \
d32b309b355f2b377dae585a839e39e3251b3f9716f2b4983be92972c2863000
;;

trixie)
fetch_archive cx_Freeze-8.5.0 \
https://github.com/marcelotduarte/cx_Freeze/archive/refs/tags/8.5.0.tar.gz \
2502fd12ce008afb2a3f32056e0808cb16f4f863de9b70c016e0f54716b4788e
fetch_archive freeze-core-0.4.2 \
https://github.com/marcelotduarte/freeze-core/archive/refs/tags/0.4.2.tar.gz \
1d1ba3c8c8f89feb45fd11478a840c16734fd0f8a3d949b0d788854c84f3ecbe

;;
esac

# copy our control files
Expand Down
16 changes: 16 additions & 0 deletions trixie/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Source: piaware
Section: embedded
Priority: extra
Maintainer: FlightAware Developers <[email protected]>
Build-Depends: debhelper(>=10), tcl8.6-dev, autoconf, python3-dev(>=3.9), python3-venv, python3-setuptools (>=62.6), python3-wheel (>=0.38.4), python3-build, python3-pip, libz-dev, openssl, libboost-system-dev, libboost-program-options-dev, libboost-regex-dev, libboost-filesystem-dev, patchelf, python3-filelock, python3-pyasyncore
Standards-Version: 3.9.3
Homepage: https://github.com/flightaware

Package: piaware
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, net-tools, iproute2, tclx8.4, tcl8.6, tcllib, tcl-tls (>= 1.7.22-2+fa1), itcl3
Suggests: dump1090-fa, dump978-fa
Conflicts: fa-mlat-client
Replaces: fa-mlat-client
Description: Open Aviation Data Exchange Protocol for ADS-B FlightFeeders
The client-side portion of fa_adept that sends aviation data via TCL sockets.
1 change: 1 addition & 0 deletions trixie/piaware.docs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
piaware/MLAT-RESULTS-LICENSE.md
3 changes: 3 additions & 0 deletions trixie/piaware.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
debian/rsyslog/piaware.conf etc/rsyslog.d/
debian/upgrade-config.tcl usr/share/piaware/
debian/piaware.conf etc/
9 changes: 9 additions & 0 deletions trixie/piaware.logrotate
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/var/log/piaware.log {
weekly
rotate 4
missingok
notifempty
postrotate
invoke-rc.d rsyslog rotate >/dev/null 2>&1 || true
endscript
}
155 changes: 155 additions & 0 deletions trixie/piaware.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
#!/bin/sh
# postinst script for piaware
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

NAME=piaware
RUNAS=piaware

upgrade_piaware2_config() {
if [ ! -f /boot/piaware-config.txt -a -d /boot ]
then
# write an initial piaware-config.txt so it can be updated in a moment.
cat >/boot/piaware-config.txt <<EOF || true
# This file was created automatically during an upgrade from PiAware $2
# Additional piaware configuration settings may be added below.

EOF
fi

if [ -f /root/.piaware -o -f /etc/piaware ]
then
# upgrade legacy config files
/usr/share/piaware/upgrade-config.tcl || echo >&2 <<EOF
Automatic config file upgrade failed. You may need to manually reconfigure
piaware using piaware-config or by editing /etc/piaware.conf or
/boot/piaware-config.txt. Your old config files are preserved as
/root/.piaware.old and /etc/piaware.old
EOF

[ -f /root/.piaware ] && mv /root/.piaware /root/.piaware.old
[ -f /etc/piaware ] && mv /etc/piaware /etc/piaware.old
fi
}

update_mlat_config() {
old_mlat_config=$(piaware-config -show mlat-results-format)
new_mlat_config=""

for part in $old_mlat_config
do
case "$part" in
*adsbexchange*|*167.114.60.74*)
# drop this
echo "Removed '$part' from mlat results config" >&2
;;
*)
# keep this
if [ -z "$new_mlat_config" ]
then
new_mlat_config="$part"
else
new_mlat_config="$new_mlat_config $part"
fi
;;
esac
done

if [ "$old_mlat_config" != "$new_mlat_config" ]
then
echo "Updating mlat results config to: $new_mlat_config" >&2
piaware-config mlat-results-format "$new_mlat_config"
fi
}

remove_user_and_password() {
for f in /boot/piaware-config.txt /etc/piaware.conf
do
if [ -e $f ]
then
sed -e 's@^\s*flightaware-user\s+@#flightaware-user @g' \
-e 's@^\s*flightaware-password\s+.*$@#flightware-password [removed on upgrade]@g' <$f >$f.new
mv $f.new $f
fi
done
}

case "$1" in
configure)
if ! getent passwd "$RUNAS" >/dev/null
then
useradd --system --home-dir /usr/share/$NAME --user-group "$RUNAS"
fi

if [ ! -d /var/cache/piaware ]
then
mkdir -p /var/cache/piaware
chown $RUNAS:root /var/cache/piaware
chmod 0755 /var/cache/piaware
fi

if test -n "$2" && dpkg --compare-versions "$2" lt "3.0"
then
# it's an upgrade from 2.x
# convert the old-format config files
upgrade_piaware2_config

# put something in /tmp/piaware.out to alert the user
if [ -e /tmp/piaware.out ]
then
cat <<EOF >>/tmp/piaware.out
===============================================================

PiAware 3 writes logging information to /var/log/piaware.log
Please see that file for future PiAware logging.

===============================================================
EOF
fi
fi

if test -n "$2" && dpkg --compare-versions "$2" lt "3.5.1"
then
# it's an upgrade from pre-3.5.1
# strip out mlat-forwarding configurations
update_mlat_config
fi

if dpkg --compare-versions "$2" lt-nl "3.8.0"
then
# it's an upgrade from pre-3.8.0
# strip out flightaware-user / flightaware-password
remove_user_and_password
fi

;;

abort-upgrade|abort-remove|abort-deconfigure)
;;

*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
2 changes: 2 additions & 0 deletions trixie/rsyslog/piaware.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
if $programname == 'piaware' then /var/log/piaware.log
& stop
Loading