summaryrefslogtreecommitdiff
blob: b7dd1f413a9321c02d3ecb47262e0cba63d48507 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/rsbac-admin/rsbac-admin-1.2.3_pre5.ebuild,v 1.3 2004/07/15 02:30:02 agriffis Exp $

IUSE=""

# RSBAC Adming packet name
RSBACV=1.2.3
REL="-pre5"

DESCRIPTION="RSBAC Admin Tools"
HOMEPAGE="http://www.gentoo.org/proj/en/hardened/rsbac/"
SRC_URI="mirror://rsbac-admin-v${RSBACV}${REL}.tar.bz2  http://zeus.polsl.gliwice.pl/~albeiro/rsbac/v1.2.3/rsbac-admin-v${RSBACV}${REL}.tar.bz2"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~x86"

DEPEND="dev-util/dialog
		>=sys-kernel/rsbac-dev-sources-2.6.5"
RDEPEND=">=sys-libs/ncurses-5.2"

src_unpack() {
	cd ${WORKDIR}
	unpack rsbac-admin-v${RSBACV}${REL}.tar.bz2 || die "cannot unpack rsbac-admin tool"

}

src_compile() {
	cd ${WORKDIR}/rsbac-admin-v${RSBACV}
	econf || die "cannot ./configure RSBAC Admin Tools"
	cd contrib/rsbac-klogd-2.0; econf || die "cannot ./configure rsbac-klogd"
	cd ${WORKDIR}/rsbac-admin-v${RSBACV}
	emake || die "cannot make RSBAC Admin tools: Did you really already compiled a RSBAC-enabled kernel ? Please check the documentation at: http://hardened.gentoo.org/rsbac"

	emake -C contrib/rsbac-klogd-2.0 || die "cannot make rsbac-klogd"
}

src_install() {
	cd ${WORKDIR}/rsbac-admin-v${RSBACV}
	einstall || die "cannot make install"
	einstall -C contrib/rsbac-klogd-2.0 || die "cannot install rsbac-klogd"
	instinto /etc
	newinst ${FILESDIR}/rsbac.conf rsbac.conf
	exeinto /etc/init.d
	newexe ${FILESDIR}/rklogd.init rklogd
	dodir /secoff
	dodir /secoff/log
	keepdir /secoff
	ewarn "Please see http://www.gentoo.org/proj/en/hardened/rsbac and emerge the corresponding rsbac-dev-sources before you start using RSBAC"
}

pkg_postinst() {
	if ! groupmod secoff; then
		groupadd -g 400 secoff || die "problem adding group secoff"
	fi

	if ! id secoff; then
		useradd -c "Security Officer" -d /secoff -s /bin/bash -g secoff -u 400 secoff
		assert "problem adding user secoff"
		chmod 700 /secoff /secoff/log || die "problem changing permissions of /secoff and /secoff/log"
		chown secoff:secoff -R /secoff || die "problem changing ownership of /secoff"
	fi
}