03d22f2
#!/bin/bash
03d22f2
03d22f2
DISTGIT_PATH=$(pwd)
03d22f2
3b20288
FEDORA_VERSION=f25
b040fbf
DOCKER_FEDORA_VERSION=master
0de62dd
DISTGIT_BRANCH=f25
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
d679d06
git clone git@github.com:fedora-selinux/selinux-policy-contrib.git -q
490fd2e
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
856e200
git rev-parse --verify origin/${FEDORA_VERSION}-base; git diff eb4512f6eb13792c76ff8d3e6f2df3a7155db577 origin/${FEDORA_VERSION}-base > policy-${FEDORA_VERSION}-base.patch
d679d06
popd > /dev/null
d679d06
d679d06
pushd selinux-policy-contrib > /dev/null
d679d06
# prepare policy patches against upstream commits matching the last upstream merge
d679d06
git rev-parse --verify origin/${FEDORA_VERSION}; git diff 64302b790bf2b39d93610e1452c8361d56966ae0 origin/${FEDORA_VERSION} > policy-${FEDORA_VERSION}-contrib.patch
03d22f2
popd > /dev/null
03d22f2
490fd2e
pushd container-selinux > /dev/null
490fd2e
# Actual container-selinux files are in master branch
d932255
#git checkout -b ${DOCKER_FEDORA_VERSION} -t origin/${DOCKER_FEDORA_VERSION} -q
490fd2e
tar -czf container-selinux.tgz container.if container.te container.fc
03d22f2
popd > /dev/null
03d22f2
03d22f2
pushd $DISTGIT_PATH > /dev/null
d679d06
cp $POLICYSOURCES/selinux-policy/policy-${FEDORA_VERSION}-base.patch .
d679d06
cp $POLICYSOURCES/selinux-policy-contrib/policy-${FEDORA_VERSION}-contrib.patch .
490fd2e
cp $POLICYSOURCES/container-selinux/container-selinux.tgz .
03d22f2
popd > /dev/null
03d22f2
03d22f2
popd > /dev/null
03d22f2
rm -rf $POLICYSOURCES
03d22f2
28d6064
echo "policy-f25-{contrib,base}.patches and container.tgz with container policy files have been created."