summaryrefslogtreecommitdiff
blob: 5c35e22e8bfd22383d5eecb2f38348dea63e7e12 (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/syslogread/syslogread-0.92.ebuild,v 1.3 2007/01/24 15:02:03 genone Exp $

inherit eutils toolchain-funcs

DESCRIPTION="Syslog message handling tools"
HOMEPAGE="http://untroubled.org/syslogread/"
SRC_URI="http://untroubled.org/syslogread/archive/${P}.tar.gz"

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

DEPEND=">=dev-libs/bglibs-1.019-r1"
RDEPEND="sys-process/daemontools"
PROVIDE="virtual/logger"

pkg_preinst() {
	enewgroup syslog
	enewuser syslog -1 -1 /nonexistent syslog
}

src_compile() {
	echo "/usr/include/bglibs/" > conf-bgincs
	echo "/usr/lib/bglibs/" > conf-bglibs
	echo "${D}/usr/bin" > conf-bin
	echo "${D}/usr/share/man" > conf-man
	echo "$(tc-getCC) ${CFLAGS}" > conf-cc
	echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
	make || die  #don't use emake b/c of jobserver
}

src_install() {
	dodir /usr/bin
	dodir /usr/share/man
	./installer || die

	#newinitd "${FILESDIR}/${PV}/syslogread.init" syslogread

	dodoc ANNOUNCEMENT ChangeLog README

	insinto /var/lib/supervise/klogd
	newins "${FILESDIR}/${PV}/klogd.run" klogd.run

	insinto /var/lib/supervise/syslogd
	newins "${FILESDIR}/${PV}/syslogread.run" syslogread.run

	insinto /var/lib/supervise/syslogd/log
	newins "${FILESDIR}/${PV}/syslogread-log.run" syslogread-log.run

	keepdir /var/log/klogd
	keepdir /var/log/syslog

	fowners syslog:syslog /var/log/syslog
	fperms o-rwx /var/log/syslog
}

pkg_postinst() {
	echo
	elog "Run "
	elog "emerge --config =${PF}"
	elog "to create or update your run files (backups are created) in"
	elog "    /var/lib/supervise/klogd (kernel logger)"
	elog "    /var/lib/supervise/syslog (system logger)"
	echo
}

pkg_config() {
	cd /var/lib/supervise/klogd
	[ -e run ] && cp run klogd.run.`date +%Y%m%d%H%M%S`
	cp klogd.run run
	chmod u+x run

	cd /var/lib/supervise/syslogd
	[ -e run ] && cp run syslogread.run.`date +%Y%m%d%H%M%S`
	cp syslogread.run run
	chmod u+x run

	cd /var/lib/supervise/syslogd/log
	[ -e run ] && cp run syslogread-log.run.`date +%Y%m%d%H%M%S`
	cp syslogread-log.run run
	chmod u+x run
}