new file mode 100644
@@ -0,0 +1,2 @@
+# policy version used by refpolicy and semanage
+POLICY_VERSION ?= "35"
@@ -77,6 +77,8 @@ SRC_URI += " \
S = "${UNPACKDIR}/refpolicy"
+require conf/selinux_refpolicy_common.inc
+
CONFFILES:${PN} = "${sysconfdir}/selinux/config"
POLICY_STORE_ROOT ?= "${localstatedir}/lib/selinux"
@@ -208,7 +210,7 @@ path = ${STAGING_DIR_NATIVE}${sbindir_native}/sefcontext_compile
args = \$@
[end]
-policy-version = 35
+policy-version = ${POLICY_VERSION}
store-root = "${POLICY_STORE_ROOT}"
EOF
@@ -52,7 +52,7 @@ do_install:append() {
if [ -f "${conf_file}" ]; then
# Update "policy-version" for semanage.conf
- sed -i 's/^#\s*\(policy-version\s*=\).*$/\1 35/' \
+ sed -i 's/^#\s*\(policy-version\s*=\).*$/\1 ${POLICY_VERSION}/' \
${D}/etc/selinux/semanage.conf
# Update "store-root" for semanage.conf
@@ -3,6 +3,8 @@ HOMEPAGE = "https://github.com/SELinuxProject"
SRC_URI = "git://github.com/SELinuxProject/selinux.git;branch=main;protocol=https"
SRCREV = "ca10fc4204ed60540d41d2499127c18ad0643f9e"
+require conf/selinux_refpolicy_common.inc
+
S = "${UNPACKDIR}/${BP}/${BPN}"
UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"