| 1 |
# Copyright 1999-2005 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sys-apps/gradm/gradm-2.0.1.ebuild,v 1.5 2005/01/08 21:26:59 solar Exp $
|
| 4 |
|
| 5 |
inherit flag-o-matic gcc
|
| 6 |
|
| 7 |
#MY_PV=2.0-${PV/*_/}
|
| 8 |
|
| 9 |
MAINTAINER="solar@gentoo.org"
|
| 10 |
DESCRIPTION="Administrative interface for grsecuritys2 access control lists"
|
| 11 |
HOMEPAGE="http://www.grsecurity.net/"
|
| 12 |
#SRC_URI="http://www.grsecurity.net/gradm-${PV}.tar.gz"
|
| 13 |
SRC_URI="mirror://gentoo/gradm-${PV}.tar.gz"
|
| 14 |
|
| 15 |
LICENSE="GPL-2"
|
| 16 |
SLOT="0"
|
| 17 |
KEYWORDS="x86 ~ppc ~sparc ~arm ~amd64" ; # ~alpha"
|
| 18 |
IUSE=""
|
| 19 |
|
| 20 |
DEPEND="virtual/libc
|
| 21 |
sys-devel/bison
|
| 22 |
sys-devel/flex
|
| 23 |
sys-apps/chpax"
|
| 24 |
|
| 25 |
S="${WORKDIR}/${PN}2"
|
| 26 |
|
| 27 |
src_unpack() {
|
| 28 |
unpack ${A}
|
| 29 |
cd ${S}
|
| 30 |
|
| 31 |
# Fixup for hardened-dev-sources-2.6.5-r5
|
| 32 |
#ebegin "Patching gradm 2.0 sources with a few cvs fixes"
|
| 33 |
#patch -p1 -s -N -E -d ${S} < ${FILESDIR}/gradm2-cvs-20Jun2004.diff || die
|
| 34 |
#eend $?
|
| 35 |
|
| 36 |
# (Jan 03 2004) - <solar@gentoo>
|
| 37 |
# static linking required for proper operation of gradm
|
| 38 |
# however ssp is known to break static linking when it's enabled
|
| 39 |
# in >=gcc-3.3.1 && <=gcc-3.3.2-r5 . So we strip ssp if needed.
|
| 40 |
gmicro=$(gcc-micro-version)
|
| 41 |
if [ "$(gcc-version)" == "3.3" -a -n "${gmicro}" -a ${gmicro} -le 2 ]; then
|
| 42 |
# extract out gentoo revision
|
| 43 |
gentoo_gcc_r=$($(gcc-getCC) -v 2>&1 | tail -n 1 | awk '{print $7}')
|
| 44 |
gentoo_gcc_r=${gentoo_gcc_r/,/}
|
| 45 |
gentoo_gcc_r=${gentoo_gcc_r/-/ }
|
| 46 |
gentoo_gcc_r=${gentoo_gcc_r:7}
|
| 47 |
[ -n "${gentoo_gcc_r}" -a ${gentoo_gcc_r} -le 5 ] && \
|
| 48 |
filter-flags -fstack-protector -fstack-protector-all
|
| 49 |
fi
|
| 50 |
|
| 51 |
ebegin "Patching Makefile to use gentoo CFLAGS"
|
| 52 |
sed -i -e "s|-O2|${CFLAGS}|" Makefile
|
| 53 |
eend $?
|
| 54 |
|
| 55 |
}
|
| 56 |
|
| 57 |
src_compile() {
|
| 58 |
cd ${S}
|
| 59 |
emake CC="$(gcc-getCC)" || die "compile problem"
|
| 60 |
}
|
| 61 |
|
| 62 |
src_install() {
|
| 63 |
cd ${S}
|
| 64 |
# Were not ready for init.d,script functions yet.
|
| 65 |
#exeinto /etc/init.d
|
| 66 |
#newexe ${FILESDIR}/grsecurity2.rc grsecurity2
|
| 67 |
#insinto /etc/conf.d
|
| 68 |
#doins ${FILESDIR}/grsecurity2
|
| 69 |
|
| 70 |
mkdir -p -m 700 ${D}/etc/grsec
|
| 71 |
doman gradm.8
|
| 72 |
dodoc acl
|
| 73 |
|
| 74 |
into /
|
| 75 |
dosbin grlearn gradm || die
|
| 76 |
|
| 77 |
# Normal users can authenticate to special roles now and thus
|
| 78 |
# need execution permission on gradm2. We remove group,other readable bits
|
| 79 |
# to help ensure that our gradm2 binary is as protected from misbehaving users.
|
| 80 |
fperms 711 ${D}/sbin/gradm
|
| 81 |
}
|
| 82 |
|
| 83 |
pkg_postinst() {
|
| 84 |
if [ ! -e /dev/grsec ] ; then
|
| 85 |
einfo "Making character device for grsec2 learning mode"
|
| 86 |
mkdir -p -m 755 /dev/
|
| 87 |
mknod -m 0622 /dev/grsec c 1 12 || die "Cant mknod for grsec learning device"
|
| 88 |
fi
|
| 89 |
}
|