File: samhain.ebuild.in

package info (click to toggle)
samhain 2.2.3-6.2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 6,428 kB
  • ctags: 4,586
  • sloc: ansic: 58,140; sh: 11,949; asm: 4,866; makefile: 1,487; perl: 1,032
file content (98 lines) | stat: -rw-r--r-- 2,897 bytes parent folder | download | duplicates (2)
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
# Copyright 2004 Rainer Wichmann
# Distributed under the terms of the GNU General Public License v2

inherit eutils

MY_P="${PN}_signed-${PV}"
SLOT="0"
LICENSE="GPL-2"
DESCRIPTION="Samhain is a file integrity checker with optional central logging"

# This is a fake URI that allows us to do a 'make dist' and copy
# the file to distdir. 
# The proper URI would be http://www.la-samhna.de/archive/${MY_P}.tar.gz,
# but this would force us to do a 'make dist-sign' ...
# Apparently, portage cannot handle the file:// scheme,
# and not every user might be prepared to create a signed tarball.
#
# SRC_URI="http://www.la-samhna.de/archive/${MY_P}.tar.gz"
SRC_URI="http://www.la-samhna.de/archive/${P}.tar.gz"


HOMEPAGE="http://www.la-samhna.de/samhain/"

KEYWORDS="x86"

IUSE=""

DEPEND="app-arch/gzip
	app-arch/tar"
#	mysql? (>=dev-db/mysql-3.23.58)"
RDEPEND=""

src_unpack() {
        unpack ${A}
        cd ${WORKDIR}
        if test -f ${P}.tar.gz; then
	   gunzip -c ${P}.tar.gz | tar xf -  || die
	   cd ${P}
	elif test -d "samhain-${PV}"; then
	   mv "samhain-${PV}" "@install_name@-${PV}"
	fi
}

src_compile() {
	local myconf="--with-trusted=0,250"

#	myconf="$myconf --enable-mounts-check"
#	myconf="$myconf --enable-userfiles"

#	use mysql    && myconf="$myconf --with-database=mysql"
#	use postgres && myconf="$myconf --with-database=postgresql"

#        econf \
#	      --with-pid-file=/var/run/${PN}.pid \
#	      --with-state-dir=/var/lib/${PN} \
#	      --with-log-file=/var/log/${PN}.log \

	./configure ${myconf} @mydefargs@ || die
        emake || die

	echo '#!/bin/sh' > ./sstrip
	echo 'echo "*** SSTRIP DISABLED ***"' >> ./sstrip
}

src_install() {
        make DESTDIR=${D} install  || die
        make DESTDIR=${D} install-boot  || die

	dodoc docs/BUGS COPYING docs/Changelog LICENSE docs/README \
	      docs/README.UPGRADE docs/sh_mounts.txt docs/sh_userfiles.txt \
	      docs/MANUAL-2_0.ps docs/MANUAL-2_0.html.tar

	dohtml docs/HOWTO-client+server.html docs/HOWTO-samhain+GnuPG.html \
	       docs/HOWTO-write-modules.html docs/HOWTO-samhain-on-windows.html \
	       docs/HOWTO-client+server-troubleshooting.html docs/FAQ.html 
}

pkg_prerm() {
	rc-update del @install_name@
	einfo "Stopping service @install_name@"
	test -f /etc/init.d/@install_name@ && /etc/init.d/@install_name@ stop
	sleep 3
}

pkg_postinst() {
	rc-update add @install_name@ default
	einfo
        einfo "@install_name@ is installed but is NOT running yet, and the database"
	einfo "of file signatures is NOT initialized yet."
	einfo
	einfo "You need to run \"@install_name@ -t init\" to initialize "
        einfo "the baseline database of file signatures."
        einfo
	einfo "After initializing the database, you can start @install_name@ "
	einfo "with \"/etc/init.d/@install_name@ start\". It is configured to start"
	einfo "automatically on the next boot for runlevel \"default\""
}