Use https by default
[gentoo.git] / app-admin / sysrqd / sysrqd-14.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 inherit eutils toolchain-funcs
6
7 IUSE=""
8 DESCRIPTION="daemon providing access to the kernel sysrq functions via network"
9 HOMEPAGE="http://julien.danjou.info/projects/sysrqd"
10 #SRC_URI="http://julien.danjou.info/${PN}/${P}.tar.gz"
11 SRC_URI="https://dev.gentoo.org/~wschlich/src/${CATEGORY}/${PN}/${P}.tar.gz"
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~x86 ~amd64"
15 DEPEND=""
16 RDEPEND="${DEPEND}"
17
18 src_unpack() {
19         unpack ${A}
20         cd "${S}"
21         epatch "${FILESDIR}/${PN}-config.patch"
22 }
23
24 src_compile() {
25         $(tc-getCC) ${CFLAGS} ${LDFLAGS} -o sysrqd sysrqd.c
26 }
27
28 src_install() {
29         dosbin sysrqd
30         newinitd "${FILESDIR}/sysrqd.init" sysrqd
31
32         local bindip='127.0.0.1' secret
33         declare -i secret
34         let secret=${RANDOM}*${RANDOM}*${RANDOM}*${RANDOM}
35         echo ${bindip} > sysrqd.bind
36         echo ${secret} > sysrqd.secret
37
38         diropts -m 0700 -o root -g root
39         dodir /etc/sysrqd
40         insinto /etc/sysrqd
41         insopts -m 0600 -o root -g root
42         doins sysrqd.bind
43         doins sysrqd.secret
44
45         dodoc README ChangeLog
46 }
47
48 pkg_postinst() {
49         elog
50         elog "Be sure to change the initial secret in /etc/sysrqd/sysrqd.secret !"
51         elog "As a security precaution, sysrqd is configured to only listen on"
52         elog "127.0.0.1 by default. Change the content of /etc/sysrqd/sysrqd.bind"
53         elog "to an IPv4 address you want it to listen on or remove the file"
54         elog "to make it listen on any IP address (0.0.0.0)."
55         elog
56 }