From 65d4b1bb7aea082b27cd9bd04a091d32dfacb959 Mon Sep 17 00:00:00 2001 From: Jessica Frazelle Date: Fri, 15 Jan 2016 15:29:43 -0800 Subject: [PATCH 1/2] fix selinux version for contrib/builder generation Signed-off-by: Jessica Frazelle Upstream-commit: 3466e5c91111c43fb4a9850d3dc1ba417be478a6 Component: engine --- components/engine/contrib/builder/rpm/fedora-22/Dockerfile | 4 ++-- components/engine/contrib/builder/rpm/fedora-23/Dockerfile | 4 ++-- components/engine/contrib/builder/rpm/generate.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/engine/contrib/builder/rpm/fedora-22/Dockerfile b/components/engine/contrib/builder/rpm/fedora-22/Dockerfile index 912be90a46..9b4e5493c8 100644 --- a/components/engine/contrib/builder/rpm/fedora-22/Dockerfile +++ b/components/engine/contrib/builder/rpm/fedora-22/Dockerfile @@ -7,7 +7,7 @@ FROM fedora:22 RUN dnf install -y @development-tools fedora-packager RUN dnf install -y btrfs-progs-devel device-mapper-devel glibc-static libseccomp-devel libselinux-devel libtool-ltdl-devel selinux-policy selinux-policy-devel sqlite-devel tar -ENV SECCOMP_VERSION v2.2.3 +ENV SECCOMP_VERSION 2.2.3 RUN buildDeps=' \ automake \ libtool \ @@ -15,7 +15,7 @@ libtool \ && set -x \ && yum install -y $buildDeps \ && export SECCOMP_PATH=$(mktemp -d) \ -&& git clone -b "$SECCOMP_VERSION" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \ +&& git clone -b "v${SECCOMP_VERSION}" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \ && ( \ cd "$SECCOMP_PATH" \ && ./autogen.sh \ diff --git a/components/engine/contrib/builder/rpm/fedora-23/Dockerfile b/components/engine/contrib/builder/rpm/fedora-23/Dockerfile index bfa70617de..c3314f9ec6 100644 --- a/components/engine/contrib/builder/rpm/fedora-23/Dockerfile +++ b/components/engine/contrib/builder/rpm/fedora-23/Dockerfile @@ -7,7 +7,7 @@ FROM fedora:23 RUN dnf install -y @development-tools fedora-packager RUN dnf install -y btrfs-progs-devel device-mapper-devel glibc-static libseccomp-devel libselinux-devel libtool-ltdl-devel selinux-policy selinux-policy-devel sqlite-devel tar -ENV SECCOMP_VERSION v2.2.3 +ENV SECCOMP_VERSION 2.2.3 RUN buildDeps=' \ automake \ libtool \ @@ -15,7 +15,7 @@ libtool \ && set -x \ && yum install -y $buildDeps \ && export SECCOMP_PATH=$(mktemp -d) \ -&& git clone -b "$SECCOMP_VERSION" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \ +&& git clone -b "v${SECCOMP_VERSION}" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \ && ( \ cd "$SECCOMP_PATH" \ && ./autogen.sh \ diff --git a/components/engine/contrib/builder/rpm/generate.sh b/components/engine/contrib/builder/rpm/generate.sh index b6d7287cef..ce3eeb6e07 100755 --- a/components/engine/contrib/builder/rpm/generate.sh +++ b/components/engine/contrib/builder/rpm/generate.sh @@ -121,7 +121,7 @@ for version in "${versions[@]}"; do && set -x \ && yum install -y $buildDeps \ && export SECCOMP_PATH=$(mktemp -d) \ - && git clone -b "$SECCOMP_VERSION" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \ + && git clone -b "v${SECCOMP_VERSION}" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \ && ( \ cd "$SECCOMP_PATH" \ && ./autogen.sh \ From 2a3e0a22a450bf233469fd6831e1f3d7545d0476 Mon Sep 17 00:00:00 2001 From: Jessica Frazelle Date: Fri, 15 Jan 2016 15:37:46 -0800 Subject: [PATCH 2/2] add a way to only build requested pkgs Signed-off-by: Jessica Frazelle Upstream-commit: 0bff2515f74fc6f0be9f019cc8b0f08b50e36228 Component: engine --- components/engine/Makefile | 1 + .../engine/contrib/builder/rpm/fedora-22/Dockerfile | 4 ++-- .../engine/contrib/builder/rpm/fedora-23/Dockerfile | 4 ++-- components/engine/contrib/builder/rpm/generate.sh | 4 ++-- components/engine/hack/make/build-deb | 9 +++++++-- components/engine/hack/make/build-rpm | 9 +++++++-- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/components/engine/Makefile b/components/engine/Makefile index 7a6601599d..e1d0bc1dcb 100644 --- a/components/engine/Makefile +++ b/components/engine/Makefile @@ -28,6 +28,7 @@ export DOCKERFILE # `docs/sources/contributing/devenvironment.md ` and `project/PACKAGERS.md` have some limited documentation of some of these DOCKER_ENVS := \ -e BUILDFLAGS \ + -e DOCKER_BUILD_PKGS \ -e DOCKER_CLIENTONLY \ -e DOCKER_DEBUG \ -e DOCKER_EXPERIMENTAL \ diff --git a/components/engine/contrib/builder/rpm/fedora-22/Dockerfile b/components/engine/contrib/builder/rpm/fedora-22/Dockerfile index 9b4e5493c8..9c2c01c074 100644 --- a/components/engine/contrib/builder/rpm/fedora-22/Dockerfile +++ b/components/engine/contrib/builder/rpm/fedora-22/Dockerfile @@ -15,10 +15,10 @@ libtool \ && set -x \ && yum install -y $buildDeps \ && export SECCOMP_PATH=$(mktemp -d) \ -&& git clone -b "v${SECCOMP_VERSION}" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \ +&& curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \ +| tar -xzC "$SECCOMP_PATH" --strip-components=1 \ && ( \ cd "$SECCOMP_PATH" \ -&& ./autogen.sh \ && ./configure --prefix=/usr \ && make \ && install -c src/.libs/libseccomp.a /usr/lib/libseccomp.a \ diff --git a/components/engine/contrib/builder/rpm/fedora-23/Dockerfile b/components/engine/contrib/builder/rpm/fedora-23/Dockerfile index c3314f9ec6..975fcf4fea 100644 --- a/components/engine/contrib/builder/rpm/fedora-23/Dockerfile +++ b/components/engine/contrib/builder/rpm/fedora-23/Dockerfile @@ -15,10 +15,10 @@ libtool \ && set -x \ && yum install -y $buildDeps \ && export SECCOMP_PATH=$(mktemp -d) \ -&& git clone -b "v${SECCOMP_VERSION}" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \ +&& curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \ +| tar -xzC "$SECCOMP_PATH" --strip-components=1 \ && ( \ cd "$SECCOMP_PATH" \ -&& ./autogen.sh \ && ./configure --prefix=/usr \ && make \ && install -c src/.libs/libseccomp.a /usr/lib/libseccomp.a \ diff --git a/components/engine/contrib/builder/rpm/generate.sh b/components/engine/contrib/builder/rpm/generate.sh index ce3eeb6e07..c841decd2f 100755 --- a/components/engine/contrib/builder/rpm/generate.sh +++ b/components/engine/contrib/builder/rpm/generate.sh @@ -121,10 +121,10 @@ for version in "${versions[@]}"; do && set -x \ && yum install -y $buildDeps \ && export SECCOMP_PATH=$(mktemp -d) \ - && git clone -b "v${SECCOMP_VERSION}" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \ + && curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \ + | tar -xzC "$SECCOMP_PATH" --strip-components=1 \ && ( \ cd "$SECCOMP_PATH" \ - && ./autogen.sh \ && ./configure --prefix=/usr \ && make \ && install -c src/.libs/libseccomp.a /usr/lib/libseccomp.a \ diff --git a/components/engine/hack/make/build-deb b/components/engine/hack/make/build-deb index b8fd7b3585..80b4276e24 100644 --- a/components/engine/hack/make/build-deb +++ b/components/engine/hack/make/build-deb @@ -37,8 +37,13 @@ set -e ./man/md2man-all.sh -q || true # TODO decide if it's worth getting go-md2man in _each_ builder environment to avoid this - # TODO add a configurable knob for _which_ debs to build so we don't have to modify the file or build all of them every time we need to test - for dir in contrib/builder/deb/*/; do + builderDir="contrib/builder/deb" + pkgs=( $(find "${builderDir}/"*/ -type d) ) + if [ ! -z "$DOCKER_BUILD_PKGS" ]; then + pkgs=( $(echo ${DOCKER_BUILD_PKGS[@]/#/$builderDir\/}) ) + fi + for dir in "${pkgs[@]}"; do + [ -d "$dir" ] || { echo >&2 "skipping nonexistent $dir"; continue; } version="$(basename "$dir")" suite="${version##*-}" diff --git a/components/engine/hack/make/build-rpm b/components/engine/hack/make/build-rpm index 36abc6f29b..b6ab9c3bc2 100644 --- a/components/engine/hack/make/build-rpm +++ b/components/engine/hack/make/build-rpm @@ -60,8 +60,13 @@ set -e fi done < CHANGELOG.md - # TODO add a configurable knob for _which_ rpms to build so we don't have to modify the file or build all of them every time we need to test - for dir in contrib/builder/rpm/*/; do + builderDir="contrib/builder/rpm" + pkgs=( $(find "${builderDir}/"*/ -type d) ) + if [ ! -z "$DOCKER_BUILD_PKGS" ]; then + pkgs=( $(echo ${DOCKER_BUILD_PKGS[@]/#/$builderDir\/}) ) + fi + for dir in "${pkgs[@]}"; do + [ -d "$dir" ] || { echo >&2 "skipping nonexistent $dir"; continue; } version="$(basename "$dir")" suite="${version##*-}"