03d22f2
#!/bin/bash
03d22f2
03d22f2
DISTGIT_PATH=$(pwd)
03d22f2
373ef75
FEDORA_VERSION=f24
680c6af
DOCKER_FEDORA_VERSION=master
84392fe
DISTGIT_BRANCH=f24
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
add83cd
git clone git@github.com:fedora-selinux/selinux-policy-contrib.git -q
d709eaa
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
1c489d8
git rev-parse --verify origin/${FEDORA_VERSION}; git diff eb4512f6eb13792c76ff8d3e6f2df3a7155db577 origin/${FEDORA_VERSION} > policy-${FEDORA_VERSION}-base.patch
add83cd
popd > /dev/null
add83cd
add83cd
pushd selinux-policy-contrib > /dev/null
add83cd
# prepare policy patches against upstream commits matching the last upstream merge
add83cd
git rev-parse --verify origin/${FEDORA_VERSION}; git diff 64302b790bf2b39d93610e1452c8361d56966ae0 origin/${FEDORA_VERSION} > policy-${FEDORA_VERSION}-contrib.patch
03d22f2
popd > /dev/null
03d22f2
d709eaa
pushd container-selinux > /dev/null
d709eaa
# Actual container-selinux files are in master branch
e93612f
#git checkout -b ${DOCKER_FEDORA_VERSION} -t origin/${DOCKER_FEDORA_VERSION} -q
d709eaa
tar -czf container-selinux.tgz container.if container.te container.fc
03d22f2
popd > /dev/null
03d22f2
03d22f2
pushd $DISTGIT_PATH > /dev/null
add83cd
cp $POLICYSOURCES/selinux-policy/policy-${FEDORA_VERSION}-base.patch .
add83cd
cp $POLICYSOURCES/selinux-policy-contrib/policy-${FEDORA_VERSION}-contrib.patch .
d709eaa
cp $POLICYSOURCES/container-selinux/container-selinux.tgz .
03d22f2
popd > /dev/null
03d22f2
03d22f2
popd > /dev/null
03d22f2
rm -rf $POLICYSOURCES
03d22f2
d709eaa
echo "policy-f24-{contrib,base}.patches and container.tgz with container policy files have been created."