Revert "only build selinux rpm if we have policy dir"

This reverts commit f9bc32067d.

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
This commit is contained in:
Andrew Hsu 2016-12-15 16:22:27 -08:00
parent e9e3ab6b6a
commit 1606fe0c04
7 changed files with 7 additions and 7 deletions

View file

@ -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"