├── debian ├── compat ├── source │ └── format ├── flightaware-apt-repository.install ├── flightaware-apt-repository.maintscript ├── flightaware-apt-repository.default ├── control ├── rules ├── changelog ├── flightaware-apt-repository.postrm └── flightaware-apt-repository.postinst ├── README.md ├── usr └── share │ └── keyrings │ └── flightaware-archive-keyring.gpg └── Jenkinsfile /debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /debian/flightaware-apt-repository.install: -------------------------------------------------------------------------------- 1 | usr/share/keyrings/flightaware-archive-keyring.gpg 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flightaware-apt-repository 2 | Client-side package for configuring FlightAware APT repository sources 3 | -------------------------------------------------------------------------------- /debian/flightaware-apt-repository.maintscript: -------------------------------------------------------------------------------- 1 | rm_conffile /etc/apt/trusted.gpg.d/flightaware-archive-keyring.gpg 1.2~ 2 | -------------------------------------------------------------------------------- /usr/share/keyrings/flightaware-archive-keyring.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flightaware/flightaware-apt-repository/master/usr/share/keyrings/flightaware-archive-keyring.gpg -------------------------------------------------------------------------------- /debian/flightaware-apt-repository.default: -------------------------------------------------------------------------------- 1 | # This file controls the behaviour of the flightaware-apt-repository package. 2 | # Run "dpkg-reconfigure flightaware-apt-repository" after making changes. 3 | 4 | # Should we create/update a sources.list file? 5 | ENABLED=yes 6 | 7 | # Should we use the staging/testing repository, not the main repository? 8 | # (only of interest to developers) 9 | USE_TESTING_REPO=no 10 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: flightaware-apt-repository 2 | Section: embedded 3 | Priority: extra 4 | Maintainer: FlightAware Developers 5 | Build-Depends: debhelper (>= 10) 6 | Standards-Version: 4.5.1 7 | Homepage: https://github.com/flightaware/flightaware-apt-repository 8 | 9 | Package: flightaware-apt-repository 10 | Architecture: all 11 | Conflicts: piaware-repository, piaware-repository-testing, flightaware-apt-repository-testing 12 | Replaces: piaware-repository, piaware-repository-testing, flightaware-apt-repository-testing 13 | Description: Installs the FlightAware APT repository configuration for 14 | PiAware packages 15 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # See debhelper(7) (uncomment to enable) 3 | # output every command that modifies files on the build system. 4 | #export DH_VERBOSE = 1 5 | 6 | 7 | # see FEATURE AREAS in dpkg-buildflags(1) 8 | #export DEB_BUILD_MAINT_OPTIONS = hardening=+all 9 | 10 | # see ENVIRONMENT in dpkg-buildflags(1) 11 | # package maintainers to append CFLAGS 12 | #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic 13 | # package maintainers to append LDFLAGS 14 | #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed 15 | 16 | 17 | %: 18 | dh $@ 19 | 20 | 21 | # dh_make generated override targets 22 | # This is example for Cmake (See https://bugs.debian.org/641051 ) 23 | #override_dh_auto_configure: 24 | # dh_auto_configure -- \ 25 | # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) 26 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | flightaware-apt-repository (1.2) stable; urgency=medium 2 | 3 | * Remove the separate flightaware-apt-repository-testing package 4 | * Add a configuration file, /etc/default/flightaware-apt-repository 5 | * Regenerate the sources.list file when reconfigured, even if it already exists 6 | * If our sources.list was renamed with a .disabled suffix, don't regenerate it 7 | * Move the FA keyring from /etc/apt/trusted.gpg.d to /usr/share/keyrings 8 | * Explicitly enable use of the FA keyring only for the FA repository 9 | * If the target distribution appears to be unsupported, warn but continue anyway 10 | 11 | -- Oliver Jowett Mon, 06 Nov 2023 21:38:09 +0800 12 | 13 | flightaware-apt-repository (1.1) stable; urgency=medium 14 | 15 | * Detect OS version in a more reliable way since VERSION_CODENAME is not present on Stretch 16 | 17 | -- Eric Tran Wed, 07 Dec 2022 19:41:43 -0600 18 | 19 | flightaware-apt-repository (1.0) stable; urgency=medium 20 | 21 | * Initial release configures apt sources list automatically based on current OS 22 | 23 | -- Eric Tran Tue, 06 Dec 2022 14:33:43 -0600 24 | -------------------------------------------------------------------------------- /debian/flightaware-apt-repository.postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postrm script for flightaware-apt-repository 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `purge' 11 | # * `upgrade' 12 | # * `failed-upgrade' 13 | # * `abort-install' 14 | # * `abort-install' 15 | # * `abort-upgrade' 16 | # * `disappear' 17 | # 18 | # for details, see http://www.debian.org/doc/debian-policy/ or 19 | # the debian-policy package 20 | 21 | 22 | case "$1" in 23 | purge) 24 | rm -f /etc/apt/sources.list.d/flightaware-apt-repository.list 25 | ;; 26 | 27 | remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 28 | ;; 29 | 30 | *) 31 | echo "postrm called with unknown argument \`$1'" >&2 32 | exit 1 33 | ;; 34 | esac 35 | 36 | # dh_installdeb will replace this with shell code automatically 37 | # generated by other debhelper scripts. 38 | 39 | #DEBHELPER# 40 | 41 | exit 0 42 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | node(label: 'raspberrypi') { 2 | properties([ 3 | disableConcurrentBuilds(), 4 | durabilityHint(hint: 'PERFORMANCE_OPTIMIZED') 5 | ]) 6 | 7 | def srcdir = "${WORKSPACE}/src" 8 | def resultsdir = "results" 9 | 10 | // This one is a little different to the usual boilerplate, because we 11 | // want to build a single arch-independent package that works on multiple 12 | // distribution versions, not one per version. We build once on 13 | // build_dist / build_arch and then test-install against dist_and_arch_list 14 | 15 | def build_dist = "buster" 16 | def build_arch = "armhf" 17 | 18 | // Checkout source code into a src directory 19 | stage("Checkout") { 20 | sh "rm -fr ${srcdir}" 21 | sh "mkdir ${srcdir}" 22 | dir(srcdir) { 23 | checkout scm 24 | } 25 | } 26 | 27 | // Build package and store into a results directory 28 | stage("Build") { 29 | sh "rm -fr ${resultsdir}" 30 | sh "mkdir -p ${resultsdir}" 31 | dir(srcdir) { 32 | sh "DIST=${build_dist} ARCH=${build_arch} BRANCH=${env.BRANCH_NAME} pdebuild --use-pdebuild-internal --debbuildopts -b --buildresult ${WORKSPACE}/${resultsdir}" 33 | } 34 | archiveArtifacts artifacts: "${resultsdir}/*.deb", fingerprint: true 35 | } 36 | 37 | def dist_arch_list = [ 38 | ["bookworm", "armhf"], 39 | ["bookworm", "arm64"], 40 | ["bullseye", "armhf"], 41 | ["bullseye", "arm64"], 42 | ["buster", "armhf"] 43 | ] 44 | 45 | for (int i = 0; i < dist_arch_list.size(); ++i) { 46 | def dist_and_arch = dist_arch_list[i] 47 | def dist = dist_and_arch[0] 48 | def arch = dist_and_arch[1] 49 | 50 | stage("Test install on ${dist} (${arch})") { 51 | sh "BRANCH=${env.BRANCH_NAME} ARCH=${arch} /build/pi-builder/scripts/validate-packages.sh ${dist} ${resultsdir}/flightaware-apt-repository_*.deb" 52 | } 53 | } 54 | 55 | // Deploy to all distribution repositories 56 | stage('Deploy to internal repository') { 57 | for (int i = 0; i < dist_arch_list.size(); ++i) { 58 | def dist_and_arch = dist_arch_list[i] 59 | def dist = dist_and_arch[0] 60 | def arch = dist_and_arch[1] 61 | sh "/build/pi-builder/scripts/deploy.sh -distribution ${dist} -architectures ${arch} -branch ${env.BRANCH_NAME} ${resultsdir}/*.deb" 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /debian/flightaware-apt-repository.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # postinst script for flightaware-apt-repository 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `configure' 10 | # * `abort-upgrade' 11 | # * `abort-remove' `in-favour' 12 | # 13 | # * `abort-remove' 14 | # * `abort-deconfigure' `in-favour' 15 | # `removing' 16 | # 17 | # for details, see http://www.debian.org/doc/debian-policy/ or 18 | # the debian-policy package 19 | 20 | DEFAULTS=/etc/default/flightaware-apt-repository 21 | SOURCES_LIST=/etc/apt/sources.list.d/flightaware-apt-repository.list 22 | 23 | if [ -f ${DEFAULTS} ]; then source ${DEFAULTS}; fi 24 | : ${ENABLED:=yes} 25 | : ${USE_TESTING_REPO:=no} 26 | 27 | rm_conffile() { 28 | local PKGNAME="$1" 29 | local CONFFILE="$2" 30 | 31 | [ -e "$CONFFILE" ] || return 0 32 | 33 | local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')" 34 | local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \ 35 | sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")" 36 | if [ "$md5sum" != "$old_md5sum" ]; then 37 | echo "Obsolete conffile $CONFFILE has been modified by you." 38 | echo "Saving as $CONFFILE.dpkg-bak ..." 39 | mv -f "$CONFFILE" "$CONFFILE".dpkg-bak 40 | else 41 | echo "Removing obsolete conffile $CONFFILE ..." 42 | rm -f "$CONFFILE" 43 | fi 44 | } 45 | 46 | update_config () { 47 | if [ "${ENABLED}" != "yes" ]; then 48 | echo "flightaware-apt-repository: disabled in ${DEFAULTS}, not changing any files" >&2 49 | return 0 50 | fi 51 | 52 | if [ -e ${SOURCES_LIST}.disabled ]; then 53 | echo "flightaware-apt-repository: ${SOURCES_LIST}.disabled exists, not changing any files" >&2 54 | return 0 55 | fi 56 | 57 | # Check OS version, determine supported architectures 58 | if [ -x "$(command -v lsb_release)" ]; then 59 | codename="$(lsb_release -c -s)" 60 | fi 61 | 62 | if [ -z "$codename" ]; then 63 | # Check /etc/os-release 64 | . '/etc/os-release' 65 | 66 | case "$VERSION_ID" in 67 | "10") codename="buster" ;; 68 | "11") codename="bullseye" ;; 69 | "12") codename="bookworm" ;; 70 | *) codename="unknown" ;; 71 | esac 72 | fi 73 | 74 | supported=false 75 | for arch in $(dpkg --print-architecture) $(dpkg --print-foreign-architectures) 76 | do 77 | case "$codename:$arch" in 78 | buster:armhf) supported=true; break ;; 79 | bullseye:armhf|bullseye:arm64) supported=true; break ;; 80 | bookworm:armhf|bookworm:arm64) supported=true; break ;; 81 | esac 82 | done 83 | 84 | if ! $supported 85 | then 86 | echo "flightaware-apt-repository: FlightAware does not provide packages for your distribution/architecture, the generated apt configuration may not work" >&2 87 | fi 88 | 89 | if [ "$USE_TESTING_REPO" = "yes" ] 90 | then 91 | url="http://flightaware.com/adsb/piaware/files/testing-bis" 92 | else 93 | url="http://flightaware.com/adsb/piaware/files/packages" 94 | fi 95 | 96 | # Cleanup deprecated sources.list from old packages, if present 97 | rm_conffile piaware-repository /etc/apt/sources.list.d/piaware-${codename}.list 98 | rm_conffile piaware-repository-testing /etc/apt/sources.list.d/piaware-${codename}-testing.list 99 | rm_conffile flightaware-repository-testing /etc/apt/sources.list.d/flightaware-apt-repository-testing.list 100 | 101 | # (re)generate flightaware-apt-repository.list 102 | cat > ${SOURCES_LIST}.dpkg-new << EOF 103 | # This file is automatically generated by the flightaware-apt-repository package 104 | # to point to the correct FlightAware repository for the currently installed Debian OS. 105 | # Any changes made to this file will be lost when flightaware-apt-repository is reconfigured. 106 | # 107 | # To disable generation of this file: 108 | # purge the flightaware-apt-repository package; or 109 | # set ENABLED=no in ${DEFAULTS}; or 110 | # rename this file to ${SOURCES_LIST}.disabled 111 | 112 | deb [ signed-by=/usr/share/keyrings/flightaware-archive-keyring.gpg ] $url ${codename} piaware 113 | EOF 114 | if ! cmp -s $SOURCES_LIST ${SOURCES_LIST}.dpkg-new 115 | then 116 | # no existing file, or something changed 117 | mv ${SOURCES_LIST}.dpkg-new $SOURCES_LIST 118 | echo "flightaware-apt-repository: regenerated APT configuration $SOURCES_LIST" >&2 119 | echo "flightaware-apt-repository: please run 'sudo apt update' to use the new configuration" >&2 120 | else 121 | # no changes 122 | rm ${SOURCES_LIST}.dpkg-new 123 | fi 124 | } 125 | 126 | case "$1" in 127 | configure) 128 | update_config 129 | ;; 130 | 131 | abort-upgrade|abort-remove|abort-deconfigure) 132 | ;; 133 | 134 | *) 135 | echo "postinst called with unknown argument \`$1'" >&2 136 | exit 1 137 | ;; 138 | esac 139 | 140 | # dh_installdeb will replace this with shell code automatically 141 | # generated by other debhelper scripts. 142 | 143 | #DEBHELPER# 144 | 145 | exit 0 146 | --------------------------------------------------------------------------------