From 17335d322c10f2b741bdca5d49a02d557e634736 Mon Sep 17 00:00:00 2001 From: Xin Ouyang Date: Fri, 4 Jan 2013 15:12:42 +0800 Subject: selinux packages: create include files. Create include files for selinux userspace packages: * checkpolicy.inc * libselinux.inc * libsemanage.inc * libsepol.inc * policycoreutils.inc * sepolgen.inc Signed-off-by: Xin Ouyang --- recipes-security/selinux/checkpolicy.inc | 24 ++++++ recipes-security/selinux/checkpolicy_2.1.8.bb | 27 +------ recipes-security/selinux/checkpolicy_git.bb | 30 +------- recipes-security/selinux/libselinux.inc | 43 +++++++++++ recipes-security/selinux/libselinux_2.1.9.bb | 44 +---------- recipes-security/selinux/libselinux_git.bb | 47 +----------- recipes-security/selinux/libsemanage.inc | 43 +++++++++++ recipes-security/selinux/libsemanage_2.1.6.bb | 44 +---------- recipes-security/selinux/libsemanage_git.bb | 47 +----------- recipes-security/selinux/libsepol.inc | 14 ++++ recipes-security/selinux/libsepol_2.1.4.bb | 15 +--- recipes-security/selinux/libsepol_git.bb | 18 +---- recipes-security/selinux/policycoreutils.inc | 86 +++++++++++++++++++++ recipes-security/selinux/policycoreutils_2.1.10.bb | 87 +-------------------- recipes-security/selinux/policycoreutils_git.bb | 89 +--------------------- recipes-security/selinux/selinux_git.inc | 4 + recipes-security/selinux/sepolgen.inc | 34 +++++++++ recipes-security/selinux/sepolgen_1.1.5.bb | 35 +-------- recipes-security/selinux/sepolgen_git.bb | 39 +--------- 19 files changed, 285 insertions(+), 485 deletions(-) create mode 100644 recipes-security/selinux/checkpolicy.inc create mode 100644 recipes-security/selinux/libselinux.inc create mode 100644 recipes-security/selinux/libsemanage.inc create mode 100644 recipes-security/selinux/libsepol.inc create mode 100644 recipes-security/selinux/policycoreutils.inc create mode 100644 recipes-security/selinux/sepolgen.inc diff --git a/recipes-security/selinux/checkpolicy.inc b/recipes-security/selinux/checkpolicy.inc new file mode 100644 index 0000000..096f938 --- /dev/null +++ b/recipes-security/selinux/checkpolicy.inc @@ -0,0 +1,24 @@ +PRINC = "1" + +SUMMARY = "SELinux policy compiler" +DESCRIPTION = "\ +This package contains checkpolicy, the SELinux policy compiler. Only \ +required for building policies. It uses libsepol to generate the \ +binary policy. checkpolicy uses the static libsepol since it deals \ +with low level details of the policy that have not been \ +encapsulated/abstracted by a proper shared library interface." + +SECTION = "base" +LICENSE = "GPLv2+" + +DEPENDS += "libsepol libselinux bison-native flex-native" + +EXTRA_OEMAKE += "PREFIX=${D}" +EXTRA_OEMAKE += "LEX='flex'" + +do_install_append() { + install test/dismod ${D}/${bindir}/sedismod + install test/dispol ${D}/${bindir}/sedispol +} + +BBCLASSEXTEND = "native" diff --git a/recipes-security/selinux/checkpolicy_2.1.8.bb b/recipes-security/selinux/checkpolicy_2.1.8.bb index e2b9f67..d0fd759 100644 --- a/recipes-security/selinux/checkpolicy_2.1.8.bb +++ b/recipes-security/selinux/checkpolicy_2.1.8.bb @@ -1,30 +1,9 @@ -SUMMARY = "SELinux policy compiler" -DESCRIPTION = "\ -This package contains checkpolicy, the SELinux policy compiler. Only \ -required for building policies. It uses libsepol to generate the \ -binary policy. checkpolicy uses the static libsepol since it deals \ -with low level details of the policy that have not been \ -encapsulated/abstracted by a proper shared library interface." - -SECTION = "base" PR = "r2" -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" include selinux_20120216.inc +include ${BPN}.inc + +LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" SRC_URI[md5sum] = "e7b5d62873d4efc8a502b75f042f6735" SRC_URI[sha256sum] = "8ed586fd2ccf9900f86e38b72af4aa5cc3bade35d0fa19c53ac1a3d59fe0013a" - -DEPENDS += "libsepol libselinux bison-native flex-native" - -EXTRA_OEMAKE += "PREFIX=${D}" -EXTRA_OEMAKE += "LEX='flex'" - -BBCLASSEXTEND = "native" - -do_install_append() { - install test/dismod ${D}/${bindir}/sedismod - install test/dispol ${D}/${bindir}/sedispol -} - diff --git a/recipes-security/selinux/checkpolicy_git.bb b/recipes-security/selinux/checkpolicy_git.bb index be4f335..32240c1 100644 --- a/recipes-security/selinux/checkpolicy_git.bb +++ b/recipes-security/selinux/checkpolicy_git.bb @@ -1,31 +1,7 @@ -SUMMARY = "SELinux policy compiler" -DESCRIPTION = "\ -This package contains checkpolicy, the SELinux policy compiler. Only \ -required for building policies. It uses libsepol to generate the \ -binary policy. checkpolicy uses the static libsepol since it deals \ -with low level details of the policy that have not been \ -encapsulated/abstracted by a proper shared library interface." - -SECTION = "base" PR = "r2" -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" -DEFAULT_PREFERENCE = "-1" - -include selinux_git.inc - -SRCREV = "339f8079d7b9dd1e0b0138e2d096dc7c60b2092e" PV = "2.1.8+git${SRCPV}" -DEPENDS += "libsepol libselinux bison-native flex-native" - -EXTRA_OEMAKE += "PREFIX=${D}" -EXTRA_OEMAKE += "LEX='flex'" - -BBCLASSEXTEND = "native" - -do_install_append() { - install test/dismod ${D}/${bindir}/sedismod - install test/dispol ${D}/${bindir}/sedispol -} +include selinux_git.inc +include ${BPN}.inc +LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" diff --git a/recipes-security/selinux/libselinux.inc b/recipes-security/selinux/libselinux.inc new file mode 100644 index 0000000..575ebbc --- /dev/null +++ b/recipes-security/selinux/libselinux.inc @@ -0,0 +1,43 @@ +PRINC = "1" + +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" +LICENSE = "PD" + +inherit lib_package pythonnative + +DEPENDS += "libsepol python 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/*" + +def get_policyconfigarch(d): + import re + target = d.getVar('TARGET_ARCH', True) + p = re.compile('i.86') + target = p.sub('i386',target) + return "ARCH=%s" % (target) +EXTRA_OEMAKE += "${@get_policyconfigarch(d)}" + +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/libselinux_2.1.9.bb b/recipes-security/selinux/libselinux_2.1.9.bb index 40fbf10..8d4fc3f 100644 --- a/recipes-security/selinux/libselinux_2.1.9.bb +++ b/recipes-security/selinux/libselinux_2.1.9.bb @@ -1,49 +1,11 @@ -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 = "r3" -LICENSE = "PD" -LIC_FILES_CHKSUM = "file://LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0" include selinux_20120216.inc -inherit lib_package pythonnative +include ${BPN}.inc + +LIC_FILES_CHKSUM = "file://LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0" SRC_URI[md5sum] = "8ea0548dd65e9479b357ba1447f89221" SRC_URI[sha256sum] = "749d4b39c80aa9df8247b8b3187ab72442c0dbad6e70bf312e25052bd4e7063f" SRC_URI += "file://libselinux-fix-init-load-policy.patch" - -DEPENDS += "libsepol python 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/*" - -def get_policyconfigarch(d): - import re - target = d.getVar('TARGET_ARCH', True) - p = re.compile('i.86') - target = p.sub('i386',target) - return "ARCH=%s" % (target) -EXTRA_OEMAKE += "${@get_policyconfigarch(d)}" - -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/libselinux_git.bb b/recipes-security/selinux/libselinux_git.bb index 893fac5..902e859 100644 --- a/recipes-security/selinux/libselinux_git.bb +++ b/recipes-security/selinux/libselinux_git.bb @@ -1,48 +1,9 @@ -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 = "r3" -LICENSE = "PD" -LIC_FILES_CHKSUM = "file://LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0" -DEFAULT_PREFERENCE = "-1" - -include selinux_git.inc -inherit lib_package pythonnative - -SRCREV = "339f8079d7b9dd1e0b0138e2d096dc7c60b2092e" PV = "2.1.9+git${SRCPV}" -DEPENDS += "libsepol python 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/*" - -def get_git_policyconfigarch(d): - import re - target = d.getVar('TARGET_ARCH', True) - p = re.compile('i.86') - target = p.sub('i386',target) - return "ARCH=%s" % (target) -EXTRA_OEMAKE += "${@get_git_policyconfigarch(d)}" - -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}' -} +include selinux_git.inc +include ${BPN}.inc -do_install_append() { - oe_runmake install-pywrap swigify \ - DESTDIR=${D} \ - PYLIBVER='python${PYTHON_BASEVERSION}' \ - PYLIBDIR='${D}/${libdir}/$(PYLIBVER)' -} +LIC_FILES_CHKSUM = "file://LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0" -BBCLASSEXTEND = "native" +SRC_URI += "file://libselinux-fix-init-load-policy.patch" diff --git a/recipes-security/selinux/libsemanage.inc b/recipes-security/selinux/libsemanage.inc new file mode 100644 index 0000000..dfc3006 --- /dev/null +++ b/recipes-security/selinux/libsemanage.inc @@ -0,0 +1,43 @@ +PRINC = "1" + +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" +LICENSE = "LGPLv2.1+" + +inherit lib_package + +DEPENDS += "libsepol libselinux ustr bzip2 python bison-native flex-native" + +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 \ + 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() { + oe_runmake install \ + DESTDIR="${D}" \ + PREFIX="${D}/${prefix}" \ + INCLUDEDIR="${D}/${includedir}" \ + LIBDIR="${D}/${libdir}" \ + SHLIBDIR="${D}/${libdir}" + + 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 index b808b68..a6825ff 100644 --- a/recipes-security/selinux/libsemanage_2.1.6.bb +++ b/recipes-security/selinux/libsemanage_2.1.6.bb @@ -1,52 +1,14 @@ -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 = "r3" -LICENSE = "LGPLv2.1+" -LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" include selinux_20120216.inc -inherit lib_package +include ${BPN}.inc + +LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" SRC_URI[md5sum] = "b49d75602432d8cfad8a3e5a0a966f07" SRC_URI[sha256sum] = "64e6849fe50fb463ec0ba24653a26e3452fa4aaa7d7e192213d5c5a7c525aebb" -DEPENDS += "libsepol libselinux ustr bzip2 python bison-native flex-native" - SRC_URI += "file://Fix-segfault-for-standard-policy.patch \ file://libsemanage-Fix-execve-segfaults-on-Ubuntu.patch \ file://libsemanage-semanage.conf-for-cross-compile.patch \ file://libsemanage-fix-path-len-limit.patch" - -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 \ - 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() { - oe_runmake install \ - DESTDIR="${D}" \ - PREFIX="${D}/${prefix}" \ - INCLUDEDIR="${D}/${includedir}" \ - LIBDIR="${D}/${libdir}" \ - SHLIBDIR="${D}/${libdir}" - - oe_runmake install-pywrap swigify \ - DESTDIR=${D} \ - PYLIBVER='python${PYTHON_BASEVERSION}' \ - PYLIBDIR='${D}/${libdir}/$(PYLIBVER)' -} - -BBCLASSEXTEND = "native" diff --git a/recipes-security/selinux/libsemanage_git.bb b/recipes-security/selinux/libsemanage_git.bb index 71cb1ab..be4623d 100644 --- a/recipes-security/selinux/libsemanage_git.bb +++ b/recipes-security/selinux/libsemanage_git.bb @@ -1,53 +1,12 @@ -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 = "r3" -LICENSE = "LGPLv2.1+" -LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" -DEFAULT_PREFERENCE = "-1" +PV = "2.1.6+git${SRCPV}" include selinux_git.inc -inherit lib_package +include ${BPN}.inc -SRCREV = "339f8079d7b9dd1e0b0138e2d096dc7c60b2092e" -PV = "2.1.6+git${SRCPV}" - -DEPENDS += "libsepol libselinux ustr bzip2 python bison-native flex-native" +LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" SRC_URI += "file://Fix-segfault-for-standard-policy.patch \ file://libsemanage-Fix-execve-segfaults-on-Ubuntu.patch \ file://libsemanage-semanage.conf-for-cross-compile.patch \ file://libsemanage-fix-path-len-limit.patch" - -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 \ - 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() { - oe_runmake install \ - DESTDIR="${D}" \ - PREFIX="${D}/${prefix}" \ - INCLUDEDIR="${D}/${includedir}" \ - LIBDIR="${D}/${libdir}" \ - SHLIBDIR="${D}/${libdir}" - - oe_runmake install-pywrap swigify \ - DESTDIR=${D} \ - PYLIBVER='python${PYTHON_BASEVERSION}' \ - PYLIBDIR='${D}/${libdir}/$(PYLIBVER)' -} - -BBCLASSEXTEND = "native" diff --git a/recipes-security/selinux/libsepol.inc b/recipes-security/selinux/libsepol.inc new file mode 100644 index 0000000..8f0dc33 --- /dev/null +++ b/recipes-security/selinux/libsepol.inc @@ -0,0 +1,14 @@ +PRINC = "1" + +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" +LICENSE = "LGPLv2+" + +inherit lib_package + +BBCLASSEXTEND = "native" + diff --git a/recipes-security/selinux/libsepol_2.1.4.bb b/recipes-security/selinux/libsepol_2.1.4.bb index 4e795a2..eac1ed1 100644 --- a/recipes-security/selinux/libsepol_2.1.4.bb +++ b/recipes-security/selinux/libsepol_2.1.4.bb @@ -1,20 +1,11 @@ -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_20120216.inc -inherit lib_package +include ${BPN}.inc + +LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" SRC_URI[md5sum] = "909dae553edb34ea2224002a0c529cb0" SRC_URI[sha256sum] = "8f5ea42ae6cc00b21f0e5f31f354d19fcce3edfe9328971d266245718714b1e8" SRC_URI += "file://libsepol-Change-ranlib-for-cross-compiling.patch" - -BBCLASSEXTEND = "native" - diff --git a/recipes-security/selinux/libsepol_git.bb b/recipes-security/selinux/libsepol_git.bb index cb6e62e..f7d801c 100644 --- a/recipes-security/selinux/libsepol_git.bb +++ b/recipes-security/selinux/libsepol_git.bb @@ -1,21 +1,9 @@ -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" -DEFAULT_PREFERENCE = "-1" +PV = "2.1.4+git${SRCPV}" include selinux_git.inc -inherit lib_package +include ${BPN}.inc -SRCREV = "339f8079d7b9dd1e0b0138e2d096dc7c60b2092e" -PV = "2.1.4+git${SRCPV}" +LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" SRC_URI += "file://libsepol-Change-ranlib-for-cross-compiling.patch" - -BBCLASSEXTEND = "native" - diff --git a/recipes-security/selinux/policycoreutils.inc b/recipes-security/selinux/policycoreutils.inc new file mode 100644 index 0000000..e105db2 --- /dev/null +++ b/recipes-security/selinux/policycoreutils.inc @@ -0,0 +1,86 @@ +PRINC = "1" + +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" +LICENSE = "GPLv2+" + +SRC_URI += "${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}" + +PAM_SRC_URI = "file://pam.d/newrole \ + file://pam.d/run_init \ + " + +DEPENDS += "libsepol libselinux libsemanage" +DEPENDS += "${@['', '${EXTRA_DEPENDS}']['${PN}' != '${BPN}-native']}" +EXTRA_DEPENDS = "libcap-ng libcgroup" +EXTRA_DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam audit', '', d)}" + +RDEPENDS_${BPN} += "\ + libselinux-python \ + libsemanage-python \ + sepolgen \ + " +RDEPENDS_${BPN} += "\ + python \ + python-unixadmin \ + python-shell \ + python-crypt \ + python-subprocess \ + python-syslog \ + python-textutils \ + python-ipy \ + " + +RDEPENDS_${BPN} += "setools setools-libs ${BPN}-python" + +WARN_QA := "${@oe_filter_out('unsafe-references-in-scripts', '${WARN_QA}', d)}" +ERROR_QA := "${@oe_filter_out('unsafe-references-in-scripts', '${ERROR_QA}', d)}" + +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" + +inherit pythonnative + +AUDITH="`ls ${STAGING_INCDIR}/libaudit.h >/dev/null 2>&1 && echo /usr/include/libaudit.h `" +PAMH="`ls ${STAGING_INCDIR}/security/pam_appl.h >/dev/null 2>&1 && echo /usr/include/security/pam_appl.h `" +EXTRA_OEMAKE += "${@base_contains('DISTRO_FEATURES', 'pam', 'PAMH=${PAMH} AUDITH=${AUDITH}', 'PAMH= AUDITH= ', d)} INOTIFYH=n" +EXTRA_OEMAKE += "PREFIX=${D}" +EXTRA_OEMAKE += "INITDIR=${D}/etc/init.d" + +BBCLASSEXTEND = "native" + +PCU_NATIVE_CMDS = "setfiles semodule_package semodule semodule_link semodule_expand semodule_deps" + +do_compile_virtclass-native() { + for PCU_CMD in ${PCU_NATIVE_CMDS} ; do + oe_runmake -C $PCU_CMD \ + INCLUDEDIR='${STAGING_INCDIR}' \ + LIBDIR='${STAGING_LIBDIR}' + done +} + +do_install_virtclass-native() { + for PCU_CMD in ${PCU_NATIVE_CMDS} ; do + oe_runmake -C $PCU_CMD install \ + DESTDIR="${D}" \ + PREFIX="${D}/${prefix}" \ + SBINDIR="${D}/${base_sbindir}" + done +} + +do_install_append() { + test "${CLASSOVERRIDE}" = "class-native" && return 0 + + if [ -e ${WORKDIR}/pam.d ]; then + install -d ${D}${sysconfdir}/pam.d/ + install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/ + fi +} diff --git a/recipes-security/selinux/policycoreutils_2.1.10.bb b/recipes-security/selinux/policycoreutils_2.1.10.bb index 44f5ee8..6feb3cb 100644 --- a/recipes-security/selinux/policycoreutils_2.1.10.bb +++ b/recipes-security/selinux/policycoreutils_2.1.10.bb @@ -1,94 +1,13 @@ -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 = "r7" -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" include selinux_20120216.inc +include ${BPN}.inc + +LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" SRC_URI[md5sum] = "fefdede2815cdd2ba8b68599fef1f257" SRC_URI[sha256sum] = "8bbbc36b7d375edff891503932da93e37553f0dd7bdceded7ce9a45c80bec3d1" SRC_URI += "file://policycoreutils-fix-format-security.patch \ file://policycoreutils-remove-empty-po-files.patch \ - ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ " - -PAM_SRC_URI = "file://pam.d/newrole \ - file://pam.d/run_init \ - " - -DEPENDS += "libsepol libselinux libsemanage" -DEPENDS += "${@['', '${EXTRA_DEPENDS}']['${PN}' != '${BPN}-native']}" -EXTRA_DEPENDS = "libcap-ng libcgroup" -EXTRA_DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam audit', '', d)}" - -RDEPENDS_${BPN} += "\ - libselinux-python \ - libsemanage-python \ - sepolgen \ - " -RDEPENDS_${BPN} += "\ - python \ - python-unixadmin \ - python-shell \ - python-crypt \ - python-subprocess \ - python-syslog \ - python-textutils \ - python-ipy \ - " - -RDEPENDS_${BPN} += "setools setools-libs ${BPN}-python" - -WARN_QA := "${@oe_filter_out('unsafe-references-in-scripts', '${WARN_QA}', d)}" -ERROR_QA := "${@oe_filter_out('unsafe-references-in-scripts', '${ERROR_QA}', d)}" - -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" - -inherit pythonnative - -AUDITH="`ls ${STAGING_INCDIR}/libaudit.h >/dev/null 2>&1 && echo /usr/include/libaudit.h `" -PAMH="`ls ${STAGING_INCDIR}/security/pam_appl.h >/dev/null 2>&1 && echo /usr/include/security/pam_appl.h `" -EXTRA_OEMAKE += "${@base_contains('DISTRO_FEATURES', 'pam', 'PAMH=${PAMH} AUDITH=${AUDITH}', 'PAMH= AUDITH= ', d)} INOTIFYH=n" -EXTRA_OEMAKE += "PREFIX=${D}" -EXTRA_OEMAKE += "INITDIR=${D}/etc/init.d" - -BBCLASSEXTEND = "native" - -PCU_NATIVE_CMDS = "setfiles semodule_package semodule semodule_link semodule_expand semodule_deps" - -do_compile_virtclass-native() { - for PCU_CMD in ${PCU_NATIVE_CMDS} ; do - oe_runmake -C $PCU_CMD \ - INCLUDEDIR='${STAGING_INCDIR}' \ - LIBDIR='${STAGING_LIBDIR}' - done -} - -do_install_virtclass-native() { - for PCU_CMD in ${PCU_NATIVE_CMDS} ; do - oe_runmake -C $PCU_CMD install \ - DESTDIR="${D}" \ - PREFIX="${D}/${prefix}" \ - SBINDIR="${D}/${base_sbindir}" - done -} - -do_install_append() { - test "${CLASSOVERRIDE}" = "class-native" && return 0 - - if [ -e ${WORKDIR}/pam.d ]; then - install -d ${D}${sysconfdir}/pam.d/ - install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/ - fi -} diff --git a/recipes-security/selinux/policycoreutils_git.bb b/recipes-security/selinux/policycoreutils_git.bb index 1d7ad5c..cef84f1 100644 --- a/recipes-security/selinux/policycoreutils_git.bb +++ b/recipes-security/selinux/policycoreutils_git.bb @@ -1,94 +1,11 @@ -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 = "r7" -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" -DEFAULT_PREFERENCE = "-1" +PV = "2.1.10+git${SRCPV}" include selinux_git.inc +include ${BPN}.inc -SRCREV = "339f8079d7b9dd1e0b0138e2d096dc7c60b2092e" -PV = "2.1.10+git${SRCPV}" +LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" SRC_URI += "file://policycoreutils-fix-format-security.patch \ file://policycoreutils-remove-empty-po-files.patch \ - ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ " - -PAM_SRC_URI = "file://pam.d/newrole \ - file://pam.d/run_init \ - " - -DEPENDS += "libsepol libselinux libsemanage" -DEPENDS += "${@['', '${EXTRA_DEPENDS}']['${PN}' != '${BPN}-native']}" -EXTRA_DEPENDS = "libcap-ng libcgroup" -EXTRA_DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam audit', '', d)}" - -RDEPENDS_${BPN} += "\ - libselinux-python \ - libsemanage-python \ - sepolgen \ - " -RDEPENDS_${BPN} += "\ - python \ - python-unixadmin \ - python-shell \ - python-crypt \ - python-subprocess \ - python-syslog \ - python-textutils \ - python-ipy \ - " -RDEPENDS_${BPN} += "setools setools-libs ${BPN}-python" - -WARN_QA := "${@oe_filter_out('unsafe-references-in-scripts', '${WARN_QA}', d)}" -ERROR_QA := "${@oe_filter_out('unsafe-references-in-scripts', '${ERROR_QA}', d)}" - -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" - -inherit pythonnative - -AUDITH="`ls ${STAGING_INCDIR}/libaudit.h >/dev/null 2>&1 && echo /usr/include/libaudit.h `" -PAMH="`ls ${STAGING_INCDIR}/security/pam_appl.h >/dev/null 2>&1 && echo /usr/include/security/pam_appl.h `" -EXTRA_OEMAKE += "${@base_contains('DISTRO_FEATURES', 'pam', 'PAMH=${PAMH} AUDITH=${AUDITH}', 'PAMH= AUDITH= ', d)} INOTIFYH=n" -EXTRA_OEMAKE += "PREFIX=${D}" -EXTRA_OEMAKE += "INITDIR=${D}/etc/init.d" - -BBCLASSEXTEND = "native" - -PCU_NATIVE_CMDS = "setfiles semodule_package semodule semodule_link semodule_expand semodule_deps" - -do_compile_virtclass-native() { - for PCU_CMD in ${PCU_NATIVE_CMDS} ; do - oe_runmake -C $PCU_CMD \ - INCLUDEDIR='${STAGING_INCDIR}' \ - LIBDIR='${STAGING_LIBDIR}' - done -} - -do_install_virtclass-native() { - for PCU_CMD in ${PCU_NATIVE_CMDS} ; do - oe_runmake -C $PCU_CMD install \ - DESTDIR="${D}" \ - PREFIX="${D}/${prefix}" \ - SBINDIR="${D}/${base_sbindir}" - done -} - -do_install_append() { - test "${CLASSOVERRIDE}" = "class-native" && return 0 - - if [ -e ${WORKDIR}/pam.d ]; then - install -d ${D}${sysconfdir}/pam.d/ - install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/ - fi -} diff --git a/recipes-security/selinux/selinux_git.inc b/recipes-security/selinux/selinux_git.inc index 1301d6f..5dd1aad 100644 --- a/recipes-security/selinux/selinux_git.inc +++ b/recipes-security/selinux/selinux_git.inc @@ -1,3 +1,5 @@ +SRCREV = "339f8079d7b9dd1e0b0138e2d096dc7c60b2092e" + SRC_URI = "git://oss.tresys.com/git/selinux.git;protocol=http" SRC_URI[md5sum] = "4ec64a0d24aaa77c80b86e74d271e464" SRC_URI[sha256sum] = "9c8a8643c9a4dd0eb76fcda1420d636b750b84b27656c6f8bc6886a829d7e520" @@ -5,3 +7,5 @@ SRC_URI[sha256sum] = "9c8a8643c9a4dd0eb76fcda1420d636b750b84b27656c6f8bc6886a829 S = "${WORKDIR}/git/${BPN}" include selinux_common.inc + +DEFAULT_PREFERENCE = "-1" diff --git a/recipes-security/selinux/sepolgen.inc b/recipes-security/selinux/sepolgen.inc new file mode 100644 index 0000000..05e6544 --- /dev/null +++ b/recipes-security/selinux/sepolgen.inc @@ -0,0 +1,34 @@ +PRINC = "1" + +SUMMARY = "Python modules for supporting various SELinux utilities." +DESCRIPTION = "\ +This package contains a Python module that forms the core of the \ +modern audit2allow (which is a part of the package policycoreutils). \ +The sepolgen library is structured to give flexibility to the \ +application using it. The library contains: Reference Policy \ +Representation, which are Objects for representing policies and the \ +reference policy interfaces. Secondly, it has objects and algorithms \ +for representing access and sets of access in an abstract way and \ +searching that access. It also has a parser for reference policy \ +"headers". It contains infrastructure for parsing SELinux related \ +messages as produced by the audit system. It has facilities for \ +generating policy based on required access." + +SECTION = "base" +LICENSE = "LGPLv2+" + +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" + diff --git a/recipes-security/selinux/sepolgen_1.1.5.bb b/recipes-security/selinux/sepolgen_1.1.5.bb index 318a57c..f4031d9 100644 --- a/recipes-security/selinux/sepolgen_1.1.5.bb +++ b/recipes-security/selinux/sepolgen_1.1.5.bb @@ -1,39 +1,10 @@ -SUMMARY = "Python modules for supporting various SELinux utilities." -DESCRIPTION = "\ -This package contains a Python module that forms the core of the \ -modern audit2allow (which is a part of the package policycoreutils). \ -The sepolgen library is structured to give flexibility to the \ -application using it. The library contains: Reference Policy \ -Representation, which are Objects for representing policies and the \ -reference policy interfaces. Secondly, it has objects and algorithms \ -for representing access and sets of access in an abstract way and \ -searching that access. It also has a parser for reference policy \ -"headers". It contains infrastructure for parsing SELinux related \ -messages as produced by the audit system. It has facilities for \ -generating policy based on required access." - -SECTION = "base" PR = "r1" -LICENSE = "LGPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" include selinux_20120216.inc +include ${BPN}.inc + +LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" SRC_URI[md5sum] = "4ecadef3880019d8cdc08896687608b1" SRC_URI[sha256sum] = "16c2b10510be7dbb2dc0967aedb2d69c654ca52ed03d04881c17d2f8b863b3bb" -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" - diff --git a/recipes-security/selinux/sepolgen_git.bb b/recipes-security/selinux/sepolgen_git.bb index 68d5a2f..4c8b7df 100644 --- a/recipes-security/selinux/sepolgen_git.bb +++ b/recipes-security/selinux/sepolgen_git.bb @@ -1,40 +1,7 @@ -SUMMARY = "Python modules for supporting various SELinux utilities." -DESCRIPTION = "\ -This package contains a Python module that forms the core of the \ -modern audit2allow (which is a part of the package policycoreutils). \ -The sepolgen library is structured to give flexibility to the \ -application using it. The library contains: Reference Policy \ -Representation, which are Objects for representing policies and the \ -reference policy interfaces. Secondly, it has objects and algorithms \ -for representing access and sets of access in an abstract way and \ -searching that access. It also has a parser for reference policy \ -"headers". It contains infrastructure for parsing SELinux related \ -messages as produced by the audit system. It has facilities for \ -generating policy based on required access." - -SECTION = "base" PR = "r1" -LICENSE = "LGPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" -DEFAULT_PREFERENCE = "-1" +PV = "1.1.5+git${SRCPV}" include selinux_git.inc - -SRCREV = "339f8079d7b9dd1e0b0138e2d096dc7c60b2092e" -PV = "1.1.5+git${SRCPV}" +include ${BPN}.inc -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" - +LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" -- cgit v1.2.3-54-g00ecf