diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2011-09-26 03:23:06 +0000 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2011-09-26 03:23:06 +0000 |
commit | 9e87d8bc2d39cb8b2f2deaa79d5d922f8ed02f28 (patch) | |
tree | 90939ad235d4844a1227714035c614dd81cbcdb6 /net-misc/tinc | |
parent | Marked ~x86-macos (diff) | |
download | gentoo-2-9e87d8bc2d39cb8b2f2deaa79d5d922f8ed02f28.tar.gz gentoo-2-9e87d8bc2d39cb8b2f2deaa79d5d922f8ed02f28.tar.bz2 gentoo-2-9e87d8bc2d39cb8b2f2deaa79d5d922f8ed02f28.zip |
Rewrite of initd system, added syslog/logfile support, bug #371357
(Portage version: 2.1.10.11/cvs/Linux x86_64)
Diffstat (limited to 'net-misc/tinc')
-rw-r--r-- | net-misc/tinc/ChangeLog | 8 | ||||
-rw-r--r-- | net-misc/tinc/files/tincd.1 | 70 | ||||
-rw-r--r-- | net-misc/tinc/files/tincd.conf.1 | 5 | ||||
-rw-r--r-- | net-misc/tinc/files/tincd.lo.1 | 58 | ||||
-rw-r--r-- | net-misc/tinc/tinc-1.0.16-r1.ebuild | 38 | ||||
-rw-r--r-- | net-misc/tinc/tinc-1.0.16.ebuild | 3 |
6 files changed, 180 insertions, 2 deletions
diff --git a/net-misc/tinc/ChangeLog b/net-misc/tinc/ChangeLog index 722b10e13860..5f046092abad 100644 --- a/net-misc/tinc/ChangeLog +++ b/net-misc/tinc/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-misc/tinc # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/ChangeLog,v 1.24 2011/09/23 18:51:26 blueness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/ChangeLog,v 1.25 2011/09/26 03:23:06 blueness Exp $ + +*tinc-1.0.16-r1 (26 Sep 2011) + + 26 Sep 2011; Anthony G. Basile <blueness@gentoo.org> +tinc-1.0.16-r1.ebuild, + +files/tincd.1, +files/tincd.conf.1, +files/tincd.lo.1: + Rewrite of initd system, added syslog/logfile support, bug #371357 *tinc-1.0.16 (23 Sep 2011) diff --git a/net-misc/tinc/files/tincd.1 b/net-misc/tinc/files/tincd.1 new file mode 100644 index 000000000000..3dc1d61c63f7 --- /dev/null +++ b/net-misc/tinc/files/tincd.1 @@ -0,0 +1,70 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/files/tincd.1,v 1.1 2011/09/26 03:23:06 blueness Exp $ + +extra_commands="reload" + +NETS="/etc/conf.d/tinc.networks" +DAEMON="/usr/sbin/tincd" + +depend() { + use logger dns + need net +} + +checkconfig() { + if ! grep -q '^ *NETWORK:' "${NETS}" ; then + eerror "No VPN networks configured in ${NETS}" + return 1 + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting tinc VPN networks" + awk '/^ *NETWORK:/ { print $2 }' "${NETS}" | while read NETNAME + do + CONFIG="/etc/tinc/${NETNAME}/tinc.conf" + PIDFILE="/var/run/tinc.${NETNAME}.pid" + if [ ! -f "${CONFIG}" ]; then + eerror "Cannot start network ${NETNAME}." + eerror "Please set up ${CONFIG} !" + else + ebegin "Starting tinc network ${NETNAME}" + if [ "${SYSLOG}" == "yes" ]; then + LOG="" + else + LOG="--logfile=/var/log/tinc.${NETNAME}.log" + fi + start-stop-daemon --start --exec "${DAEMON}" -- --net="${NETNAME}" "${LOG}" --pidfile "${PIDFILE}" + eend $? + fi + done +} + +stop() { + ebegin "Stopping tinc VPN networks" + awk '/^ *NETWORK:/ { print $2 }' "${NETS}" | while read NETNAME + do + PIDFILE="/var/run/tinc.${NETNAME}.pid" + if [ -f "${PIDFILE}" ]; then + ebegin "Stopping tinc network ${NETNAME}" + start-stop-daemon --stop --pidfile "${PIDFILE}" + eend $? + fi + done +} + +reload() { + ebegin "Reloading configuration for tinc VPN networks" + awk '/^ *NETWORK:/ { print $2 }' "${NETS}" | while read NETNAME + do + PIDFILE="/var/run/tinc.${NETNAME}.pid" + if [ -f "${PIDFILE}" ]; then + ebegin "Reloading tinc network ${NETNAME}" + start-stop-daemon --signal HUP --pidfile ${PIDFILE} + eend $? + fi + done +} diff --git a/net-misc/tinc/files/tincd.conf.1 b/net-misc/tinc/files/tincd.conf.1 new file mode 100644 index 000000000000..0394702a2af5 --- /dev/null +++ b/net-misc/tinc/files/tincd.conf.1 @@ -0,0 +1,5 @@ +#rc_need="net.net" + +#If you want tincd to log to syslog, then set this to "yes" +#Anything else and tincd will log to /var/log/tinc.NETNAME.log. +SYSLOG="yes" diff --git a/net-misc/tinc/files/tincd.lo.1 b/net-misc/tinc/files/tincd.lo.1 new file mode 100644 index 000000000000..41a2c517ad47 --- /dev/null +++ b/net-misc/tinc/files/tincd.lo.1 @@ -0,0 +1,58 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/files/tincd.lo.1,v 1.1 2011/09/26 03:23:06 blueness Exp $ + +extra_commands="reload" + +DAEMON="/usr/sbin/tincd" + +depend() +{ + use logger dns + need net +} + +start() +{ + NETNAME="${RC_SVCNAME#*.}" + CONFIG="/etc/tinc/${NETNAME}/tinc.conf" + PIDFILE="/var/run/tinc.${NETNAME}.pid" + if [ ! -f "${CONFIG}" ]; then + eerror "Cannot start network ${NETNAME}." + eerror "Please set up ${CONFIG} !" + else + ebegin "Starting tinc network $NETNAME" + if [ "${SYSLOG}" == "yes" ]; then + LOG="" + else + LOG="--logfile=/var/log/tinc.${NETNAME}.log" + fi + start-stop-daemon --start --exec "${DAEMON}" -- --net="${NETNAME}" "${LOG}" --pidfile "${PIDFILE}" + eend $? + fi +} + +stop() +{ + NETNAME="${RC_SVCNAME#*.}" + CONFIG="/etc/tinc/${NETNAME}/tinc.conf" + PIDFILE="/var/run/tinc.${NETNAME}.pid" + if [ -f "${PIDFILE}" ] ; then + ebegin "Stopping tinc network ${NETNAME}" + start-stop-daemon --stop --pidfile "${PIDFILE}" + eend $? + fi +} + +reload() +{ + NETNAME=${RC_SVCNAME#*.} + CONFIG="/etc/tinc/${NETNAME}/tinc.conf" + PIDFILE="/var/run/tinc.${NETNAME}.pid" + if [ -f "${PIDFILE}" ] ; then + ebegin "Reloading tinc network ${NETNAME}" + start-stop-daemon --signal HUP --pidfile "${PIDFILE}" + eend $? + fi +} diff --git a/net-misc/tinc/tinc-1.0.16-r1.ebuild b/net-misc/tinc/tinc-1.0.16-r1.ebuild new file mode 100644 index 000000000000..973d5a4a1fa1 --- /dev/null +++ b/net-misc/tinc/tinc-1.0.16-r1.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/tinc-1.0.16.ebuild,v 1.2 + +EAPI=4 + +DESCRIPTION="tinc is an easy to configure VPN implementation" +HOMEPAGE="http://www.tinc-vpn.org/" +SRC_URI="http://www.tinc-vpn.org/packages/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~ppc ~sparc ~x86 ~x86-linux ~ppc-macos ~x86-macos" +IUSE="+lzo +zlib" + +DEPEND=">=dev-libs/openssl-0.9.7c + lzo? ( dev-libs/lzo:2 ) + zlib? ( >=sys-libs/zlib-1.1.4-r2 )" +RDEPEND="${DEPEND}" + +src_configure() { + econf --enable-jumbograms $(use_enable lzo) $(use_enable zlib) +} + +src_install() { + emake DESTDIR="${D}" install + dodir /etc/tinc + dodoc AUTHORS NEWS README THANKS + newinitd "${FILESDIR}"/tincd.1 tincd + newinitd "${FILESDIR}"/tincd.lo.1 tincd.lo + doconfd "${FILESDIR}"/tinc.networks + newconfd "${FILESDIR}"/tincd.conf.1 tincd +} + +pkg_postinst() { + elog "This package requires the tun/tap kernel device." + elog "Look at http://www.tinc-vpn.org/ for how to configure tinc" +} diff --git a/net-misc/tinc/tinc-1.0.16.ebuild b/net-misc/tinc/tinc-1.0.16.ebuild index 9a6b4824610e..8009fd0da3c6 100644 --- a/net-misc/tinc/tinc-1.0.16.ebuild +++ b/net-misc/tinc/tinc-1.0.16.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/tinc-1.0.16.ebuild,v 1.1 2011/09/23 18:51:26 blueness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/tinc-1.0.16.ebuild,v 1.2 2011/09/26 03:23:06 blueness Exp $ EAPI=4 @@ -16,6 +16,7 @@ IUSE="+lzo +zlib" DEPEND=">=dev-libs/openssl-0.9.7c lzo? ( dev-libs/lzo:2 ) zlib? ( >=sys-libs/zlib-1.1.4-r2 )" +RDEPEND="${DEPEND}" src_configure() { econf --enable-jumbograms $(use_enable lzo) $(use_enable zlib) || die |