From eebfe075f936f2e7a97d7a44d15e413115467f78 Mon Sep 17 00:00:00 2001 From: Rik Veenboer Date: Wed, 30 Dec 2015 12:08:57 +0100 Subject: [PATCH] Cleanup make/build scripts, fix newlines in scripts --- bin/build | 2 +- bin/make | 2 +- build/Makefile | 10 +++------- build/scripts/backintime.sh | 14 +++++++++++++- build/scripts/headphones.sh | 19 ++++++++++++++++++- 5 files changed, 36 insertions(+), 11 deletions(-) diff --git a/bin/build b/bin/build index 5724ce7..7010dbd 100644 --- a/bin/build +++ b/bin/build @@ -1 +1 @@ -$DOCKER_HOME/bin/make $1 build \ No newline at end of file +$DOCKER_HOME/bin/make $1 build diff --git a/bin/make b/bin/make index 13a1072..a96cdc4 100644 --- a/bin/make +++ b/bin/make @@ -1,5 +1,5 @@ FILE=$DOCKER_HOME/images/$1.mk -if [[ ! -e $FILE ]]; then +if [ ! -e $FILE ]; then DELETE=true FILE="$(mktemp)" cat <<- EOF > $FILE diff --git a/build/Makefile b/build/Makefile index 6b45b24..82a3446 100644 --- a/build/Makefile +++ b/build/Makefile @@ -1,12 +1,8 @@ -RANDOM = $(shell bash -c 'echo $$RANDOM') -HOME = $(DOCKER_HOME) -BASE = $(HOME)/build TMP = /build/tmp FROM = ubuntu:trusty -INTERFACE = eth0 MODE = normal ARGS = --rm=false --no-cache=false -include $(wildcard $(HOME)/build/make/*.mk) +include $(wildcard $(DOCKER_HOME)/build/make/*.mk) define add @echo 'ADD $(1) $(2)' >> ${FILE} @@ -40,11 +36,11 @@ build: prepare base $(call script,cleanup) @echo 'RUN chmod +x /opt/init.d/* || :' >> ${FILE} @echo 'CMD ["/opt/init"]' >> ${FILE} - @docker build -t $(NAME):$(VERSION) $(ARGS) -f $(FILE) $(BASE) + @docker build -t $(NAME):$(VERSION) $(ARGS) -f $(FILE) $(DOCKER_HOME)/build @rm ${FILE} prepare: - @$(eval FILE = $(shell mktemp -p $(BASE))) + @$(eval FILE = $(shell mktemp -p $(DOCKER_HOME)/build)) @echo FROM $(FROM) > ${FILE} @echo ENV MODE $(MODE) >> ${FILE} $(call add,config,/build/config) diff --git a/build/scripts/backintime.sh b/build/scripts/backintime.sh index df439d7..f5bd428 100644 --- a/build/scripts/backintime.sh +++ b/build/scripts/backintime.sh @@ -1 +1,13 @@ -#!/bin/bash set -e source /build/config set -x ## Environment ## BackInTime apt_get_install_permanent backintime-common python-dbus ## Configuration \ No newline at end of file +#!/bin/bash +set -e +source /build/config +set -x + +## Environment + + +## BackInTime +apt_get_install_permanent backintime-common python-dbus + +## Configuration + diff --git a/build/scripts/headphones.sh b/build/scripts/headphones.sh index b0f7578..0177d39 100644 --- a/build/scripts/headphones.sh +++ b/build/scripts/headphones.sh @@ -1 +1,18 @@ -#!/bin/bash set -e source /build/config set -x ## Environment export_env HEADPHONES_CONFIG /host/etc/headphones/config.ini export_env HEADPHONES_CONFIG_DEFAULT /opt/headphones/config.ini export_env HEADPHONES_DATA /host/var/lib/headphones ## Headphones cd /opt git clone https://github.com/rembo10/headphones.git ## Encoders echo "deb http://ppa.launchpad.net/mc3man/trusty-media/ubuntu $(lsb_release -c -s) main" | sudo tee -a /etc/apt/sources.list apt-get update apt_get_install_permanent --force-yes ffmpeg libmp3lame0 libavcodec-extra-54 \ No newline at end of file +#!/bin/bash +set -e +source /build/config +set -x + +## Environment +export_env HEADPHONES_CONFIG /host/etc/headphones/config.ini +export_env HEADPHONES_CONFIG_DEFAULT /opt/headphones/config.ini +export_env HEADPHONES_DATA /host/var/lib/headphones + +## Headphones +cd /opt +git clone https://github.com/rembo10/headphones.git + +## Encoders +echo "deb http://ppa.launchpad.net/mc3man/trusty-media/ubuntu $(lsb_release -c -s) main" | sudo tee -a /etc/apt/sources.list +apt-get update +apt_get_install_permanent --force-yes ffmpeg libmp3lame0 libavcodec-extra-54