dev-python/coverage: version bump to 4.0
[gentoo.git] / app-admin / conserver / conserver-8.1.18-r1.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="4"
6
7 inherit ssl-cert eutils pam autotools
8
9 DESCRIPTION="Serial Console Manager"
10 HOMEPAGE="http://www.conserver.com/"
11 SRC_URI="http://www.conserver.com/${P}.tar.gz"
12
13 LICENSE="BSD GPL-2"
14 SLOT="0"
15 KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
16 IUSE="kerberos pam ssl tcpd debug"
17
18 DEPEND="ssl? ( >=dev-libs/openssl-0.9.6g )
19         pam? ( virtual/pam )
20         tcpd? ( sys-apps/tcp-wrappers )
21         debug? ( dev-libs/dmalloc )
22         kerberos? (
23                 virtual/krb5
24                 net-libs/libgssglue
25         )"
26 RDEPEND="${DEPEND}
27         pam? ( >=sys-auth/pambase-20080219.1 )"
28
29 src_prepare() {
30         # Apply patch to prevent package from stripping binaries
31         epatch "${FILESDIR}"/${PN}-prestrip.patch
32
33         # Apply patch to use custom dmalloc macro
34         epatch "${FILESDIR}"/${P}-dmalloc.patch
35
36         AT_M4DIR="m4" eautoreconf
37 }
38
39 src_configure() {
40         econf \
41                 $(use_with ssl openssl) \
42                 $(use_with pam) \
43                 $(use_with tcpd libwrap) \
44                 $(use_with debug dmalloc) \
45                 $(use_with kerberos gssapi) \
46                 --with-logfile=/var/log/conserver.log \
47                 --with-pidfile=/var/run/conserver.pid \
48                 --with-cffile=conserver/conserver.cf \
49                 --with-pwdfile=conserver/conserver.passwd \
50                 --with-master=localhost \
51                 --with-port=7782
52 }
53
54 src_install() {
55         emake DESTDIR="${D}" exampledir="/usr/share/doc/${PF}/examples" install
56
57         ## create data directory
58         dodir /var/consoles
59         fowners daemon:daemon /var/consoles
60         fperms 700 /var/consoles
61
62         ## add startup and sample config
63         newinitd "${FILESDIR}"/conserver.initd-r1 conserver
64         newconfd "${FILESDIR}"/conserver.confd conserver
65
66         dodir /etc/conserver
67         fperms 700 /etc/conserver
68         insinto /etc/conserver
69         newins "${S}"/conserver.cf/conserver.cf conserver.cf.sample
70         newins "${S}"/conserver.cf/conserver.passwd conserver.passwd.sample
71
72         ## add docs
73         dohtml conserver.html
74         dodoc CHANGES FAQ PROTOCOL README TODO
75         dodoc conserver/Sun-serial contrib/maketestcerts
76         newdoc conserver.cf/conserver.cf conserver.cf.sample
77
78         # Add pam config
79         newpamd "${FILESDIR}"/conserver.pam-pambase conserver
80 }
81
82 pkg_postinst() {
83         # Add certs if SSL use flag is enabled
84         if use ssl && [ ! -f "${ROOT}"/etc/ssl/conserver/conserver.key ]; then
85                 install_cert /etc/ssl/conserver/conserver
86         fi
87 }