diff options
author | Zac Medico <zmedico@gentoo.org> | 2016-04-11 03:41:43 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2016-04-11 03:41:43 -0700 |
commit | 5634d7bf2f68d21408eb0007035291c509cd89f2 (patch) | |
tree | 9a2eae11b057284ebd2b124dace94908f1fa2d59 /net-misc/peervpn | |
parent | www-plugins/adobe-flash: x86 stable wrt bug #579166 (diff) | |
download | gentoo-5634d7bf2f68d21408eb0007035291c509cd89f2.tar.gz gentoo-5634d7bf2f68d21408eb0007035291c509cd89f2.tar.bz2 gentoo-5634d7bf2f68d21408eb0007035291c509cd89f2.zip |
net-misc/peervpn: new package
Package-Manager: portage-2.2.28
Diffstat (limited to 'net-misc/peervpn')
-rw-r--r-- | net-misc/peervpn/Manifest | 1 | ||||
-rw-r--r-- | net-misc/peervpn/files/peervpn.initd | 31 | ||||
-rw-r--r-- | net-misc/peervpn/files/peervpn.logrotated | 7 | ||||
-rw-r--r-- | net-misc/peervpn/files/peervpn.service | 12 | ||||
-rw-r--r-- | net-misc/peervpn/metadata.xml | 10 | ||||
-rw-r--r-- | net-misc/peervpn/peervpn-0.044.ebuild | 52 |
6 files changed, 113 insertions, 0 deletions
diff --git a/net-misc/peervpn/Manifest b/net-misc/peervpn/Manifest new file mode 100644 index 000000000000..0f3a680efa4f --- /dev/null +++ b/net-misc/peervpn/Manifest @@ -0,0 +1 @@ +DIST peervpn-0.044.tar.gz 81948 SHA256 9d2afc4b5b2b456dee386c80c5d37c32cd7c91d72c3a784d6d99f3d0f28d21d8 SHA512 5dd8e056287a905f3aaddf93d6dad917047e6f7da30942f412ff7b2846afd26fb9f4e500cfcb76966b4045db2a37096f1aa43b87e777ff31c2e467aa0415cdba WHIRLPOOL 7935a7826ec632d0b378099fccce6bf5cb08bc5a8d3ce5d3e102075bc81eed963386f823f42a67b175d7df393a7dd5c0136807f6a5b580371d96fdbee0723bd7 diff --git a/net-misc/peervpn/files/peervpn.initd b/net-misc/peervpn/files/peervpn.initd new file mode 100644 index 000000000000..3174dc67f683 --- /dev/null +++ b/net-misc/peervpn/files/peervpn.initd @@ -0,0 +1,31 @@ +#!/sbin/openrc-run +# Copyright 2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +description="peervpn server" +pidfile=${pidfile:-"/run/${SVCNAME}/${SVCNAME}.pid"} +logfile=${logfile:-"/var/log/${SVCNAME}/${SVCNAME}.log"} +user=${SVCNAME} +group=${SVCNAME} + +command="/usr/sbin/${SVCNAME}" +command_args="${command_args:-/etc/peervpn/peervpn.conf}" +command_background="true" +# peervpn will drop privileges based on user and group config file settings +start_stop_daemon_args=" + --stdout ${logfile} + --stderr ${logfile}" + +depend() { + need net + after net +} + +start_pre() { + checkpath -d -m 0755 -o "${user}":"${group}" "${pidfile%/*}" +} + +start_post() { + chown "${user}":"${group}" "${logfile}" +} diff --git a/net-misc/peervpn/files/peervpn.logrotated b/net-misc/peervpn/files/peervpn.logrotated new file mode 100644 index 000000000000..d66c2fa6802b --- /dev/null +++ b/net-misc/peervpn/files/peervpn.logrotated @@ -0,0 +1,7 @@ +/var/log/peervpn/peervpn.log { + su peervpn peervpn + missingok + size 5M + rotate 3 + compress +} diff --git a/net-misc/peervpn/files/peervpn.service b/net-misc/peervpn/files/peervpn.service new file mode 100644 index 000000000000..13c5310f517b --- /dev/null +++ b/net-misc/peervpn/files/peervpn.service @@ -0,0 +1,12 @@ +[Unit] +Description=peervpn server +Requires=network-online.target +After=network-online.target + +[Service] +Environment=PEERVPN_OPTS="/etc/peervpn/peervpn.conf" +ExecStart=/usr/sbin/peervpn $PEERVPN_OPTS +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/net-misc/peervpn/metadata.xml b/net-misc/peervpn/metadata.xml new file mode 100644 index 000000000000..d4216eaa7140 --- /dev/null +++ b/net-misc/peervpn/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>zmedico@gentoo.org</email> + </maintainer> + <upstream> + <remote-id type="github">peervpn/peervpn</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-misc/peervpn/peervpn-0.044.ebuild b/net-misc/peervpn/peervpn-0.044.ebuild new file mode 100644 index 000000000000..52e1451c5f78 --- /dev/null +++ b/net-misc/peervpn/peervpn-0.044.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +inherit systemd toolchain-funcs user + +DESCRIPTION="P2P mesh VPN" +HOMEPAGE="https://github.com/peervpn/peervpn" +EGIT_COMMIT="eb35174277fbf745c5ee0d5875d659dad819adfc" +SRC_URI="https://github.com/peervpn/peervpn/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" +RDEPEND="dev-libs/openssl:0=" +DEPEND="${RDEPEND}" + +S=${WORKDIR}/${PN}-${EGIT_COMMIT} + +pkg_setup() { + enewgroup ${PN} + enewuser ${PN} -1 -1 -1 ${PN} +} + +src_prepare() { + default + sed -e 's|^CFLAGS+=-O2||' -i Makefile || die +} + +src_compile() { + emake CC=$(tc-getCC) || die +} + +src_install() { + dosbin ${PN} + + insinto /etc/${PN} + newins peervpn.conf peervpn.conf.example + fowners ${PN}:${PN} /etc/${PN} + fperms 0700 /etc/${PN} + + newinitd "${FILESDIR}/${PN}.initd" "${PN}" + systemd_dounit "${FILESDIR}/${PN}.service" + + keepdir /var/log/${PN} + fowners ${PN}:${PN} /var/log/${PN} + insinto /etc/logrotate.d + newins "${FILESDIR}/${PN}.logrotated" "${PN}" +} |