From 1606fe0c04f79eda902415487a21c6ef9d31e6db Mon Sep 17 00:00:00 2001 From: Andrew Hsu Date: Thu, 15 Dec 2016 16:22:27 -0800 Subject: [PATCH] Revert "only build selinux rpm if we have policy dir" This reverts commit f9bc32067d42d6da025b81d81907fde85442f34d. Signed-off-by: Andrew Hsu --- .../docker-engine-selinux/LICENSE | 0 .../docker-engine-selinux/Makefile | 0 .../docker-engine-selinux/docker.fc | 0 .../docker-engine-selinux/docker.if | 0 .../docker-engine-selinux/docker.te | 0 .../docker-engine-selinux/docker_selinux.8.gz | Bin hack/make/build-rpm | 14 +++++++------- 7 files changed, 7 insertions(+), 7 deletions(-) rename contrib/{selinux-fedora-23 => selinux}/docker-engine-selinux/LICENSE (100%) rename contrib/{selinux-fedora-23 => selinux}/docker-engine-selinux/Makefile (100%) rename contrib/{selinux-fedora-23 => selinux}/docker-engine-selinux/docker.fc (100%) rename contrib/{selinux-fedora-23 => selinux}/docker-engine-selinux/docker.if (100%) rename contrib/{selinux-fedora-23 => selinux}/docker-engine-selinux/docker.te (100%) rename contrib/{selinux-fedora-23 => selinux}/docker-engine-selinux/docker_selinux.8.gz (100%) diff --git a/contrib/selinux-fedora-23/docker-engine-selinux/LICENSE b/contrib/selinux/docker-engine-selinux/LICENSE similarity index 100% rename from contrib/selinux-fedora-23/docker-engine-selinux/LICENSE rename to contrib/selinux/docker-engine-selinux/LICENSE diff --git a/contrib/selinux-fedora-23/docker-engine-selinux/Makefile b/contrib/selinux/docker-engine-selinux/Makefile similarity index 100% rename from contrib/selinux-fedora-23/docker-engine-selinux/Makefile rename to contrib/selinux/docker-engine-selinux/Makefile diff --git a/contrib/selinux-fedora-23/docker-engine-selinux/docker.fc b/contrib/selinux/docker-engine-selinux/docker.fc similarity index 100% rename from contrib/selinux-fedora-23/docker-engine-selinux/docker.fc rename to contrib/selinux/docker-engine-selinux/docker.fc diff --git a/contrib/selinux-fedora-23/docker-engine-selinux/docker.if b/contrib/selinux/docker-engine-selinux/docker.if similarity index 100% rename from contrib/selinux-fedora-23/docker-engine-selinux/docker.if rename to contrib/selinux/docker-engine-selinux/docker.if diff --git a/contrib/selinux-fedora-23/docker-engine-selinux/docker.te b/contrib/selinux/docker-engine-selinux/docker.te similarity index 100% rename from contrib/selinux-fedora-23/docker-engine-selinux/docker.te rename to contrib/selinux/docker-engine-selinux/docker.te diff --git a/contrib/selinux-fedora-23/docker-engine-selinux/docker_selinux.8.gz b/contrib/selinux/docker-engine-selinux/docker_selinux.8.gz similarity index 100% rename from contrib/selinux-fedora-23/docker-engine-selinux/docker_selinux.8.gz rename to contrib/selinux/docker-engine-selinux/docker_selinux.8.gz diff --git a/hack/make/build-rpm b/hack/make/build-rpm index 69e20cb8fb..18ff488587 100644 --- a/hack/make/build-rpm +++ b/hack/make/build-rpm @@ -132,12 +132,13 @@ set -e --define '_experimental ${DOCKER_EXPERIMENTAL:-0}' \ ${rpmName}.spec EOF - - # by default do not create selinux rpm - # if there exists a selinux policy dir specifically for distro version - # then build a selinux rpm with the policy in the policy dir - if [ -d "./contrib/selinux-$version" ]; then - selinuxDir="selinux-${version}" + # selinux policy referencing systemd things won't work on non-systemd versions + # of centos or rhel, which we don't support anyways + if [ "${suite%.*}" -gt 6 ] && [[ "$version" != opensuse* ]]; then + selinuxDir="selinux" + if [ -d "./contrib/selinux-$version" ]; then + selinuxDir="selinux-${version}" + fi cat >> "$DEST/$version/Dockerfile.build" <<-EOF RUN tar -cz -C /usr/src/${rpmName}/contrib/${selinuxDir} -f /root/rpmbuild/SOURCES/${rpmName}-selinux.tar.gz ${rpmName}-selinux RUN rpmbuild -ba \ @@ -148,7 +149,6 @@ set -e ${rpmName}-selinux.spec EOF fi - tempImage="docker-temp/build-rpm:$version" ( set -x && docker build -t "$tempImage" -f $DEST/$version/Dockerfile.build . ) docker run --rm "$tempImage" bash -c 'cd /root/rpmbuild && tar -c *RPMS' | tar -xvC "$DEST/$version"