From 9941ac18e481e05cab12c1afce3579d9ba888ed7 Mon Sep 17 00:00:00 2001 From: Jason Zaman Date: Fri, 7 Oct 2016 12:01:16 +0800 Subject: sys-libs/libsemanage: bump to 2.6_rc2 Package-Manager: portage-2.3.0 --- sys-libs/libsemanage/Manifest | 2 +- ...-Fixes-bug-preventing-the-installation-of.patch | 98 --------------- sys-libs/libsemanage/libsemanage-2.6_rc1-r1.ebuild | 135 --------------------- sys-libs/libsemanage/libsemanage-2.6_rc2.ebuild | 134 ++++++++++++++++++++ sys-libs/libsemanage/libsemanage-9999.ebuild | 2 +- 5 files changed, 136 insertions(+), 235 deletions(-) delete mode 100644 sys-libs/libsemanage/files/libsemanage-2.6-0001-libsemanage-Fixes-bug-preventing-the-installation-of.patch delete mode 100644 sys-libs/libsemanage/libsemanage-2.6_rc1-r1.ebuild create mode 100644 sys-libs/libsemanage/libsemanage-2.6_rc2.ebuild (limited to 'sys-libs') diff --git a/sys-libs/libsemanage/Manifest b/sys-libs/libsemanage/Manifest index d8db2e0c47c7..90e445074f7e 100644 --- a/sys-libs/libsemanage/Manifest +++ b/sys-libs/libsemanage/Manifest @@ -1,2 +1,2 @@ DIST libsemanage-2.5.tar.gz 152884 SHA256 46e2f36254369b6e91d1eea0460c262b139361b055a3a67d3ceea2d8ef72e006 SHA512 cf644b77d8a24f76c630ece582df1b49a0c5f48f1c9f79b1caee0df10372008954406974472a072360dbe6de5ebc19b1b21bb247084d75b7186f61b32f33b8ec WHIRLPOOL 397b7fd2e9b2c00dbc2f58bdc023501dcd7ecf1212fef9ad7993b4763a041068416ef06552c0abf0beef8c69f4704933feca36951866c43d867181332971f6be -DIST libsemanage-2.6-rc1.tar.gz 155844 SHA256 3c4706c0b72a0ff6f4968eb5d7ecffe9faa1ea831036d6fe13f37927183fa4b5 SHA512 e1930039ad94b166726256a9422f948b600c29f963f420bdaf4afa891743e5144984acefac7226f05f4f3e20708a9b5788e450124633bc25337a591f02ff7ba5 WHIRLPOOL ca0e3707ff089d10d35f84abcdb8c3df983dbd39259acabe72b804216dcd8d762efe8b03fd2d1cca79d29c079a7ae4f624f33f60cbe6a71dcbf5f1d413d85f98 +DIST libsemanage-2.6-rc2.tar.gz 155934 SHA256 672bd1c3c6faeca483d90515a03ac9b65b6596064f49cd4cfbbb53c186d08a47 SHA512 fb794738d7497709441248b1ba3abe35aac7bbfaf7dc875d0c50733f871e5e90b209aefe912584f1e08d3aba596dd569caad749c236440662ba16b1c64727511 WHIRLPOOL afd746fca0b4d2a616996ca7346242f50ab35591df050ede9805a9e8aa958a4c8b474a62fd10aea99971f0bf7507a1d0d9d6e4e7b79b8095eea32feeaba1a2d6 diff --git a/sys-libs/libsemanage/files/libsemanage-2.6-0001-libsemanage-Fixes-bug-preventing-the-installation-of.patch b/sys-libs/libsemanage/files/libsemanage-2.6-0001-libsemanage-Fixes-bug-preventing-the-installation-of.patch deleted file mode 100644 index 8f99b768efbd..000000000000 --- a/sys-libs/libsemanage/files/libsemanage-2.6-0001-libsemanage-Fixes-bug-preventing-the-installation-of.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 9d25ca61603a2eed08d1b58b25c81f878c729474 Mon Sep 17 00:00:00 2001 -From: James Carter -Date: Mon, 3 Oct 2016 14:15:40 -0400 -Subject: [PATCH] libsemanage: Fixes bug preventing the installation of base - modules - -Commit 7a728e46 changed module installation so that a module pp would -be installed using its module name instead of its filename and a warning -would be printed if they were different. With this change, base modules -could no longer be installed because of the way error handling was done. - -This change fixes the error handling, so that when a base module is -installed it will be installed using its filename (since it does not -have a module name). - -Based on bug report by Jason Zaman - -Signed-off-by: James Carter ---- - libsemanage/src/direct_api.c | 39 ++++++++++++++------------------------- - 1 file changed, 14 insertions(+), 25 deletions(-) - -diff --git a/libsemanage/src/direct_api.c b/libsemanage/src/direct_api.c -index 3719cb1..e5c72cd 100644 ---- libsemanage/src/direct_api.c -+++ libsemanage/src/direct_api.c -@@ -368,7 +368,7 @@ static int semanage_direct_begintrans(semanage_handle_t * sh) - * 'version' to module's version. The caller is responsible for - * free()ing 'module_name', and 'version'; they will be - * set to NULL upon entering this function. Returns 0 on success, -1 -- * if out of memory, or -2 if data did not represent a module. -+ * if out of memory. - */ - static int parse_module_headers(semanage_handle_t * sh, char *module_data, - size_t data_len, char **module_name, -@@ -384,23 +384,10 @@ static int parse_module_headers(semanage_handle_t * sh, char *module_data, - } - sepol_policy_file_set_mem(pf, module_data, data_len); - sepol_policy_file_set_handle(pf, sh->sepolh); -- if (module_data == NULL || -- data_len == 0 || -+ if (module_data != NULL && data_len > 0) - sepol_module_package_info(pf, &file_type, module_name, -- version) == -1) { -- sepol_policy_file_free(pf); -- ERR(sh, "Could not parse module data."); -- return -2; -- } -+ version); - sepol_policy_file_free(pf); -- if (file_type != SEPOL_POLICY_MOD) { -- if (file_type == SEPOL_POLICY_BASE) -- ERR(sh, -- "Received a base module, expected a non-base module."); -- else -- ERR(sh, "Data did not represent a module."); -- return -2; -- } - - return 0; - } -@@ -1608,22 +1595,24 @@ static int semanage_direct_install_file(semanage_handle_t * sh, - lang_ext = separator + 1; - } - -- if (strcmp(lang_ext, "pp") != 0) { -+ if (strcmp(lang_ext, "pp") == 0) { -+ retval = parse_module_headers(sh, data, data_len, &module_name, &version); -+ free(version); -+ if (retval != 0) -+ goto cleanup; -+ } -+ -+ if (module_name == NULL) { - module_name = strdup(filename); - if (module_name == NULL) { - ERR(sh, "No memory available for module_name.\n"); - retval = -1; - goto cleanup; - } -- } else { -- if ((retval = parse_module_headers(sh, data, data_len, &module_name, &version)) != 0) -- goto cleanup; -- -- if (strcmp(module_name, filename) != 0) -- fprintf(stderr, "Warning: SELinux userspace will refer to the module from %s as %s rather than %s\n", install_filename, module_name, filename); -- -- free(version); -+ } else if (strcmp(module_name, filename) != 0) { -+ fprintf(stderr, "Warning: SELinux userspace will refer to the module from %s as %s rather than %s\n", install_filename, module_name, filename); - } -+ - retval = semanage_direct_install(sh, data, data_len, module_name, lang_ext); - - cleanup: --- -2.7.3 - diff --git a/sys-libs/libsemanage/libsemanage-2.6_rc1-r1.ebuild b/sys-libs/libsemanage/libsemanage-2.6_rc1-r1.ebuild deleted file mode 100644 index daaa79f8b717..000000000000 --- a/sys-libs/libsemanage/libsemanage-2.6_rc1-r1.ebuild +++ /dev/null @@ -1,135 +0,0 @@ -# Copyright 1999-2016 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -EAPI="6" -PYTHON_COMPAT=( python{2_7,3_4,3_5} ) - -inherit multilib python-r1 toolchain-funcs multilib-minimal - -MY_P="${P//_/-}" -MY_RELEASEDATE="20160930" - -SEPOL_VER="${PV}" -SELNX_VER="${PV}" - -DESCRIPTION="SELinux kernel and policy management library" -HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki" - -if [[ ${PV} == 9999 ]]; then - inherit git-r3 - EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git" - S="${WORKDIR}/${MY_P}/${PN}" -else - SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz" - KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86" - S="${WORKDIR}/${MY_P}" -fi - -LICENSE="GPL-2" -SLOT="0" -IUSE="python" - -RDEPEND=">=sys-libs/libsepol-${SEPOL_VER}[${MULTILIB_USEDEP}] - >=sys-libs/libselinux-${SELNX_VER}[${MULTILIB_USEDEP}] - >=sys-process/audit-2.2.2[${MULTILIB_USEDEP}] - >=dev-libs/ustr-1.0.4-r2[${MULTILIB_USEDEP}] - " -DEPEND="${RDEPEND} - sys-devel/bison - sys-devel/flex - python? ( - >=dev-lang/swig-2.0.4-r1 - virtual/pkgconfig - ${PYTHON_DEPS} - )" - -# tests are not meant to be run outside of the -# full SELinux userland repo -RESTRICT="test" - -src_prepare() { - echo "# Set this to true to save the linked policy." >> "${S}/src/semanage.conf" - echo "# This is normally only useful for analysis" >> "${S}/src/semanage.conf" - echo "# or debugging of policy." >> "${S}/src/semanage.conf" - echo "save-linked=false" >> "${S}/src/semanage.conf" - echo >> "${S}/src/semanage.conf" - echo "# Set this to 0 to disable assertion checking." >> "${S}/src/semanage.conf" - echo "# This should speed up building the kernel policy" >> "${S}/src/semanage.conf" - echo "# from policy modules, but may leave you open to" >> "${S}/src/semanage.conf" - echo "# dangerous rules which assertion checking" >> "${S}/src/semanage.conf" - echo "# would catch." >> "${S}/src/semanage.conf" - echo "expand-check=1" >> "${S}/src/semanage.conf" - echo >> "${S}/src/semanage.conf" - echo "# Modules in the module store can be compressed" >> "${S}/src/semanage.conf" - echo "# with bzip2. Set this to the bzip2 blocksize" >> "${S}/src/semanage.conf" - echo "# 1-9 when compressing. The higher the number," >> "${S}/src/semanage.conf" - echo "# the more memory is traded off for disk space." >> "${S}/src/semanage.conf" - echo "# Set to 0 to disable bzip2 compression." >> "${S}/src/semanage.conf" - echo "bzip-blocksize=0" >> "${S}/src/semanage.conf" - echo >> "${S}/src/semanage.conf" - echo "# Reduce memory usage for bzip2 compression and" >> "${S}/src/semanage.conf" - echo "# decompression of modules in the module store." >> "${S}/src/semanage.conf" - echo "bzip-small=true" >> "${S}/src/semanage.conf" - - eapply "${FILESDIR}/${PN}-2.6-0001-libsemanage-Fixes-bug-preventing-the-installation-of.patch" - eapply "${FILESDIR}"/${PN}-2.6-build-paths.patch - - eapply_user - - multilib_copy_sources -} - -multilib_src_compile() { - emake \ - AR="$(tc-getAR)" \ - CC="$(tc-getCC)" \ - LIBDIR="${EPREFIX}/usr/$(get_libdir)" \ - all - - if multilib_is_native_abi && use python; then - building_py() { - python_export PYTHON_INCLUDEDIR PYTHON_LIBPATH - emake CC="$(tc-getCC)" PYINC="-I${PYTHON_INCLUDEDIR}" PYTHONLBIDIR="${PYTHON_LIBPATH}" PYPREFIX="${EPYTHON##*/}" "$@" - } - python_foreach_impl building_py swigify - python_foreach_impl building_py pywrap - fi -} - -multilib_src_install() { - emake \ - LIBDIR="${ED}/usr/$(get_libdir)" \ - SHLIBDIR="${ED}/usr/$(get_libdir)" \ - DESTDIR="${ED}" install - - if multilib_is_native_abi && use python; then - installation_py() { - emake DESTDIR="${ED}" LIBDIR="${ED}/usr/$(get_libdir)" \ - SHLIBDIR="${ED}/usr/$(get_libdir)" install-pywrap - python_optimize # bug 531638 - } - python_foreach_impl installation_py - fi -} - -pkg_postinst() { - # Migrate the SELinux semanage configuration store if not done already - local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' "${EROOT}"/etc/selinux/config 2>/dev/null) - if [ -n "${selinuxtype}" ] && [ ! -d "${EROOT}"/var/lib/selinux/${mcs}/active ] ; then - ewarn "Since the 2.4 SELinux userspace, the policy module store is moved" - ewarn "from /etc/selinux to /var/lib/selinux. The migration will be run now." - ewarn "If there are any issues, it can be done manually by running:" - ewarn "/usr/libexec/selinux/semanage_migrate_store" - ewarn "For more information, please see" - ewarn "- https://github.com/SELinuxProject/selinux/wiki/Policy-Store-Migration" - fi - - # Run the store migration without rebuilds - for POLICY_TYPE in ${POLICY_TYPES} ; do - if [ ! -d "${EROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then - einfo "Migrating store ${POLICY_TYPE} (without policy rebuild)." - /usr/libexec/selinux/semanage_migrate_store -n -s "${POLICY_TYPE}" || die "Failed to migrate store ${POLICY_TYPE}" - fi - done -} diff --git a/sys-libs/libsemanage/libsemanage-2.6_rc2.ebuild b/sys-libs/libsemanage/libsemanage-2.6_rc2.ebuild new file mode 100644 index 000000000000..2b625f502cbf --- /dev/null +++ b/sys-libs/libsemanage/libsemanage-2.6_rc2.ebuild @@ -0,0 +1,134 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI="6" +PYTHON_COMPAT=( python{2_7,3_4,3_5} ) + +inherit multilib python-r1 toolchain-funcs multilib-minimal + +MY_P="${P//_/-}" +MY_RELEASEDATE="20161006" + +SEPOL_VER="${PV}" +SELNX_VER="${PV}" + +DESCRIPTION="SELinux kernel and policy management library" +HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki" + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git" + S="${WORKDIR}/${MY_P}/${PN}" +else + SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86" + S="${WORKDIR}/${MY_P}" +fi + +LICENSE="GPL-2" +SLOT="0" +IUSE="python" + +RDEPEND=">=sys-libs/libsepol-${SEPOL_VER}[${MULTILIB_USEDEP}] + >=sys-libs/libselinux-${SELNX_VER}[${MULTILIB_USEDEP}] + >=sys-process/audit-2.2.2[${MULTILIB_USEDEP}] + >=dev-libs/ustr-1.0.4-r2[${MULTILIB_USEDEP}] + " +DEPEND="${RDEPEND} + sys-devel/bison + sys-devel/flex + python? ( + >=dev-lang/swig-2.0.4-r1 + virtual/pkgconfig + ${PYTHON_DEPS} + )" + +# tests are not meant to be run outside of the +# full SELinux userland repo +RESTRICT="test" + +src_prepare() { + echo "# Set this to true to save the linked policy." >> "${S}/src/semanage.conf" + echo "# This is normally only useful for analysis" >> "${S}/src/semanage.conf" + echo "# or debugging of policy." >> "${S}/src/semanage.conf" + echo "save-linked=false" >> "${S}/src/semanage.conf" + echo >> "${S}/src/semanage.conf" + echo "# Set this to 0 to disable assertion checking." >> "${S}/src/semanage.conf" + echo "# This should speed up building the kernel policy" >> "${S}/src/semanage.conf" + echo "# from policy modules, but may leave you open to" >> "${S}/src/semanage.conf" + echo "# dangerous rules which assertion checking" >> "${S}/src/semanage.conf" + echo "# would catch." >> "${S}/src/semanage.conf" + echo "expand-check=1" >> "${S}/src/semanage.conf" + echo >> "${S}/src/semanage.conf" + echo "# Modules in the module store can be compressed" >> "${S}/src/semanage.conf" + echo "# with bzip2. Set this to the bzip2 blocksize" >> "${S}/src/semanage.conf" + echo "# 1-9 when compressing. The higher the number," >> "${S}/src/semanage.conf" + echo "# the more memory is traded off for disk space." >> "${S}/src/semanage.conf" + echo "# Set to 0 to disable bzip2 compression." >> "${S}/src/semanage.conf" + echo "bzip-blocksize=0" >> "${S}/src/semanage.conf" + echo >> "${S}/src/semanage.conf" + echo "# Reduce memory usage for bzip2 compression and" >> "${S}/src/semanage.conf" + echo "# decompression of modules in the module store." >> "${S}/src/semanage.conf" + echo "bzip-small=true" >> "${S}/src/semanage.conf" + + eapply "${FILESDIR}"/${PN}-2.6-build-paths.patch + + eapply_user + + multilib_copy_sources +} + +multilib_src_compile() { + emake \ + AR="$(tc-getAR)" \ + CC="$(tc-getCC)" \ + LIBDIR="${EPREFIX}/usr/$(get_libdir)" \ + all + + if multilib_is_native_abi && use python; then + building_py() { + python_export PYTHON_INCLUDEDIR PYTHON_LIBPATH + emake CC="$(tc-getCC)" PYINC="-I${PYTHON_INCLUDEDIR}" PYTHONLBIDIR="${PYTHON_LIBPATH}" PYPREFIX="${EPYTHON##*/}" "$@" + } + python_foreach_impl building_py swigify + python_foreach_impl building_py pywrap + fi +} + +multilib_src_install() { + emake \ + LIBDIR="${ED}/usr/$(get_libdir)" \ + SHLIBDIR="${ED}/usr/$(get_libdir)" \ + DESTDIR="${ED}" install + + if multilib_is_native_abi && use python; then + installation_py() { + emake DESTDIR="${ED}" LIBDIR="${ED}/usr/$(get_libdir)" \ + SHLIBDIR="${ED}/usr/$(get_libdir)" install-pywrap + python_optimize # bug 531638 + } + python_foreach_impl installation_py + fi +} + +pkg_postinst() { + # Migrate the SELinux semanage configuration store if not done already + local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' "${EROOT}"/etc/selinux/config 2>/dev/null) + if [ -n "${selinuxtype}" ] && [ ! -d "${EROOT}"/var/lib/selinux/${mcs}/active ] ; then + ewarn "Since the 2.4 SELinux userspace, the policy module store is moved" + ewarn "from /etc/selinux to /var/lib/selinux. The migration will be run now." + ewarn "If there are any issues, it can be done manually by running:" + ewarn "/usr/libexec/selinux/semanage_migrate_store" + ewarn "For more information, please see" + ewarn "- https://github.com/SELinuxProject/selinux/wiki/Policy-Store-Migration" + fi + + # Run the store migration without rebuilds + for POLICY_TYPE in ${POLICY_TYPES} ; do + if [ ! -d "${EROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then + einfo "Migrating store ${POLICY_TYPE} (without policy rebuild)." + /usr/libexec/selinux/semanage_migrate_store -n -s "${POLICY_TYPE}" || die "Failed to migrate store ${POLICY_TYPE}" + fi + done +} diff --git a/sys-libs/libsemanage/libsemanage-9999.ebuild b/sys-libs/libsemanage/libsemanage-9999.ebuild index 76b2430f794d..2b625f502cbf 100644 --- a/sys-libs/libsemanage/libsemanage-9999.ebuild +++ b/sys-libs/libsemanage/libsemanage-9999.ebuild @@ -8,7 +8,7 @@ PYTHON_COMPAT=( python{2_7,3_4,3_5} ) inherit multilib python-r1 toolchain-funcs multilib-minimal MY_P="${P//_/-}" -MY_RELEASEDATE="20160930" +MY_RELEASEDATE="20161006" SEPOL_VER="${PV}" SELNX_VER="${PV}" -- cgit v1.2.3-65-gdbad