Files
docker-cli/components/packaging/deb/build-deb
Daniel Hiltgen 9ae8fd5cd9 Change deb package filenames to be unique
It's generally bad-form to generate two identically named package files
that are actually different, so we should name our packages based on
the distro and version, not just the distro.

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
(cherry picked from commit 13bde85f0067a751f775d31919705645ecc0a6d7)
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
Upstream-commit: 3c757b281bb623d9622c74143340fd892c8655ad
Component: packaging
2018-09-04 12:43:44 -07:00

41 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -x
set -e
EPOCH="${EPOCH:-}"
EPOCH_SEP=""
if [[ ! -z "$EPOCH" ]]; then
EPOCH_SEP=":"
fi
if [[ -z "$DEB_VERSION" ]]; then
echo "DEB_VERSION is required to build deb packages"
exit 1
fi
echo VERSION AAA $VERSION
VERSION=${VERSION:-$( cat cli/VERSION )}
echo VERSION bbb $VERSION
debSource="$(awk -F ': ' '$1 == "Source" { print $2; exit }' debian/control)"
debMaintainer="$(awk -F ': ' '$1 == "Maintainer" { print $2; exit }' debian/control)"
debDate="$(date --rfc-2822)"
cat > "debian/changelog" <<-EOF
$debSource (${EPOCH}${EPOCH_SEP}${DEB_VERSION}-0~${DISTRO}-${SUITE}) $SUITE; urgency=low
* Version: $VERSION
-- $debMaintainer $debDate
EOF
# The space above at the start of the line for the debMaintainer is very important
# Give the script a git commit because it wants it
export DOCKER_GITCOMMIT=${DOCKER_GITCOMMIT-$(cd cli; $GIT_COMMAND rev-parse --short HEAD)}
echo VERSION BBB $VERSION
dpkg-buildpackage -uc -us -I.git
destination="/build"
mkdir -p "$destination"
mv -v /root/docker* "$destination"