aboutsummaryrefslogtreecommitdiffstats
path: root/community/tor
diff options
context:
space:
mode:
authorScrumpyJack <scrumpyjack@st.ilet.to>2016-06-27 10:17:05 +0000
committerCarlo Landmeter <clandmeter@gmail.com>2016-07-04 11:42:28 +0200
commit2ff62bbb9f7b2c82a826d7b159c1bc482aa8f0bd (patch)
tree97c60fb3221dfe78cd7ccfda5db6125c81d5f676 /community/tor
parent00e8ff605f1c4f6386596f35f2a5287ff9b8bc55 (diff)
downloadaports-2ff62bbb9f7b2c82a826d7b159c1bc482aa8f0bd.tar.bz2
aports-2ff62bbb9f7b2c82a826d7b159c1bc482aa8f0bd.tar.xz
testing/[various]: move packages to community
Moves the packages listed below from the testing to the community repository after successfully testing of said packages. asciinema at calcurse cmus compton cpio dvd+rw-tools fortune fvwm geary h2o heirloom-mailx leafpad nedit nmh rover tor torsocks urlview vdesk w3m wbar xcalc xclock xeyes xkill
Diffstat (limited to 'community/tor')
-rw-r--r--community/tor/APKBUILD58
-rw-r--r--community/tor/tor.confd3
-rw-r--r--community/tor/tor.initd61
-rw-r--r--community/tor/tor.pre-install5
4 files changed, 127 insertions, 0 deletions
diff --git a/community/tor/APKBUILD b/community/tor/APKBUILD
new file mode 100644
index 0000000000..116bffdc41
--- /dev/null
+++ b/community/tor/APKBUILD
@@ -0,0 +1,58 @@
+# Contributor: Sam Dodrill <shadow.h511@gmail.com>
+# Maintainer: Sam Dodrill <shadow.h511@gmail.com>
+pkgname=tor
+pkgver=0.2.7.6
+pkgrel=3
+pkgdesc="Anonymous network connectivity"
+url="https://www.torproject.org"
+arch="all"
+license="BSD"
+pkgusers="tor"
+depends=""
+depends_dev=""
+makedepends="linux-headers bash libevent-dev openssl-dev ca-certificates"
+install="$pkgname.pre-install"
+subpackages="$pkgname-doc"
+source="https://www.torproject.org/dist/$pkgname-$pkgver.tar.gz
+ tor.initd
+ tor.confd
+ "
+
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var \
+ --enable-transparent \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install || return 1
+ mkdir -p "$pkgdir"/var/lib/$pkgname
+ mkdir -p "$pkgdir"/var/log/$pkgname
+ chown $pkgusers "$pkgdir"/var/lib/$pkgname
+ install -m755 -D "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/$pkgname || return 1
+ install -m644 -D "$srcdir"/$pkgname.confd \
+ "$pkgdir"/etc/conf.d/$pkgname || return 1
+}
+
+md5sums="cc19107b57136a68e8c563bf2d35b072 tor-0.2.7.6.tar.gz
+c10b84a88dfaff4c17e40d04edd2caf3 tor.initd
+e05a796ffc4981c22c167de11fa36ef9 tor.confd"
+sha256sums="493a8679f904503048114aca6467faef56861206bab8283d858f37141d95105d tor-0.2.7.6.tar.gz
+6b1fbc73e108e42a57a0faba409cb5fc6b40d79897261753cc4bc076faf23c35 tor.initd
+41d780f291847e19f632428bbf27c3f289414afd237546d2974da1b75384c25c tor.confd"
+sha512sums="9b0dbfabe6cd05189b179da24bfaa73b89ab237775e3b5b0ebc0a22ee98909e9b13e55841a466f04000e0ff876c15f76515ff46abca28d05eeddbdc52f183afc tor-0.2.7.6.tar.gz
+baec0ffcbab334582aedeb2869a92862c45a379b3a71fe99b296732713ef3026adab181fccb7304bc0830f8ab72ac811b6fcbe91d739e8b78e41f515e920a0ea tor.initd
+9028ac41e3acdf4405095addb69537e87edecafaec840296ac27a5a8992fe132dc822e4e4abb8826f76460c438da2719dea17859690d03e17198a82086a3d660 tor.confd"
diff --git a/community/tor/tor.confd b/community/tor/tor.confd
new file mode 100644
index 0000000000..4195bf3237
--- /dev/null
+++ b/community/tor/tor.confd
@@ -0,0 +1,3 @@
+#
+# Set the file limit
+rc_ulimit="-n 30000"
diff --git a/community/tor/tor.initd b/community/tor/tor.initd
new file mode 100644
index 0000000000..95d02db5d7
--- /dev/null
+++ b/community/tor/tor.initd
@@ -0,0 +1,61 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/tor/files/Attic/tor.initd-r6,v 1.7 2015/03/20 12:46:13 blueness dead $
+
+extra_commands="checkconfig"
+extra_started_commands="reload"
+
+PIDFILE=/var/run/tor/tor.pid
+CONFFILE=/etc/tor/torrc
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ # first check that it exists
+ if [ ! -f ${CONFFILE} ] ; then
+ eerror "You need to setup ${CONFFILE} first"
+ eerror "Example is in ${CONFFILE}.sample"
+ return 1
+ fi
+
+ # now verify whether the configuration is valid
+ /usr/bin/tor --verify-config -f ${CONFFILE} > /dev/null 2>&1
+ if [ $? -eq 0 ] ; then
+ einfo "Tor configuration (${CONFFILE}) is valid."
+ return 0
+ else
+ eerror "Tor configuration (${CONFFILE}) not valid."
+ /usr/bin/tor --verify-config -f ${CONFFILE}
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ checkpath -d -m 0755 -o tor /var/run/tor
+ ebegin "Starting Tor"
+ HOME=/var/lib/tor
+ start-stop-daemon --start --pidfile "${PIDFILE}" --quiet --exec /usr/bin/tor -- -f "${CONFFILE}" --runasdaemon 1 --PidFile "${PIDFILE}" > /dev/null 2>&1
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Tor"
+ start-stop-daemon --stop --pidfile "${PIDFILE}" --exec /usr/bin/tor -- --PidFile "${PIDFILE}"
+ eend $?
+}
+
+reload() {
+ if [ ! -f ${PIDFILE} ]; then
+ eerror "${SVCNAME} isn't running"
+ return 1
+ fi
+ checkconfig || return 1
+ ebegin "Reloading Tor configuration"
+ start-stop-daemon --signal HUP --pidfile ${PIDFILE}
+ eend $?
+}
+
diff --git a/community/tor/tor.pre-install b/community/tor/tor.pre-install
new file mode 100644
index 0000000000..9827f01bc1
--- /dev/null
+++ b/community/tor/tor.pre-install
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+adduser -S -D -h /var/run/tor -s /sbin/nologin -g tor tor 2>/dev/null
+
+exit 0