sys-libs/libsemanage: Bump to 2.5 release
authorSven Vermeulen <swift@gentoo.org>
Sun, 13 Mar 2016 18:35:34 +0000 (19:35 +0100)
committerSven Vermeulen <swift@gentoo.org>
Sun, 13 Mar 2016 19:46:36 +0000 (20:46 +0100)
Package-Manager: portage-2.2.26

sys-libs/libsemanage/Manifest
sys-libs/libsemanage/libsemanage-2.5.ebuild [new file with mode: 0644]
sys-libs/libsemanage/libsemanage-9999.ebuild

index f95583eccd843c498dbfd35d495d198c93e180ce..1f49a874c604aa9c756304fb766f3c7985d40322 100644 (file)
@@ -1,3 +1,4 @@
 DIST libsemanage-2.2.tar.gz 138208 SHA256 11f60bfa0f1c6063cd9bd99ce0cb4acc9d6d9e9b8d7743d39e847bcd7803bd75 SHA512 09032b1b322fec7346164939ade118034812cb538ebc72121640d4ac5c89d2a66b59caa465027cfbebb590dee039a26d4345eafedf365d7f6ad0b5e90377d50f WHIRLPOOL 49170c5ee9ff57dcc4a15aa72386f37993f76436f0da25808c60dab2d03ba52932d0d4fa753c326900d83d2fae30f8bcf659251f17327783f2e2be3deb4842f4
 DIST libsemanage-2.3.tar.gz 138231 SHA256 03e09e35e611c286e446bef92b6023ef2623815996f5a53394bb02e49a312e4b SHA512 defe3bbdbe51abdaa13a39f693c33446d8a1a8509ac1eb25c7770da2df6487bcb0ca31259d02b4531d4c81db5e221e94e95bec97f6a1a155e1de2f65e6f0da34 WHIRLPOOL 943d4d300aa8ad49c411b10b41c0c3e751c46dbcbbe129bdd1d2e975e231c58391d6ecdee6b27699fff9f6e6facf5b48fc8d57c2ff68692694c7de430750fac9
 DIST libsemanage-2.4.tar.gz 151173 SHA256 1a4cace4ef16786531ec075c0e7b2f961e2fee5dc86c5f983a689058899a6484 SHA512 54f993253b22207b053daf4d34e72c65c72279866416089b6c0f047ef77bca3e307eac0ce6dfe40bd14e2e47e79841b358d5607501779f38d9b5f7c35f3b7729 WHIRLPOOL 7303c06515ed59b5756a87d08aff07671e51d26ce9fa452ca75643dd0ce4658571dc69d86434c943d691a4ab0d90cbdccdaa27e5aaec5fdf8057cf2d5d30631e
+DIST libsemanage-2.5.tar.gz 152884 SHA256 46e2f36254369b6e91d1eea0460c262b139361b055a3a67d3ceea2d8ef72e006 SHA512 cf644b77d8a24f76c630ece582df1b49a0c5f48f1c9f79b1caee0df10372008954406974472a072360dbe6de5ebc19b1b21bb247084d75b7186f61b32f33b8ec WHIRLPOOL 397b7fd2e9b2c00dbc2f58bdc023501dcd7ecf1212fef9ad7993b4763a041068416ef06552c0abf0beef8c69f4704933feca36951866c43d867181332971f6be
diff --git a/sys-libs/libsemanage/libsemanage-2.5.ebuild b/sys-libs/libsemanage/libsemanage-2.5.ebuild
new file mode 100644 (file)
index 0000000..4b838bf
--- /dev/null
@@ -0,0 +1,127 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 python3_3 python3_4 )
+
+inherit multilib python-r1 toolchain-funcs eutils multilib-minimal
+
+MY_P="${P//_/-}"
+
+SEPOL_VER="${PV}"
+SELNX_VER="${PV}"
+
+DESCRIPTION="SELinux kernel and policy management library"
+HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
+SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20160223/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86"
+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"
+
+S="${WORKDIR}/${MY_P}"
+
+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"
+
+       epatch "${FILESDIR}"/${PN}-2.4-build-paths.patch
+
+       epatch_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
+}
index 687be201666c6e4471d72d3ca904d63db0b2bd1f..ce10d31bd424cd1c2c734356d777a27a9ab6f8c0 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -8,7 +8,7 @@ PYTHON_COMPAT=( python2_7 python3_3 python3_4 )
 inherit multilib python-r1 toolchain-funcs eutils multilib-minimal
 
 MY_P="${P//_/-}"
-MY_RELEASEDATE="20150202"
+MY_RELEASEDATE="20160223"
 
 SEPOL_VER="${PV}"
 SELNX_VER="${PV}"
@@ -21,7 +21,7 @@ if [[ ${PV} == 9999 ]] ; then
        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/20150202/${MY_P}.tar.gz"
+       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