Skip to content

Instantly share code, notes, and snippets.

@peat-psuwit
Created February 4, 2020 18:09
Show Gist options
  • Save peat-psuwit/94a9d34b80e3ebf2027fcc2e231de6b2 to your computer and use it in GitHub Desktop.
Save peat-psuwit/94a9d34b80e3ebf2027fcc2e231de6b2 to your computer and use it in GitHub Desktop.
Build a minimalist Debian packages build server (UBports repo)
CCACHEDIR=/var/cache/pbuilder/ccache/
EXTRAPACKAGES=pkg-create-dbgsym
export DEB_BUILD_OPTIONS=parallel=`nproc`
#!/bin/sh -ex
if ! [ -e "$HOME/.pbuilderrc" ]; then
echo "Copy .pbuilderrc first"
exit 1
fi
apt install wget cowbuilder apt-utils nginx tmux
KEYRING=$(mktemp --tmpdir XXXXXXX.gpg)
wget -O "$KEYRING" https://repo.ubports.com/keyring.gpg
cowbuilder create \
--basepath /var/cache/pbuilder/bases/xenial+ubports.cow \
--distribution xenial --components "main universe" \
--othermirror "deb http://ports.ubuntu.com/ubuntu-ports xenial-updates main universe|deb http://repo.ubports.com/ xenial main" \
--keyring "$KEYRING"
rm "$KEYRING"
mkdir -p /var/www/html/repo/xenial
#!/bin/sh -ex
DISTS=xenial
for DIST in $DISTS; do
cd /var/www/html/repo/$DIST || exit 1
apt-ftparchive packages pool | tee Packages | gzip >Packages.gz
apt-ftparchive sources pool | tee Sources | gzip >Sources.gz
apt-ftparchive release \
-o APT::FTPArchive::Release::Origin="Peat SCW" \
. | tee Release | gzip >Release.gz
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment