1 |
commit: 493cad2cd714d20609f88f968c2d34554a11655e |
2 |
Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 22 16:11:27 2016 +0000 |
4 |
Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Dec 22 16:11:46 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=493cad2c |
7 |
|
8 |
net-misc/radvd: update to use /run everywhere |
9 |
|
10 |
Package-Manager: portage-2.3.0 |
11 |
|
12 |
net-misc/radvd/files/radvd-2.15.init | 71 ++++++++++++++++++++++++++++++++++++ |
13 |
net-misc/radvd/radvd-2.15-r1.ebuild | 67 ++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 138 insertions(+) |
15 |
|
16 |
diff --git a/net-misc/radvd/files/radvd-2.15.init b/net-misc/radvd/files/radvd-2.15.init |
17 |
new file mode 100644 |
18 |
index 00000000..1603d5d |
19 |
--- /dev/null |
20 |
+++ b/net-misc/radvd/files/radvd-2.15.init |
21 |
@@ -0,0 +1,71 @@ |
22 |
+#!/sbin/openrc-run |
23 |
+# Copyright 1999-2016 Gentoo Foundation |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+# $Id$ |
26 |
+ |
27 |
+CONFIGFILE=/etc/radvd.conf |
28 |
+PIDFILE=/run/radvd/radvd.pid |
29 |
+SYSCTL_FORWARD=net.ipv6.conf.all.forwarding |
30 |
+ |
31 |
+extra_started_commands="reload" |
32 |
+ |
33 |
+depend() { |
34 |
+ need net |
35 |
+} |
36 |
+ |
37 |
+checkconfig() { |
38 |
+ if [ ! -f "${CONFIGFILE}" ]; then |
39 |
+ eerror "Configuration file ${CONFIGFILE} not found" |
40 |
+ return 1 |
41 |
+ fi |
42 |
+ |
43 |
+ if ! /usr/sbin/radvd -c -C "${CONFIGFILE}" ; then |
44 |
+ eerror "Configuration file ${CONFIGFILE} failed test" |
45 |
+ return 1 |
46 |
+ fi |
47 |
+ |
48 |
+ checkpath -d -o radvd:radvd ${PIDFILE%/*} |
49 |
+} |
50 |
+ |
51 |
+start() { |
52 |
+ if [ "${FORWARD}" != "no" ]; then |
53 |
+ ebegin "Enabling IPv6 forwarding" |
54 |
+ sysctl -w "${SYSCTL_FORWARD}=1" >/dev/null |
55 |
+ eend $? |
56 |
+ fi |
57 |
+ |
58 |
+ checkconfig || return 1 |
59 |
+ |
60 |
+ ebegin "Starting IPv6 Router Advertisement Daemon" |
61 |
+ start-stop-daemon --start --exec /usr/sbin/radvd \ |
62 |
+ --pidfile "${PIDFILE}" \ |
63 |
+ -- -C "${CONFIGFILE}" -p "${PIDFILE}" -u radvd ${OPTIONS} |
64 |
+ eend $? |
65 |
+} |
66 |
+ |
67 |
+stop() { |
68 |
+ ebegin "Stopping IPv6 Router Advertisement Daemon" |
69 |
+ start-stop-daemon --stop --exec /usr/sbin/radvd --pidfile "${PIDFILE}" |
70 |
+ eend $? |
71 |
+ |
72 |
+ if [ "${FORWARD}" != "no" ]; then |
73 |
+ ebegin "Disabling IPv6 forwarding" |
74 |
+ sysctl -w "${SYSCTL_FORWARD}=0" > /dev/null |
75 |
+ eend $? |
76 |
+ fi |
77 |
+} |
78 |
+ |
79 |
+reload() { |
80 |
+ if [ "${FORWARD}" != "no" ]; then |
81 |
+ ebegin "Enabling IPv6 forwarding" |
82 |
+ sysctl -w "${SYSCTL_FORWARD}=1" >/dev/null |
83 |
+ eend $? |
84 |
+ fi |
85 |
+ |
86 |
+ checkconfig || return 1 |
87 |
+ |
88 |
+ ebegin "Reloading IPv6 Router Advertisement Daemon" |
89 |
+ start-stop-daemon --signal HUP \ |
90 |
+ --exec /usr/sbin/radvd --pidfile "${PIDFILE}" |
91 |
+ eend $? |
92 |
+} |
93 |
|
94 |
diff --git a/net-misc/radvd/radvd-2.15-r1.ebuild b/net-misc/radvd/radvd-2.15-r1.ebuild |
95 |
new file mode 100644 |
96 |
index 00000000..a19b60e |
97 |
--- /dev/null |
98 |
+++ b/net-misc/radvd/radvd-2.15-r1.ebuild |
99 |
@@ -0,0 +1,67 @@ |
100 |
+# Copyright 1999-2016 Gentoo Foundation |
101 |
+# Distributed under the terms of the GNU General Public License v2 |
102 |
+# $Id$ |
103 |
+ |
104 |
+EAPI=5 |
105 |
+ |
106 |
+inherit systemd user eutils readme.gentoo-r1 |
107 |
+ |
108 |
+DESCRIPTION="Linux IPv6 Router Advertisement Daemon" |
109 |
+HOMEPAGE="http://v6web.litech.org/radvd/" |
110 |
+SRC_URI="http://v6web.litech.org/radvd/dist/${P}.tar.gz" |
111 |
+ |
112 |
+LICENSE="BSD" |
113 |
+SLOT="0" |
114 |
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~sparc ~x86 ~x86-fbsd" |
115 |
+IUSE="kernel_FreeBSD selinux test" |
116 |
+ |
117 |
+CDEPEND="dev-libs/libdaemon" |
118 |
+DEPEND="${CDEPEND} |
119 |
+ sys-devel/bison |
120 |
+ sys-devel/flex |
121 |
+ virtual/pkgconfig |
122 |
+ test? ( dev-libs/check )" |
123 |
+RDEPEND="${CDEPEND} |
124 |
+ selinux? ( sec-policy/selinux-radvd ) |
125 |
+" |
126 |
+DOCS=( CHANGES README TODO radvd.conf.example ) |
127 |
+ |
128 |
+pkg_setup() { |
129 |
+ enewgroup radvd |
130 |
+ enewuser radvd -1 -1 /dev/null radvd |
131 |
+} |
132 |
+ |
133 |
+src_configure() { |
134 |
+ econf --with-pidfile=/run/radvd/radvd.pid \ |
135 |
+ --disable-silent-rules \ |
136 |
+ --with-systemdsystemunitdir=no \ |
137 |
+ $(use_with test check) |
138 |
+} |
139 |
+ |
140 |
+src_install() { |
141 |
+ default |
142 |
+ |
143 |
+ dohtml INTRO.html |
144 |
+ |
145 |
+ newinitd "${FILESDIR}"/${PN}-2.15.init ${PN} |
146 |
+ newconfd "${FILESDIR}"/${PN}.conf ${PN} |
147 |
+ |
148 |
+ systemd_dounit "${FILESDIR}"/${PN}.service |
149 |
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}.conf |
150 |
+ |
151 |
+ if use kernel_FreeBSD ; then |
152 |
+ sed -i -e \ |
153 |
+ 's/^SYSCTL_FORWARD=.*$/SYSCTL_FORWARD=net.inet6.ip6.forwarding/g' \ |
154 |
+ "${D}"/etc/init.d/${PN} || die |
155 |
+ fi |
156 |
+ |
157 |
+ readme.gentoo_create_doc |
158 |
+} |
159 |
+ |
160 |
+DISABLE_AUTOFORMATTING=1 |
161 |
+DOC_CONTENTS="Please create a configuration file ${ROOT}etc/radvd.conf. |
162 |
+See ${ROOT}usr/share/doc/${PF} for an example. |
163 |
+ |
164 |
+grsecurity users should allow a specific group to read /proc |
165 |
+and add the radvd user to that group, otherwise radvd may |
166 |
+segfault on startup." |