build improvements

master
Marc Wäckerlin 8 years ago
parent 3a56116ab0
commit b8b9bcb477
  1. 8
      scripts/ax_init_standard_project.m4
  2. 24
      scripts/build-in-docker.sh

@ -178,8 +178,14 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
PACKAGE_LOGO="${PACKAGE_NAME}-logo.png"
fi
AX_SUBST(PACKAGE_LOGO)
if test -f "${PACKAGE_NAME}-icon.png"; then
if test -f "${PACKAGE_NAME}-icon.svg"; then
PACKAGE_ICON="${PACKAGE_NAME}-icon.svg"
elif test -f "${PACKAGE_NAME}-icon.png"; then
PACKAGE_ICON="${PACKAGE_NAME}-icon.png"
elif test -f "${PACKAGE_NAME}.svg"; then
PACKAGE_ICON="${PACKAGE_NAME}.svg"
elif test -f "${PACKAGE_NAME}.png"; then
PACKAGE_ICON="${PACKAGE_NAME}.png"
fi
AX_SUBST(PACKAGE_ICON)

@ -120,7 +120,7 @@ function traperror() {
fi
if [ "$wait" -eq 1 ]; then
echo " ... now you can access the docker container:"
echo " docker exec -u $(id -u) ${DOCKER_ID} -it bash"
echo " docker exec -u $(id -u) -it ${DOCKER_ID} bash"
echo -n " ... press enter to cleanup: "
read
fi
@ -133,7 +133,7 @@ function traperror() {
done
if [ "$wait" -eq 1 ]; then
echo " ... now you can access the docker container:"
echo " docker exec -u $(id -u) ${DOCKER_ID} -it bash"
echo " docker exec -u $(id -u) -it ${DOCKER_ID} bash"
echo -n " ... press enter to cleanup: "
read
fi
@ -167,14 +167,20 @@ function ifthenelse() {
set -x
OPTIONS='-o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew -y --force-yes --no-install-suggests --no-install-recommends'
docker pull $img
DOCKER_ID=$(docker run -d ${dirs[@]} ${envs[@]} -w /workdir $img sleep infinity)
trap 'traperror '"${DOCKER_ID}"' "$? ${PIPESTATUS[@]}" $LINENO $BASH_LINENO "$BASH_COMMAND" "${FUNCNAME[@]}" "${FUNCTION}"' SIGINT INT TERM EXIT
docker exec ${DOCKER_ID} apt-get update
docker exec ${DOCKER_ID} apt-get upgrade -y
docker exec ${DOCKER_ID} apt-get install -y python-software-properties software-properties-common apt-transport-https dpkg-dev lsb-release || \
docker exec ${DOCKER_ID} apt-get install -y software-properties-common apt-transport-https dpkg-dev lsb-release || \
docker exec ${DOCKER_ID} apt-get install -y python-software-properties apt-transport-https dpkg-dev lsb-release;
for f in 'libpam-systemd:amd64' 'policykit*' 'colord'; do
docker exec -it ${DOCKER_ID} bash -c "echo 'Package: $f' >> /etc/apt/preferences"
docker exec -it ${DOCKER_ID} bash -c "echo 'Pin-Priority: -100' >> /etc/apt/preferences"
docker exec -it ${DOCKER_ID} bash -c "echo >> /etc/apt/preferences"
done
docker exec ${DOCKER_ID} apt-get update ${OPTIONS}
docker exec ${DOCKER_ID} apt-get upgrade ${OPTIONS}
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} python-software-properties software-properties-common apt-transport-https dpkg-dev lsb-release || \
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} software-properties-common apt-transport-https dpkg-dev lsb-release || \
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} python-software-properties apt-transport-https dpkg-dev lsb-release;
for repo in "${repos[@]}"; do
ifthenelse "${repo}" "apt-add-repository ARG"
done
@ -182,9 +188,9 @@ for key in "${keys[@]}"; do
wget -O- "$key" \
| docker exec -i ${DOCKER_ID} apt-key add -
done
docker exec ${DOCKER_ID} apt-get update
docker exec ${DOCKER_ID} apt-get update ${OPTIONS}
for package in "${packages[@]}"; do
ifthenelse "${package}" "apt-get install -y --force-yes ARG"
ifthenelse "${package}" "apt-get install ${OPTIONS} ARG"
done
for command in "${commands[@]}"; do
ifthenelse "${command}" "ARG"

Loading…
Cancel
Save