Browse code

Merge pull request #19377 from jfrazelle/cleanup-build-rpm-deb

Cleanup build rpm deb

Jess Frazelle authored on 2016/01/21 16:58:33
Showing 6 changed files
... ...
@@ -32,6 +32,7 @@ export DOCKERFILE
32 32
 # `docs/sources/contributing/devenvironment.md ` and `project/PACKAGERS.md` have some limited documentation of some of these
33 33
 DOCKER_ENVS := \
34 34
 	-e BUILDFLAGS \
35
+	-e DOCKER_BUILD_PKGS \
35 36
 	-e DOCKER_CLIENTONLY \
36 37
 	-e DOCKER_DEBUG \
37 38
 	-e DOCKER_EXPERIMENTAL \
... ...
@@ -7,7 +7,7 @@ FROM fedora:22
7 7
 RUN dnf install -y @development-tools fedora-packager
8 8
 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
9 9
 
10
-ENV SECCOMP_VERSION v2.2.3
10
+ENV SECCOMP_VERSION 2.2.3
11 11
 RUN buildDeps=' \
12 12
 automake \
13 13
 libtool \
... ...
@@ -15,10 +15,10 @@ libtool \
15 15
 && set -x \
16 16
 && yum install -y $buildDeps \
17 17
 && export SECCOMP_PATH=$(mktemp -d) \
18
-&& git clone -b "$SECCOMP_VERSION" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \
18
+&& curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \
19
+| tar -xzC "$SECCOMP_PATH" --strip-components=1 \
19 20
 && ( \
20 21
 cd "$SECCOMP_PATH" \
21
-&& ./autogen.sh \
22 22
 && ./configure --prefix=/usr \
23 23
 && make \
24 24
 && install -c src/.libs/libseccomp.a /usr/lib/libseccomp.a \
... ...
@@ -7,7 +7,7 @@ FROM fedora:23
7 7
 RUN dnf install -y @development-tools fedora-packager
8 8
 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
9 9
 
10
-ENV SECCOMP_VERSION v2.2.3
10
+ENV SECCOMP_VERSION 2.2.3
11 11
 RUN buildDeps=' \
12 12
 automake \
13 13
 libtool \
... ...
@@ -15,10 +15,10 @@ libtool \
15 15
 && set -x \
16 16
 && yum install -y $buildDeps \
17 17
 && export SECCOMP_PATH=$(mktemp -d) \
18
-&& git clone -b "$SECCOMP_VERSION" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \
18
+&& curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \
19
+| tar -xzC "$SECCOMP_PATH" --strip-components=1 \
19 20
 && ( \
20 21
 cd "$SECCOMP_PATH" \
21
-&& ./autogen.sh \
22 22
 && ./configure --prefix=/usr \
23 23
 && make \
24 24
 && install -c src/.libs/libseccomp.a /usr/lib/libseccomp.a \
... ...
@@ -122,10 +122,10 @@ for version in "${versions[@]}"; do
122 122
 			&& set -x \
123 123
 			&& yum install -y $buildDeps \
124 124
 			&& export SECCOMP_PATH=$(mktemp -d) \
125
-			&& git clone -b "$SECCOMP_VERSION" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \
125
+			&& curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \
126
+			| tar -xzC "$SECCOMP_PATH" --strip-components=1 \
126 127
 			&& ( \
127 128
 				cd "$SECCOMP_PATH" \
128
-				&& ./autogen.sh \
129 129
 				&& ./configure --prefix=/usr \
130 130
 				&& make \
131 131
 				&& install -c src/.libs/libseccomp.a /usr/lib/libseccomp.a \
... ...
@@ -37,8 +37,13 @@ set -e
37 37
 	./man/md2man-all.sh -q || true
38 38
 	# TODO decide if it's worth getting go-md2man in _each_ builder environment to avoid this
39 39
 
40
-	# 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
41
-	for dir in contrib/builder/deb/*/; do
40
+	builderDir="contrib/builder/deb"
41
+	pkgs=( $(find "${builderDir}/"*/ -type d) )
42
+	if [ ! -z "$DOCKER_BUILD_PKGS" ]; then
43
+		pkgs=( $(echo ${DOCKER_BUILD_PKGS[@]/#/$builderDir\/}) )
44
+	fi
45
+	for dir in "${pkgs[@]}"; do
46
+		[ -d "$dir" ] || { echo >&2 "skipping nonexistent $dir"; continue; }
42 47
 		version="$(basename "$dir")"
43 48
 		suite="${version##*-}"
44 49
 
... ...
@@ -60,8 +60,13 @@ set -e
60 60
 		fi
61 61
 	done < CHANGELOG.md
62 62
 
63
-	# 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
64
-	for dir in contrib/builder/rpm/*/; do
63
+	builderDir="contrib/builder/rpm"
64
+	pkgs=( $(find "${builderDir}/"*/ -type d) )
65
+	if [ ! -z "$DOCKER_BUILD_PKGS" ]; then
66
+		pkgs=( $(echo ${DOCKER_BUILD_PKGS[@]/#/$builderDir\/}) )
67
+	fi
68
+	for dir in "${pkgs[@]}"; do
69
+		[ -d "$dir" ] || { echo >&2 "skipping nonexistent $dir"; continue; }
65 70
 		version="$(basename "$dir")"
66 71
 		suite="${version##*-}"
67 72