2017-05-20 22:41:41 +02:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# refpolicy
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2019-04-08 20:50:13 +02:00
|
|
|
REFPOLICY_VERSION = 2.20190201
|
2017-11-07 15:49:15 +01:00
|
|
|
REFPOLICY_SOURCE = refpolicy-$(REFPOLICY_VERSION).tar.bz2
|
2019-04-08 20:50:13 +02:00
|
|
|
REFPOLICY_SITE = https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_2_20190201
|
2017-05-20 22:41:41 +02:00
|
|
|
REFPOLICY_LICENSE = GPL-2.0
|
|
|
|
REFPOLICY_LICENSE_FILES = COPYING
|
|
|
|
REFPOLICY_INSTALL_STAGING = YES
|
|
|
|
REFPOLICY_DEPENDENCIES = \
|
|
|
|
host-m4 \
|
|
|
|
host-checkpolicy \
|
|
|
|
host-policycoreutils \
|
|
|
|
host-setools \
|
|
|
|
host-gawk \
|
|
|
|
policycoreutils
|
|
|
|
|
2017-11-07 15:49:15 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PYTHON3),y)
|
|
|
|
REFPOLICY_DEPENDENCIES += host-python3
|
|
|
|
else
|
|
|
|
REFPOLICY_DEPENDENCIES += host-python
|
|
|
|
endif
|
|
|
|
|
2017-05-20 22:41:41 +02:00
|
|
|
# Cannot use multiple threads to build the reference policy
|
|
|
|
REFPOLICY_MAKE = \
|
|
|
|
TEST_TOOLCHAIN=$(HOST_DIR) \
|
|
|
|
$(TARGET_MAKE_ENV) \
|
|
|
|
$(MAKE1)
|
|
|
|
|
2017-05-20 22:41:42 +02:00
|
|
|
REFPOLICY_POLICY_VERSION = \
|
|
|
|
$(call qstrip,$(BR2_PACKAGE_REFPOLICY_POLICY_VERSION))
|
2017-05-20 22:41:43 +02:00
|
|
|
REFPOLICY_POLICY_STATE = \
|
|
|
|
$(call qstrip,$(BR2_PACKAGE_REFPOLICY_POLICY_STATE))
|
2017-05-20 22:41:42 +02:00
|
|
|
|
2017-05-20 22:41:41 +02:00
|
|
|
define REFPOLICY_CONFIGURE_CMDS
|
2017-05-20 22:41:42 +02:00
|
|
|
$(SED) "/OUTPUT_POLICY/c\OUTPUT_POLICY = $(REFPOLICY_POLICY_VERSION)" \
|
|
|
|
$(@D)/build.conf
|
2017-05-20 22:41:41 +02:00
|
|
|
$(SED) "/MONOLITHIC/c\MONOLITHIC = y" $(@D)/build.conf
|
|
|
|
$(SED) "/NAME/c\NAME = targeted" $(@D)/build.conf
|
|
|
|
endef
|
|
|
|
|
|
|
|
define REFPOLICY_BUILD_CMDS
|
|
|
|
$(REFPOLICY_MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) bare conf
|
|
|
|
endef
|
|
|
|
|
|
|
|
define REFPOLICY_INSTALL_STAGING_CMDS
|
|
|
|
$(REFPOLICY_MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) \
|
|
|
|
install-src install-headers
|
|
|
|
endef
|
|
|
|
|
|
|
|
define REFPOLICY_INSTALL_TARGET_CMDS
|
|
|
|
$(REFPOLICY_MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
|
2017-05-20 22:41:43 +02:00
|
|
|
$(INSTALL) -m 0755 -D package/refpolicy/config \
|
|
|
|
$(TARGET_DIR)/etc/selinux/config
|
|
|
|
$(SED) "/^SELINUX=/c\SELINUX=$(REFPOLICY_POLICY_STATE)" \
|
|
|
|
$(TARGET_DIR)/etc/selinux/config
|
2017-05-20 22:41:41 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(generic-package))
|