03d22f2
#!/bin/bash
03d22f2
03d22f2
DISTGIT_PATH=$(pwd)
03d22f2
ba6f131
FEDORA_VERSION=f26
b040fbf
DOCKER_FEDORA_VERSION=master
d39f46b
DISTGIT_BRANCH=f26
03d22f2
03d22f2
git checkout $DISTGIT_BRANCH -q
03d22f2
03d22f2
POLICYSOURCES=`mktemp -d policysources.XXXXXX`
03d22f2
pushd $POLICYSOURCES > /dev/null
03d22f2
03d22f2
git clone git@github.com:fedora-selinux/selinux-policy.git -q
47948f5
git clone git@github.com:fedora-selinux/selinux-policy-contrib.git -q
ab3db24
git clone git@github.com:projectatomic/container-selinux.git -q
03d22f2
03d22f2
pushd selinux-policy > /dev/null
856e200
# prepare policy patches against upstream commits matching the last upstream merge
9d87d07
git rev-parse --verify origin/${FEDORA_VERSION}; git diff eb4512f6eb13792c76ff8d3e6f2df3a7155db577 origin/${FEDORA_VERSION} > policy-${FEDORA_VERSION}-base.patch
47948f5
popd > /dev/null
47948f5
47948f5
pushd selinux-policy-contrib > /dev/null
47948f5
# prepare policy patches against upstream commits matching the last upstream merge
47948f5
git rev-parse --verify origin/${FEDORA_VERSION}; git diff 64302b790bf2b39d93610e1452c8361d56966ae0 origin/${FEDORA_VERSION} > policy-${FEDORA_VERSION}-contrib.patch
03d22f2
popd > /dev/null
03d22f2
ab3db24
pushd container-selinux > /dev/null
ab3db24
# Actual container-selinux files are in master branch
d932255
#git checkout -b ${DOCKER_FEDORA_VERSION} -t origin/${DOCKER_FEDORA_VERSION} -q
ab3db24
tar -czf container-selinux.tgz container.if container.te container.fc
03d22f2
popd > /dev/null
03d22f2
03d22f2
pushd $DISTGIT_PATH > /dev/null
47948f5
cp $POLICYSOURCES/selinux-policy/policy-${FEDORA_VERSION}-base.patch .
47948f5
cp $POLICYSOURCES/selinux-policy-contrib/policy-${FEDORA_VERSION}-contrib.patch .
ab3db24
cp $POLICYSOURCES/container-selinux/container-selinux.tgz .
03d22f2
popd > /dev/null
03d22f2
03d22f2
popd > /dev/null
03d22f2
rm -rf $POLICYSOURCES
03d22f2
ba6f131
echo "policy-f26-{contrib,base}.patches and container.tgz with container policy files have been created."