fd3a2e95a2c08f43c353a04d7db9c1667a0c91fa
[gentoo.git] / sys-process / daemontools / daemontools-0.76-r8.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit flag-o-matic qmail
7
8 DESCRIPTION="Collection of tools for managing UNIX services"
9 HOMEPAGE="http://cr.yp.to/daemontools.html"
10 SRC_URI="http://cr.yp.to/daemontools/${P}.tar.gz
11         http://smarden.org/pape/djb/manpages/${P}-man-20020131.tar.gz"
12
13 LICENSE="public-domain"
14 SLOT="0"
15 KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 m68k ~mips ppc ppc64 s390 sparc x86"
16 IUSE="selinux static"
17
18 DEPEND=""
19 RDEPEND="selinux? ( sec-policy/selinux-daemontools )
20         !app-doc/daemontools-man"
21
22 S="${WORKDIR}/admin/${P}/src"
23
24 PATCHES=(
25         "${FILESDIR}"/${PV}-errno.patch
26         "${FILESDIR}"/${PV}-warnings.patch
27 )
28
29 src_prepare() {
30         default
31
32         ht_fix_file Makefile print-{cc,ld}.sh
33
34         use static && append-ldflags -static
35         qmail_set_cc
36 }
37
38 src_compile() {
39         touch home || die
40         emake
41 }
42
43 src_install() {
44         keepdir /service
45
46         dobin $(<../package/commands)
47         dodoc CHANGES ../package/README TODO
48         doman "${WORKDIR}"/${PN}-man/*.8
49
50         newinitd "${FILESDIR}"/svscan.init-0.76-r7 svscan
51 }
52
53 pkg_postinst() {
54         einfo
55         einfo "You can run daemontools using the svscan init.d script,"
56         einfo "or you could run it through inittab."
57         einfo "To use inittab, emerge supervise-scripts and run:"
58         einfo "svscan-add-to-inittab"
59         einfo "Then you can hup init with the command telinit q"
60         einfo
61 }