DEB build scripts:

- fixed support for Devuan Jessie.
- dropped Sarge, Etch, Lenny, Lucid from list of supported distros.
- added auto detection of distro, distro name and architecture.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/3/head
Michele Calgaro 7 years ago
parent 55d493de58
commit 10a972bbd7

@ -56,9 +56,9 @@ A) Environment preparation
to the respectivily named folders. to the respectivily named folders.
7) Create pbuilder base package with the command: 7) Create pbuilder base package with the command:
sudo pbuilder --create sudo pbuilder create
If you wish to build for a different distro or architecture, use the command: If you wish to build for a different distro or architecture, use the command:
sudo DIST=<target distro> ARCH=<target architecture> pbuilder --create sudo DISTRIBUTION=<target distro> ARCHITECTURE=<target architecture> pbuilder create
8) Setup the build scripts locally: 8) Setup the build scripts locally:
- copy build scripts from "TDE_DIR/1_git/tde-packaging/debian/_buildscripts/local" to "TDE_DIR/buildscripts" - copy build scripts from "TDE_DIR/1_git/tde-packaging/debian/_buildscripts/local" to "TDE_DIR/buildscripts"
@ -68,7 +68,8 @@ A) Environment preparation
- edit "_config.sh" to set your preferences and check that the various folder names match the structure on your disk. - edit "_config.sh" to set your preferences and check that the various folder names match the structure on your disk.
Make sure to set the following variables: Make sure to set the following variables:
* TDE_DIR to the correct path. * TDE_DIR to the correct path.
* DISTRO, DISTRO_NAME and ARCHITECTURE to match the distro and architecture you want to build for. * DISTRO, DISTRO_NAME and ARCHITECTURE to match the distro and architecture you want to build for if different
from your current setup. Otherwise the variables can be left empty and auto detection will be performed.
* UPDATE_BRANCHES to the branches you want to keep updated from the main repositories. * UPDATE_BRANCHES to the branches you want to keep updated from the main repositories.
* DEFAULT_REPO_BRANCH to the branch to check out at the end of the repositories update process. * DEFAULT_REPO_BRANCH to the branch to check out at the end of the repositories update process.

@ -33,108 +33,103 @@ export SHELL=/bin/bash
PKGNAME_LOGFILE="__build__.log" PKGNAME_LOGFILE="__build__.log"
#-- get desired distribution and architecture #-- get desired distribution and architecture
if [ "$DIST" = "" ]; then DISTRIBUTION="$DISTRO_NAME"
DIST=$(lsb_release -cs) [[ "$DISTRO" = "" ]] && DISTRO=$(lsb_release -is | sed -e 's/\(.*\)/\L\1/')
fi [[ "$DISTRIBUTION" = "" ]] && DISTRIBUTION=$(lsb_release -cs | sed -e 's/\(.*\)/\L\1/')
DISTRIBUTION=$DIST [[ "$ARCHITECTURE" = "" ]] && ARCHITECTURE=$(dpkg --print-architecture)
if [ "$ARCH" = "" ]; then
ARCH=$(dpkg --print-architecture)
fi
ARCHITECTURE=$ARCH
if [ -n "$T" ]; then
if [ "${T##*-}" = "vm" ]; then
BUILD_VM="qemu"
T=${T%-vm}
fi
if [ "${T#*@}" = "$T" ]; then
DISTRIBUTION=${T%-*}
ARCHITECTURE=${T##*-}
else
DISTRIBUTION=${T%@*}
ARCHITECTURE=${T##*@}
fi
if [ "${DISTRIBUTION##*-}" = "backports" ]; then
BACKPORTS="yes"
DISTRIBUTION=${DISTRIBUTION%-backports}
fi
fi
BASETGZ="/var/cache/pbuilder/base-$DIST@$ARCH.tgz" BASETGZ="/var/cache/pbuilder/base-$DISTRIBUTION@$ARCHITECTURE.tgz"
#-- select apt components #-- select apt components
case "$DISTRIBUTION" in case "$DISTRIBUTION" in
sid|buster|stretch|jessie|wheezy|squeeze|lenny|etch|sarge) jessie)
COMPONENTS="main contrib non-free" if [[ "$DISTRO" = "devuan" ]]; then
;; COMPONENTS="main"
DEBOOTSTRAPOPTS=(--variant=buildd --no-check-gpg)
ceres|beowulf|ascii) EXTRAPACKAGES="$EXTRAPACKAGES devuan-keyring"
COMPONENTS="main" else
DEBOOTSTRAPOPTS=(--variant=buildd --no-check-gpg) COMPONENTS="main contrib non-free"
EXTRAPACKAGES="$EXTRAPACKAGES devuan-keyring" fi
;; ;;
bionic|artful|zesty|yakkety|xenial|wily|vivid|utopic|trusty|saucy|raring|quantal|precise|oneiric|natty|maverick|lucid) sid|buster|stretch|wheezy|squeeze)
COMPONENTS="main restricted universe multiverse" COMPONENTS="main contrib non-free"
DEBOOTSTRAPOPTS=(--variant=buildd) ;;
;;
ceres|beowulf|ascii)
raspbian-jessie|raspbian-wheezy) COMPONENTS="main"
COMPONENTS="main contrib non-free" DEBOOTSTRAPOPTS=(--variant=buildd --no-check-gpg)
DEBOOTSTRAPOPTS=(--variant=buildd --no-check-gpg) EXTRAPACKAGES="$EXTRAPACKAGES devuan-keyring"
;; ;;
bionic|artful|zesty|yakkety|xenial|wily|vivid|utopic|trusty|saucy|raring|quantal|precise|oneiric|natty|maverick)
COMPONENTS="main restricted universe multiverse"
DEBOOTSTRAPOPTS=(--variant=buildd)
;;
raspbian-jessie|raspbian-wheezy)
COMPONENTS="main contrib non-free"
DEBOOTSTRAPOPTS=(--variant=buildd --no-check-gpg)
;;
esac esac
EXTRAPACKAGES="$EXTRAPACKAGES fakeroot apt-transport-https ca-certificates" EXTRAPACKAGES="$EXTRAPACKAGES fakeroot apt-transport-https ca-certificates"
#-- select base apt sources #-- select base apt sources
case "$DISTRIBUTION" in case "$DISTRIBUTION" in
sid|buster|stretch|jessie|wheezy) jessie)
MIRRORSITE=http://deb.debian.org/debian if [[ "$DISTRO" = "devuan" ]]; then
;; MIRRORSITE=http://auto.mirror.devuan.org/merged
else
squeeze|lenny|etch|sarge) MIRRORSITE=http://deb.debian.org/debian
MIRRORSITE=http://archive.debian.org/debian fi
OTHERMIRROR="#deb http://archive.debian.org/backports.org $DISTRIBUTION-backports main contrib non-free" ;;
;;
sid|buster|stretch|wheezy)
ceres|beowulf|ascii) MIRRORSITE=http://deb.debian.org/debian
MIRRORSITE=http://auto.mirror.devuan.org/merged ;;
;;
squeeze)
bionic|artful|zesty|yakkety|wily|vivid|trusty|precise) MIRRORSITE=http://archive.debian.org/debian
if [ "$ARCHITECTURE" = "amd64" ] || [ "$ARCHITECTURE" = "i386" ]; then ;;
MIRRORSITE=http://archive.ubuntu.com/ubuntu
else ceres|beowulf|ascii)
MIRRORSITE=http://ports.ubuntu.com MIRRORSITE=http://auto.mirror.devuan.org/merged
fi ;;
;;
bionic|artful|zesty|yakkety|wily|vivid|trusty|precise)
xenial) if [ "$ARCHITECTURE" = "amd64" ] || [ "$ARCHITECTURE" = "i386" ]; then
if [ "$ARCHITECTURE" = "amd64" ] || [ "$ARCHITECTURE" = "i386" ]; then MIRRORSITE=http://archive.ubuntu.com/ubuntu
MIRRORSITE=http://archive.ubuntu.com/ubuntu else
else MIRRORSITE=http://ports.ubuntu.com
MIRRORSITE=http://ports.ubuntu.com fi
fi ;;
OTHERMIRROR="deb $MIRRORSITE $DISTRIBUTION-updates $COMPONENTS"
;; xenial)
if [ "$ARCHITECTURE" = "amd64" ] || [ "$ARCHITECTURE" = "i386" ]; then
utopic|saucy|raring|quantal|oneiric|natty|maverick|lucid) MIRRORSITE=http://archive.ubuntu.com/ubuntu
MIRRORSITE=http://old-releases.ubuntu.com/ubuntu else
;; MIRRORSITE=http://ports.ubuntu.com
fi
raspbian-jessie|raspbian-wheezy) OTHERMIRROR="deb $MIRRORSITE $DISTRIBUTION-updates $COMPONENTS"
MIRRORSITE=http://ftp.fi.muni.cz/pub/linux/raspbian/raspbian ;;
;;
utopic|saucy|raring|quantal|oneiric|natty|maverick)
MIRRORSITE=http://old-releases.ubuntu.com/ubuntu
;;
raspbian-jessie|raspbian-wheezy)
MIRRORSITE=http://ftp.fi.muni.cz/pub/linux/raspbian/raspbian
;;
esac esac
if [ -n "${ARCH}" ]; then if [ -n "${ARCHITECTURE}" ]; then
NAME="$NAME-$ARCH" NAME="$NAME-$ARCHITECTURE"
DEBOOTSTRAPOPTS=("--arch" "$ARCH" "${DEBOOTSTRAPOPTS[@]}") DEBOOTSTRAPOPTS=("--arch" "$ARCHITECTURE" "${DEBOOTSTRAPOPTS[@]}")
fi fi
BUILDRESULT="/var/cache/pbuilder/$DISTRIBUTION/result/" BUILDRESULT="/var/cache/pbuilder/$DISTRO-$DISTRIBUTION/result/"
APTCACHE="/var/cache/pbuilder/aptcache/$DISTRIBUTION/" APTCACHE="/var/cache/pbuilder/aptcache/$DISTRO-$DISTRIBUTION/"
if [ -n "$APTCACHE" ] && [ ! -d "$APTCACHE" ]; then if [ -n "$APTCACHE" ] && [ ! -d "$APTCACHE" ]; then
mkdir $APTCACHE mkdir $APTCACHE
fi fi
@ -168,9 +163,8 @@ case "$DISTRIBUTION" in
PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-apt" PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-apt"
;; ;;
jessie|wheezy|squeeze|lenny|etch|sarge|\ jessie|wheezy|squeeze|raspbian-jessie|raspbian-wheezy|\
raspbian-jessie|raspbian-wheezy|\ yakkety|xenial|wily|vivid|utopic|trusty|saucy|raring|quantal|precise|oneiric|natty|maverick)
yakkety|xenial|wily|vivid|utopic|trusty|saucy|raring|quantal|precise|oneiric|natty|maverick|lucid)
PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-aptitude" PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-aptitude"
;; ;;
esac esac

@ -54,6 +54,12 @@ function _set_path_variables()
{ {
# Set useful path variables # Set useful path variables
set -a set -a
#-- get desired distribution and architecture
[[ "$DISTRO" = "" ]] && DISTRO=$(lsb_release -is | sed -e 's/\(.*\)/\L\1/')
[[ "$DISTRO_NAME" = "" ]] && DISTRO_NAME=$(lsb_release -cs | sed -e 's/\(.*\)/\L\1/')
[[ "$ARCHITECTURE" = "" ]] && ARCHITECTURE=$(dpkg --print-architecture)
REPO_DIR="$TDE_DIR/$CFG_GIT_DIR" REPO_DIR="$TDE_DIR/$CFG_GIT_DIR"
REPO_TDE="$TDE_DIR/$CFG_GIT_DIR/tde" REPO_TDE="$TDE_DIR/$CFG_GIT_DIR/tde"
REPO_TDE_MAIN="$REPO_TDE/main" REPO_TDE_MAIN="$REPO_TDE/main"
@ -111,6 +117,7 @@ function init_common()
# -- Need to use a "here string" otherwise if the DISTRO_FOUND value is modified # -- Need to use a "here string" otherwise if the DISTRO_FOUND value is modified
# -- inside the while loop, this would not remember after the loop. # -- inside the while loop, this would not remember after the loop.
DISTRO_FOUND="n" DISTRO_FOUND="n"
OLD_IFS=$IFS && IFS=$' \t'
while read l_distro l_version l_name l_rel_suffix l_packaging_path; do while read l_distro l_version l_name l_rel_suffix l_packaging_path; do
if [ "$l_distro" = "$DISTRO" -a "$l_name" = "$DISTRO_NAME" ]; then if [ "$l_distro" = "$DISTRO" -a "$l_name" = "$DISTRO_NAME" ]; then
DISTRO_FOUND="y" DISTRO_FOUND="y"
@ -124,6 +131,7 @@ function init_common()
break break
fi fi
done <<< $(cat $DISTS_FILE | grep -E "^(\s*[^#\s]+\s+[^\s]+.*)$") done <<< $(cat $DISTS_FILE | grep -E "^(\s*[^#\s]+\s+[^\s]+.*)$")
IFS=$OLD_IFS
if [ "$DISTRO_FOUND" != "y" ]; then if [ "$DISTRO_FOUND" != "y" ]; then
echo -e "${CLightRed} --- ERROR ---${CNone}" echo -e "${CLightRed} --- ERROR ---${CNone}"
echo -e "The specified distribution (${CYellow}$DISTRO $DISTRO_NAME${CNone}) is not supported." echo -e "The specified distribution (${CYellow}$DISTRO $DISTRO_NAME${CNone}) is not supported."

@ -14,9 +14,9 @@ DEFAULT_REPO_BRANCH="master" # After update in completed, switch repo to th
# Build information # Build information
#---------------------------- #----------------------------
TDE_RELEASE="14.1.0" # TDE release number TDE_RELEASE="14.1.0" # TDE release number
DISTRO="debian" # Distro family DISTRO="" # Distro family (leave empty for auto-detection). For ex. debian
DISTRO_NAME="buster" # Distro name of specific version DISTRO_NAME="" # Distro name of specific version (leave empty for auto-detection). For ex. buster
ARCHITECTURE="amd64" # Build for this architecture ARCHITECTURE="" # Build for this architecture (leave empty for auto-detection). For ex. amd64
USE_PREBUILD_EXTRA_DEPS="y" # If == "y", use pre-built extra dependency packages USE_PREBUILD_EXTRA_DEPS="y" # If == "y", use pre-built extra dependency packages
BUILD_DEFAULT_OPTIONS="-g -lr" # Default building options (pbuilder) BUILD_DEFAULT_OPTIONS="-g -lr" # Default building options (pbuilder)
GPG_SIGN_KEYID="" # Use this GPG key to sign packages. If null, packages will not be signed GPG_SIGN_KEYID="" # Use this GPG key to sign packages. If null, packages will not be signed

@ -47,7 +47,8 @@ END_D05_01
# Get building branch from .tdescmrevision file # Get building branch from .tdescmrevision file
if [[ -f "$MOD_BUILD_PATH/.tdescmrevision" ]]; then if [[ -f "$MOD_BUILD_PATH/.tdescmrevision" ]]; then
BUILD_BRANCH=`sed -r "s/([^-]+)-.*/\1/" "$MOD_BUILD_PATH/.tdescmrevision"` BUILD_BRANCH=`sed -r "s/([^-]+)-.*/\1/" "$MOD_BUILD_PATH/.tdescmrevision"`
while read l_branch l_repo l_component; do OLD_IFS=$IFS && IFS=$' \t'
while read l_branch l_repo l_component; do
if [ "$l_branch" = "$BUILD_BRANCH" ]; then if [ "$l_branch" = "$BUILD_BRANCH" ]; then
cat <<END_D05_02 >> "$PBUILDER_DEPS_HOOK" cat <<END_D05_02 >> "$PBUILDER_DEPS_HOOK"
echo "deb [trusted=yes] $l_repo $DISTRO_NAME $l_component" >> /etc/apt/sources.list echo "deb [trusted=yes] $l_repo $DISTRO_NAME $l_component" >> /etc/apt/sources.list
@ -55,6 +56,7 @@ END_D05_02
break break
fi fi
done <<< $(cat "$SCRIPT_DIR/internals/extra_deps.txt" | grep -E "^[[:space:]]*[^#[:space:]]+[[:space:]]+[^[:space:]]+.*$") done <<< $(cat "$SCRIPT_DIR/internals/extra_deps.txt" | grep -E "^[[:space:]]*[^#[:space:]]+[[:space:]]+[^[:space:]]+.*$")
IFS=$OLD_IFS
fi fi
fi fi
cat <<END_D05_03 >> "$PBUILDER_DEPS_HOOK" cat <<END_D05_03 >> "$PBUILDER_DEPS_HOOK"

@ -11,8 +11,7 @@
# #
DISTROS=" DISTROS="
# -- debian -- # -- debian --
debian 5.0 lenny '' '' debian 6.0 squeeze '' ''
debian 6.0 squeeze '' ''
debian 7.0 wheezy '' '' debian 7.0 wheezy '' ''
debian 8.0 jessie '' '' debian 8.0 jessie '' ''
debian 9.0 stretch '' '' debian 9.0 stretch '' ''
@ -28,8 +27,7 @@ DISTROS="
raspbian 8.0 raspbian-jessie '' '' raspbian 8.0 raspbian-jessie '' ''
raspbian 9.0 raspbian-stretch '' '' raspbian 9.0 raspbian-stretch '' ''
# -- ubuntu -- # -- ubuntu --
ubuntu 10.04 lucid '' '' ubuntu 10.10 maverick '' ''
ubuntu 10.10 maverick '' ''
ubuntu 11.04 natty '' '' ubuntu 11.04 natty '' ''
ubuntu 11.10 oneiric '' '' ubuntu 11.10 oneiric '' ''
ubuntu 12.04 precise '' '' ubuntu 12.04 precise '' ''

Loading…
Cancel
Save