diff options
author | l-n-s <supervillain@riseup.net> | 2018-02-02 17:43:58 -0500 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2018-02-02 23:06:49 +0000 |
commit | 0c5f4016795785db6207f120bbd8aa6f45b2a6eb (patch) | |
tree | c3e6dc536ec10b28676d79578c01eb4807bfc8cd /testing | |
parent | ae3f39219ee78b9984f6966c42b38aa2ac00719d (diff) | |
download | aports-0c5f4016795785db6207f120bbd8aa6f45b2a6eb.tar.bz2 aports-0c5f4016795785db6207f120bbd8aa6f45b2a6eb.tar.xz |
testing/i2pd: new aport
https://github.com/PurpleI2P/i2pd
i2pd (I2P Daemon) is a full-featured C++ implementation of I2P client.
Diffstat (limited to 'testing')
-rw-r--r-- | testing/i2pd/APKBUILD | 51 | ||||
-rw-r--r-- | testing/i2pd/i2pd.confd | 13 | ||||
-rw-r--r-- | testing/i2pd/i2pd.initd | 51 | ||||
-rw-r--r-- | testing/i2pd/i2pd.pre-install | 7 |
4 files changed, 122 insertions, 0 deletions
diff --git a/testing/i2pd/APKBUILD b/testing/i2pd/APKBUILD new file mode 100644 index 0000000000..d590db9848 --- /dev/null +++ b/testing/i2pd/APKBUILD @@ -0,0 +1,51 @@ +# Contributor: l-n-s <supervillain@riseup.net> +# Maintainer: l-n-s <supervillain@riseup.net> +pkgname=i2pd +pkgver=2.18.0 +pkgrel=0 +pkgdesc="I2P Router written in C++" +url="https://github.com/PurpleI2P/i2pd" +arch="all" +license="BSD" +pkgusers="i2pd" +depends="boost-filesystem boost-system boost-program_options boost-date_time boost-thread boost-iostreams openssl musl-utils libstdc++" +makedepends="boost-dev openssl-dev openssl" +options="!check" +install="$pkgname.pre-install" +source="https://github.com/PurpleI2P/i2pd/archive/$pkgver/$pkgname-$pkgver.tar.gz + i2pd.initd + i2pd.confd + " +builddir="$srcdir/$pkgname-$pkgver" + +build() { + cd "$builddir" + + make +} + +package() { + cd "$builddir" + + install -D -m 755 i2pd "$pkgdir"/usr/sbin/i2pd + + install -dm755 -o $pkgusers \ + "$pkgdir"/etc/$pkgname \ + "$pkgdir"/usr/share/$pkgname \ + "$pkgdir"/var/lib/$pkgname \ + "$pkgdir"/var/log/$pkgname + + install -D -m 755 contrib/tunnels.conf "$pkgdir"/etc/i2pd/tunnels.conf + install -D -m 755 contrib/i2pd.conf "$pkgdir"/etc/i2pd/i2pd.conf + cp -r contrib/certificates/ "$pkgdir"/usr/share/$pkgname/certificates + ln -s /usr/share/$pkgname/certificates "$pkgdir"/var/lib/$pkgname/certificates + + install -m755 -D "$srcdir"/$pkgname.initd \ + "$pkgdir"/etc/init.d/$pkgname + install -m644 -D "$srcdir"/$pkgname.confd \ + "$pkgdir"/etc/conf.d/$pkgname +} + +sha512sums="dc8e0f4df25188e4d72ea6ffa2c36e48a7d2103d025730b40e226ab631724a9a07a4dc03a1a3d08328972c98020c44535661820add80374f1dabdf3fc848ef84 i2pd-2.18.0.tar.gz +7911b5e06492ea25c90780a25e5d02f957c655153f41dd89c1f1885fb52ccdaf7c2e643ca3cd2f7d769a1d8c6d1790fcd4f8737abd21eed808940e1997ae6cb4 i2pd.initd +ba94e5505f4eeb9a32159aa0a3b7f68ff077abb9704800f70502ac75fd5bcfcb20450ebd983d0523beca2d13e718d7bf888f53ec455d1f41701c16d09c3b2d28 i2pd.confd" diff --git a/testing/i2pd/i2pd.confd b/testing/i2pd/i2pd.confd new file mode 100644 index 0000000000..9b609c3508 --- /dev/null +++ b/testing/i2pd/i2pd.confd @@ -0,0 +1,13 @@ +I2PD_USER=i2pd +I2PD_GROUP=i2pd +I2PD_LOG=/var/log/i2pd/i2pd.log +I2PD_PID=/run/i2pd/i2pd.pid + +# max number of open files (for floodfill) +rc_ulimit="-n 4096" + +# Options to i2pd +I2PD_OPTIONS="--daemon --service --pidfile=${I2PD_PID} \ +--log=file --logfile=${I2PD_LOG} \ +--conf=/etc/i2pd/i2pd.conf --tunconf=/etc/i2pd/tunnels.conf" + diff --git a/testing/i2pd/i2pd.initd b/testing/i2pd/i2pd.initd new file mode 100644 index 0000000000..16459ecd85 --- /dev/null +++ b/testing/i2pd/i2pd.initd @@ -0,0 +1,51 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Copyright 2018 l-n-s <supervillain@riseup.net> +# Distributed under the terms of the GNU General Public License v2 + +description="C++ daemon for accessing the I2P network" +description_graceful="Graceful shutdown, takes 10 minutes" + +command="/usr/sbin/i2pd" +command_args="${I2PD_OPTIONS}" +user="${I2PD_USER}:${I2PD_GROUP}" +start_stop_daemon_args=" + --user \"${user}\" + --pidfile \"${I2PD_PID}\" + --progress +" +retry="SIGTERM/20/SIGKILL/20" + +I2PD_PID_DIR=$(dirname "${I2PD_PID}") + +extra_started_commands="graceful" + +depend() { + need net + after firewall + use dns logger netmount +} + +start_pre() { + if [ -z "${I2PD_USER}" ] || \ + [ -z "${I2PD_GROUP}" ] || \ + [ -z "${I2PD_PID}" ] || \ + [ -z "${I2PD_LOG}" ] || \ + [ -z "${I2PD_OPTIONS}" ] ; then + eerror "Not all variables I2PD_USER, I2PD_GROUP, I2PD_PID, I2PD_OPTIONS, I2PD_LOG are defined." + eerror "Check your /etc/conf.d/i2pd." + return 1 + fi + checkpath -f -o "${user}" "${I2PD_LOG}" + checkpath -d -m 0750 -o "${user}" "${I2PD_PID_DIR}" +} + +graceful() { + # on SIGINT, i2pd stops accepting tunnels and shuts down in 600 seconds + ebegin "Gracefully stopping i2pd, this takes 10 minutes" + mark_service_stopping + eval start-stop-daemon --stop ${start_stop_daemon_args} \ + --exec "${command}" --retry 'SIGINT/620/SIGTERM/20/SIGKILL/20' + eend $? && mark_service_stopped +} + diff --git a/testing/i2pd/i2pd.pre-install b/testing/i2pd/i2pd.pre-install new file mode 100644 index 0000000000..1244368da7 --- /dev/null +++ b/testing/i2pd/i2pd.pre-install @@ -0,0 +1,7 @@ +#!/bin/sh + +addgroup -S i2pd 2>/dev/null +adduser -S -D -H -h /var/lib/i2pd -s /sbin/nologin -G i2pd -g i2pd i2pd 2>/dev/null + +exit 0 + |