From aa356dbbe712d78860ae5fab330363c73aa7525a Mon Sep 17 00:00:00 2001 From: Xin Ouyang Date: Mon, 13 Feb 2012 16:10:40 +0800 Subject: selinux: bb recipes for SELinux from git source. Since commit 60b2092e, we have these: checkpolicy v2.1.8 libselinux v2.1.9 libsemanage v2.1.6 libsepol v2.1.4 policycoreutils v2.1.10 sepolgen v1.1.5 --- recipes-security/selinux/checkpolicy_2.1.8.bb | 32 +++++++++++++ recipes-security/selinux/libselinux_2.1.9.bb | 38 +++++++++++++++ recipes-security/selinux/libsemanage_2.1.6.bb | 42 +++++++++++++++++ recipes-security/selinux/libsepol_2.1.4.bb | 18 +++++++ recipes-security/selinux/policycoreutils_2.1.10.bb | 55 ++++++++++++++++++++++ recipes-security/selinux/sepolgen_1.1.5.bb | 28 +++++++++++ 6 files changed, 213 insertions(+) create mode 100644 recipes-security/selinux/checkpolicy_2.1.8.bb create mode 100644 recipes-security/selinux/libselinux_2.1.9.bb create mode 100644 recipes-security/selinux/libsemanage_2.1.6.bb create mode 100644 recipes-security/selinux/libsepol_2.1.4.bb create mode 100644 recipes-security/selinux/policycoreutils_2.1.10.bb create mode 100644 recipes-security/selinux/sepolgen_1.1.5.bb diff --git a/recipes-security/selinux/checkpolicy_2.1.8.bb b/recipes-security/selinux/checkpolicy_2.1.8.bb new file mode 100644 index 0000000..2ab24f6 --- /dev/null +++ b/recipes-security/selinux/checkpolicy_2.1.8.bb @@ -0,0 +1,32 @@ +SUMMARY = "SELinux policy compiler" +DESCRIPTION = "SELinux policy compiler" +SECTION = "base" +PR = "r1" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" + +include selinux_git.inc + +SRCREV = "339f8079d7b9dd1e0b0138e2d096dc7c60b2092e" +S = "${WORKDIR}/git/checkpolicy" +DEPENDS += "libsepol libselinux flex-native" + +EXTRA_OEMAKE += "PREFIX=${D}" +EXTRA_OEMAKE += "LEX='flex'" + +BBCLASSEXTEND = "native" + +do_compile() { + oe_runmake checkpolicy checkmodule \ + INCLUDEDIR='${STAGING_INCDIR}' \ + LIBDIR='${STAGING_LIBDIR}' + oe_runmake -C test \ + INCLUDEDIR='${STAGING_INCDIR}' \ + LIBDIR='${STAGING_LIBDIR}' +} + +do_install_append() { + install test/dismod ${D}/${bindir}/sedismod + install test/dispol ${D}/${bindir}/sedispol +} + diff --git a/recipes-security/selinux/libselinux_2.1.9.bb b/recipes-security/selinux/libselinux_2.1.9.bb new file mode 100644 index 0000000..290b6bb --- /dev/null +++ b/recipes-security/selinux/libselinux_2.1.9.bb @@ -0,0 +1,38 @@ +SUMMARY = "SELinux library and simple utilities" +DESCRIPTION = "libselinux provides an API for SELinux applications to get and set \ +process and file security contexts and to obtain security policy \ +decisions. Required for any applications that use the SELinux API." +SECTION = "base" +PR = "r1" +LICENSE = "NSA-Public_Domain" +LIC_FILES_CHKSUM = "file://LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0" + +include selinux_git.inc +inherit lib_package + +SRCREV = "339f8079d7b9dd1e0b0138e2d096dc7c60b2092e" +S = "${WORKDIR}/git/libselinux" +DEPENDS += "libsepol python python-native swig-native" + +PACKAGES += "${PN}-python" +FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/selinux/*" +FILES_${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/site-packages/selinux/.debug/*" + +do_compile_append() { + oe_runmake pywrap -j1 \ + INCLUDEDIR='${STAGING_INCDIR}' \ + LIBDIR='${STAGING_LIBDIR}' \ + PYLIBVER='python${PYTHON_BASEVERSION}' \ + PYINC='-I${STAGING_INCDIR}/$(PYLIBVER)' \ + PYLIB='-L${STAGING_LIBDIR}/$(PYLIBVER) -l$(PYLIBVER)' \ + PYTHONLIBDIR='${PYLIB}' +} + +do_install_append() { + oe_runmake install-pywrap swigify \ + DESTDIR=${D} \ + PYLIBVER='python${PYTHON_BASEVERSION}' \ + PYLIBDIR='${D}/${libdir}/$(PYLIBVER)' +} + +BBCLASSEXTEND = "native" diff --git a/recipes-security/selinux/libsemanage_2.1.6.bb b/recipes-security/selinux/libsemanage_2.1.6.bb new file mode 100644 index 0000000..28165f4 --- /dev/null +++ b/recipes-security/selinux/libsemanage_2.1.6.bb @@ -0,0 +1,42 @@ +SUMMARY = "SELinux binary policy manipulation library" +DESCRIPTION = "libsemanage provides an API for the manipulation of SELinux binary policies. \ +It is used by checkpolicy (the policy compiler) and similar tools, as well \ +as by programs like load_policy that need to perform specific transformations \ +on binary policies such as customizing policy boolean settings." +SECTION = "base" +PR = "r1" +LICENSE = "LGPLv2.1+" +LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" + +include selinux_git.inc +inherit lib_package + +SRCREV = "339f8079d7b9dd1e0b0138e2d096dc7c60b2092e" +S = "${WORKDIR}/git/libsemanage" +DEPENDS += "libsepol libselinux ustr bzip2 python" + +PACKAGES += "${PN}-python" +FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*" +FILES_${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug/*" + +do_compile_append() { + oe_runmake pywrap -j1 \ + INCLUDEDIR='${STAGING_INCDIR}' \ + LIBDIR='${STAGING_LIBDIR}' \ + PYLIBVER='python${PYTHON_BASEVERSION}' \ + PYINC='-I${STAGING_INCDIR}/$(PYLIBVER)' \ + PYLIB='-L${STAGING_LIBDIR}/$(PYLIBVER) -l$(PYLIBVER)' \ + PYTHONLIBDIR='${PYLIB}' +} + +do_install_append() { + oe_runmake install-pywrap swigify \ + DESTDIR=${D} \ + PYLIBVER='python${PYTHON_BASEVERSION}' \ + PYLIBDIR='${D}/${libdir}/$(PYLIBVER)' + cd ${D}${libdir} && \ + rm -f libsemanage.so && \ + ln -s ../../`basename ${libdir}`/libsemanage.so.1 libsemanage.so +} + +BBCLASSEXTEND = "native" diff --git a/recipes-security/selinux/libsepol_2.1.4.bb b/recipes-security/selinux/libsepol_2.1.4.bb new file mode 100644 index 0000000..ab49f41 --- /dev/null +++ b/recipes-security/selinux/libsepol_2.1.4.bb @@ -0,0 +1,18 @@ +SUMMARY = "SELinux binary policy manipulation library" +DESCRIPTION = "libsepol provides an API for the manipulation of SELinux binary policies. \ +It is used by checkpolicy (the policy compiler) and similar tools, as well \ +as by programs like load_policy that need to perform specific transformations \ +on binary policies such as customizing policy boolean settings." +SECTION = "base" +PR = "r1" +LICENSE = "LGPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" + +include selinux_git.inc +inherit lib_package + +SRCREV = "339f8079d7b9dd1e0b0138e2d096dc7c60b2092e" +S = "${WORKDIR}/git/libsepol" + +BBCLASSEXTEND = "native" + diff --git a/recipes-security/selinux/policycoreutils_2.1.10.bb b/recipes-security/selinux/policycoreutils_2.1.10.bb new file mode 100644 index 0000000..fe5426f --- /dev/null +++ b/recipes-security/selinux/policycoreutils_2.1.10.bb @@ -0,0 +1,55 @@ +SUMMARY = "SELinux policy core utilities" +DESCRIPTION = "policycoreutils contains the policy core utilities that are required \ +for basic operation of a SELinux system. These utilities include \ +load_policy to load policies, setfiles to label filesystems, newrole \ +to switch roles, and run_init to run /etc/init.d scripts in the proper \ +context." +SECTION = "base" +PR = "r1" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" + +include selinux_git.inc + +SRCREV = "339f8079d7b9dd1e0b0138e2d096dc7c60b2092e" +S = "${WORKDIR}/git/policycoreutils" +DEPENDS += "libsepol libselinux libsemanage libcap-ng libcgroup" +DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam audit', '', d)}" + +RDEPENDS_${PN} += "\ + libselinux-python \ + libsemanage-python \ + sepolgen \ + " +RDEPENDS_${PN} += "\ + python \ + python-unixadmin \ + python-shell \ + python-crypt \ + python-subprocess \ + python-syslog \ + python-textutils \ + python-IPy \ + " +#RDEPENDS_${PN} += "setools" + +RDEPENDS_${PN}_virtclass-native = "python-native sepolgen-native" + + +PACKAGES =+ "${PN}-python ${PN}-sandbox" +FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*" +FILES_${PN}-sandbox = "${datadir}/sandbox/*" +FILES_${PN}-sandbox += "${bindir}/sandbox" +FILES_${PN}-sandbox += "${sbindir}/seunshare" + +CFLAGS_append = " -Wno-error=format-security" +EXTRA_OEMAKE += "${@base_contains('DISTRO_FEATURES', 'pam', 'PAMH=y AUDITH=y', '', d)}" +EXTRA_OEMAKE += "PREFIX=${D}" + +BBCLASSEXTEND = "native" + +do_install_append_virtclass-native() { + for PYTHSCRIPT in `grep -rIl /usr/bin/python ${D}${bindir} ${D}${sbindir} ${D}${libdir}/python${PYTHON_BASEVERSION}/site-packages/`; do + sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT + done +} diff --git a/recipes-security/selinux/sepolgen_1.1.5.bb b/recipes-security/selinux/sepolgen_1.1.5.bb new file mode 100644 index 0000000..56b1ddf --- /dev/null +++ b/recipes-security/selinux/sepolgen_1.1.5.bb @@ -0,0 +1,28 @@ +SUMMARY = "Python modules for supporting various SELinux utilities." +DESCRIPTION = "Python modules for supporting various SELinux utilities." +SECTION = "base" +PR = "r1" +LICENSE = "LGPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" + +include selinux_git.inc + +SRCREV = "339f8079d7b9dd1e0b0138e2d096dc7c60b2092e" + +S = "${WORKDIR}/git/sepolgen" + +FILES_${PN} = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*" + +DEPENDS += "python" + +FILES_${PN} += "${libdir}/python${PYTHON_BASEVERSION}/site-packages \ + /var/lib/sepolgen" + +do_install() { + oe_runmake DESTDIR=${D} \ + PYTHONLIBDIR='${libdir}/python${PYTHON_BASEVERSION}/site-packages' \ + install +} + +BBCLASSEXTEND = "native" + -- cgit v1.2.3-54-g00ecf