summaryrefslogtreecommitdiff
blob: 75ef409c66fb1c5ee46f9142bae0d95cbc36a810 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/osiris/osiris-4.2.2.ebuild,v 1.4 2007/07/13 06:07:37 mr_bones_ Exp $

inherit eutils autotools

DESCRIPTION="File integrity verification system"
HOMEPAGE="http://osiris.shmoo.com/"
SRC_URI="http://osiris.shmoo.com/data/${P}.tar.gz
	http://osiris.shmoo.com/data/modules/mod_uptime.tar.gz
	http://osiris.shmoo.com/data/modules/mod_dns.tar.gz
	http://osiris.shmoo.com/data/modules/mod_nvram.tar.gz"
#	http://osiris.shmoo.com/data/modules/mod_ports.tar.gz"

LICENSE="OSIRIS"
SLOT="0"
KEYWORDS="~x86 ~ppc"
#IUSE="noagent console"
IUSE=""

DEPEND=">=dev-libs/openssl-0.9.8c
	=sys-libs/db-4.2*"

pkg_setup()
{
	enewgroup osiris
	enewuser osiris -1 -1 /var/lib/osiris osiris
}

src_unpack()
{
	unpack ${P}.tar.gz
	epatch "${FILESDIR}"/${P}-externaldb.patch
	cd "${S}"
	./bootstrap
	#eautomake
	cd "${WORKDIR}"
	unpack mod_uptime.tar.gz
	unpack mod_dns.tar.gz
	unpack mod_nvram.tar.gz
#	unpack mod_ports.tar.gz
#	Add the above modules
	mv "${S}"/../mod_* "${S}"/src/osirisd/modules/
}

src_compile()
{
	econf --prefix=/var/lib --enable-fancy-cli=yes || die "configure failed."
#	if  ! use noagent ; then
		emake agent || die "agent build failed"
#	fi
#	if use console ; then
		emake console || die "management build failed"
#	fi
}

src_install() {
	elog "Osiris Scanning Daemon Version $VERSION for $SYSTEM"
	elog "Copyright (c) 2006 Brian Wotring. All Rights Reserved."
	elog ""
	elog ""
	elog "This installation was configured and built to run as osiris"
	elog "     agent user name: osiris"
	elog "management user name: osiris"
	elog ""
	elog "This installation was configured and built to use osiris"
	elog "     agent root directory: /var/lib/osiris"
	elog "management root directory: /var/lib/osiris"
	elog ""
	elog "The username and directory will be created during the"
	elog "installation process if they do not already exist."
	elog ""
	elog "By installing this product you agree that you have read the"
	elog "LICENSE file and will comply with its terms. "
	elog ""
	elog "---------------------------------------------------------------------"
	elog ""

#	if ! use noagent ; then
		dosbin src/osirisd/osirisd
		fowners root:0 /usr/sbin/osirisd
		fperms 0755 /usr/sbin/osirisd
		newinitd "${FILESDIR}"/osirisd-${PV} osirisd
		newconfd "${FILESDIR}"/osirisd_confd-${PV} osirisd
#	fi

#	if use console; then
		dosbin src/cli/osiris
		fowners root:0 /usr/sbin/osiris
		fperms 0755 /usr/sbin/osiris

		dosbin src/osirismd/osirismd
		fowners osiris:osiris /usr/sbin/osirismd
		fperms 4755 /usr/sbin/osirismd

		newinitd "${FILESDIR}"/osirismd-${PV} osirismd
		newconfd "${FILESDIR}"/osirismd_confd-${PV} osirismd
#	fi

	dodir /var/run
	dodir /var/lib
	diropts -o osiris -g osiris -m0750
	dodir /var/lib/osiris
	dodir /var/run/osiris
	keepdir /var/run/osiris
#	if use console ; then
		cp -rf "${S}"/src/configs "${D}"/var/lib/osiris/
		chown -R osiris:osiris "${D}"/var/lib/osiris/*
		chmod -R 0750 "${D}"/var/lib/osiris/*
#	fi
}

#pkg_postinst()
#{
#	if ! use console ; then
#		elog "By default, the osiris ebuild only installs the agent."
#		elog "To enable installing the console, please add the 'console' flag"
#		elog "to your USE variable and re-emerge osiris."
#	fi
#}

pkg_postrm()
{
	# PID directory should not clutter the
	# system
	rm -rf /var/run/osiris

	# Allow the user to decide if certs,
	# configs, and other things should
	# be
	# removed.
	elog "The directory /var/lib/osiris will not be removed. You may remove"
	elog "it manually if you will not be reinstalling osiris at a later time."
}