sys-apps/file: Bump to version 5.32
[gentoo.git] / sys-apps / sandbox / sandbox-2.10-r3.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 #
5 # don't monkey with this ebuild unless contacting portage devs.
6 # period.
7 #
8
9 EAPI="5"
10
11 inherit eutils flag-o-matic multilib-minimal multiprocessing pax-utils
12
13 DESCRIPTION="sandbox'd LD_PRELOAD hack"
14 HOMEPAGE="https://www.gentoo.org/proj/en/portage/sandbox/"
15 SRC_URI="mirror://gentoo/${P}.tar.xz
16         https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
17
18 LICENSE="GPL-2"
19 SLOT="0"
20 KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
21 IUSE=""
22
23 DEPEND="app-arch/xz-utils
24         >=app-misc/pax-utils-0.1.19" #265376
25 RDEPEND=""
26
27 has sandbox_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS="${EBUILD_DEATH_HOOKS} sandbox_death_notice"
28
29 sandbox_death_notice() {
30         ewarn "If configure failed with a 'cannot run C compiled programs' error, try this:"
31         ewarn "FEATURES='-sandbox -usersandbox' emerge sandbox"
32 }
33
34 src_prepare() {
35         epatch "${FILESDIR}"/${P}-memory-corruption.patch #568714
36         epatch "${FILESDIR}"/${P}-disable-same.patch
37         epatch "${FILESDIR}"/${P}-fix-opendir.patch #553092
38         epatch_user
39 }
40
41 multilib_src_configure() {
42         filter-lfs-flags #90228
43
44         local myconf=()
45         host-is-pax && myconf+=( --disable-pch ) #301299 #425524 #572092
46
47         ECONF_SOURCE="${S}" \
48         econf "${myconf[@]}"
49 }
50
51 multilib_src_test() {
52         # Default sandbox build will run with --jobs set to # cpus.
53         emake check TESTSUITEFLAGS="--jobs=$(makeopts_jobs)"
54 }
55
56 multilib_src_install_all() {
57         doenvd "${FILESDIR}"/09sandbox
58
59         keepdir /var/log/sandbox
60         fowners root:portage /var/log/sandbox
61         fperms 0770 /var/log/sandbox
62
63         cd "${S}"
64         dodoc AUTHORS ChangeLog* NEWS README
65 }
66
67 pkg_preinst() {
68         chown root:portage "${ED}"/var/log/sandbox
69         chmod 0770 "${ED}"/var/log/sandbox
70
71         if [[ ${REPLACING_VERSIONS} == 1.* ]] ; then
72                 local old=$(find "${EROOT}"/lib* -maxdepth 1 -name 'libsandbox*')
73                 if [[ -n ${old} ]] ; then
74                         elog "Removing old sandbox libraries for you:"
75                         find "${EROOT}"/lib* -maxdepth 1 -name 'libsandbox*' -print -delete
76                 fi
77         fi
78 }
79
80 pkg_postinst() {
81         if [[ ${REPLACING_VERSIONS} == 1.* ]] ; then
82                 chmod 0755 "${EROOT}"/etc/sandbox.d #265376
83         fi
84 }