Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
aports
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
J0WI
aports
Commits
bd84b033
Commit
bd84b033
authored
8 years ago
by
Jakub Jirutka
Browse files
Options
Downloads
Patches
Plain Diff
community/tor: improve abuild and runscript
parent
b6e190d0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
community/tor/APKBUILD
+16
-12
16 additions, 12 deletions
community/tor/APKBUILD
community/tor/tor.initd
+49
-44
49 additions, 44 deletions
community/tor/tor.initd
community/tor/tor.pre-install
+1
-1
1 addition, 1 deletion
community/tor/tor.pre-install
with
66 additions
and
57 deletions
community/tor/APKBUILD
+
16
−
12
View file @
bd84b033
...
@@ -2,22 +2,19 @@
...
@@ -2,22 +2,19 @@
# Maintainer: Sam Dodrill <shadow.h511@gmail.com>
# Maintainer: Sam Dodrill <shadow.h511@gmail.com>
pkgname
=
tor
pkgname
=
tor
pkgver
=
0.2.7.6
pkgver
=
0.2.7.6
pkgrel
=
3
pkgrel
=
4
pkgdesc
=
"Anonymous network connectivity"
pkgdesc
=
"Anonymous network connectivity"
url
=
"https://www.torproject.org"
url
=
"https://www.torproject.org"
arch
=
"all"
arch
=
"all"
license
=
"BSD"
license
=
"BSD"
pkgusers
=
"tor"
pkgusers
=
"tor"
depends
=
""
depends
=
""
depends_dev
=
""
makedepends
=
"linux-headers bash libevent-dev openssl-dev ca-certificates"
makedepends
=
"linux-headers bash libevent-dev openssl-dev ca-certificates"
install
=
"
$pkgname
.pre-install"
install
=
"
$pkgname
.pre-install"
subpackages
=
"
$pkgname
-doc"
subpackages
=
"
$pkgname
-doc"
source
=
"https://www.torproject.org/dist/
$pkgname
-
$pkgver
.tar.gz
source
=
"https://www.torproject.org/dist/
$pkgname
-
$pkgver
.tar.gz
tor.initd
tor.initd
tor.confd
tor.confd"
"
builddir
=
"
$srcdir
/
$pkgname
-
$pkgver
"
builddir
=
"
$srcdir
/
$pkgname
-
$pkgver
"
build
()
{
build
()
{
...
@@ -30,17 +27,24 @@ build() {
...
@@ -30,17 +27,24 @@ build() {
--mandir
=
/usr/share/man
\
--mandir
=
/usr/share/man
\
--infodir
=
/usr/share/info
\
--infodir
=
/usr/share/info
\
--localstatedir
=
/var
\
--localstatedir
=
/var
\
--enable-transparent
\
--enable-transparent
\
||
return
1
||
return
1
make
||
return
1
make
||
return
1
}
}
package
()
{
package
()
{
cd
"
$builddir
"
cd
"
$builddir
"
make
DESTDIR
=
"
$pkgdir
"
install
||
return
1
make
DESTDIR
=
"
$pkgdir
"
install
||
return
1
mkdir
-p
"
$pkgdir
"
/var/lib/
$pkgname
mkdir
-p
"
$pkgdir
"
/var/log/
$pkgname
# Uncomment logging to file.
chown
$pkgusers
"
$pkgdir
"
/var/lib/
$pkgname
sed
-Ei
's/^#*(Log notice file.*)/\1/'
\
"
$pkgdir
"
/etc/tor/torrc.sample
||
return
1
install
-dm755
-o
$pkgusers
\
"
$pkgdir
"
/var/lib/
$pkgname
\
"
$pkgdir
"
/var/log/
$pkgname
||
return
1
install
-m755
-D
"
$srcdir
"
/
$pkgname
.initd
\
install
-m755
-D
"
$srcdir
"
/
$pkgname
.initd
\
"
$pkgdir
"
/etc/init.d/
$pkgname
||
return
1
"
$pkgdir
"
/etc/init.d/
$pkgname
||
return
1
install
-m644
-D
"
$srcdir
"
/
$pkgname
.confd
\
install
-m644
-D
"
$srcdir
"
/
$pkgname
.confd
\
...
@@ -48,11 +52,11 @@ package() {
...
@@ -48,11 +52,11 @@ package() {
}
}
md5sums
=
"cc19107b57136a68e8c563bf2d35b072 tor-0.2.7.6.tar.gz
md5sums
=
"cc19107b57136a68e8c563bf2d35b072 tor-0.2.7.6.tar.gz
c10b84a88dfaff4c17e40d04edd2caf3
tor.initd
5fcebf3f26f4ec4ddfed262a020263d4
tor.initd
e05a796ffc4981c22c167de11fa36ef9 tor.confd"
e05a796ffc4981c22c167de11fa36ef9 tor.confd"
sha256sums
=
"493a8679f904503048114aca6467faef56861206bab8283d858f37141d95105d tor-0.2.7.6.tar.gz
sha256sums
=
"493a8679f904503048114aca6467faef56861206bab8283d858f37141d95105d tor-0.2.7.6.tar.gz
6b1fbc73e108e42a57a0faba409cb5fc6b40d79897261753cc4bc076faf23c35
tor.initd
f8cabd757daa05d6a72992911ff24204854275d190887e02a35e7d098cae40cf
tor.initd
41d780f291847e19f632428bbf27c3f289414afd237546d2974da1b75384c25c tor.confd"
41d780f291847e19f632428bbf27c3f289414afd237546d2974da1b75384c25c tor.confd"
sha512sums
=
"9b0dbfabe6cd05189b179da24bfaa73b89ab237775e3b5b0ebc0a22ee98909e9b13e55841a466f04000e0ff876c15f76515ff46abca28d05eeddbdc52f183afc tor-0.2.7.6.tar.gz
sha512sums
=
"9b0dbfabe6cd05189b179da24bfaa73b89ab237775e3b5b0ebc0a22ee98909e9b13e55841a466f04000e0ff876c15f76515ff46abca28d05eeddbdc52f183afc tor-0.2.7.6.tar.gz
baec0ffcbab334582aedeb2869a92862c45a379b3a71fe99b296732713ef3026adab181fccb7304bc0830f8ab72ac811b6fcbe91d739e8b78e41f515e920a0ea
tor.initd
7763735be48d4cee9d78c0f1c8cd37e504efa262267997c214349fc6de46e7ae9a00b1320977946f562ab2b35fa0bdf37932860b266714e936c75f08aa187fa2
tor.initd
9028ac41e3acdf4405095addb69537e87edecafaec840296ac27a5a8992fe132dc822e4e4abb8826f76460c438da2719dea17859690d03e17198a82086a3d660 tor.confd"
9028ac41e3acdf4405095addb69537e87edecafaec840296ac27a5a8992fe132dc822e4e4abb8826f76460c438da2719dea17859690d03e17198a82086a3d660 tor.confd"
This diff is collapsed.
Click to expand it.
community/tor/tor.initd
+
49
−
44
View file @
bd84b033
#!/sbin/openrc-run
#!/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 $
conffile
=
"/etc/tor/torrc"
pidfile
=
"/run/tor/tor.pid"
graceful_timeout
=
${
GRACEFUL_TIMEOUT
:-
60
}
command
=
"/usr/bin/tor"
command_args
=
"-f
$conffile
"
command_background
=
"yes"
start_stop_daemon_args
=
"
--chdir /var/lib/tor
--env HOME=/var/lib/tor"
# See bug #523552, and https://trac.torproject.org/projects/tor/ticket/5525
# Graceful = wait 30 secs or so until all connections are properly closed.
extra_commands
=
"checkconfig"
extra_commands
=
"checkconfig"
extra_started_commands
=
"reload"
extra_started_commands
=
"graceful gracefulstop reload"
description
=
"Anonymizing overlay network for TCP"
description_checkconfig
=
"Check if config file is valid."
description_reload
=
"Reload the configuration."
description_gracefulstop
=
"Gracefully stop."
PIDFILE
=
/var/run/tor/tor.pid
CONFFILE
=
/etc/tor/torrc
depend
()
{
depend
()
{
need net
need net
}
}
checkconfig
()
{
checkconfig
()
{
# first check that it exists
# First check that it exists.
if
[
!
-f
${
CONFFILE
}
]
;
then
if
[
!
-f
"
$conffile
"
]
;
then
eerror
"You need to setup
${
CONFFILE
}
first"
eerror
"You need to setup
$conffile
first, see
$conffile
.sample for example"
eerror
"Example is in
${
CONFFILE
}
.sample"
return
1
return
1
fi
fi
# Now verify whether the configuration is valid.
# now verify whether the configuration is valid
if
!
$command
--verify-config
-f
"
$conffile
"
2>&1 1>/dev/null
;
then
/usr/bin/tor
--verify-config
-f
${
CONFFILE
}
>
/dev/null 2>&1
eerror
"Tor configuration (
${
conffile
}
) not valid"
if
[
$?
-eq
0
]
;
then
$command
--verify-config
-f
"
$conffile
"
einfo
"Tor configuration (
${
CONFFILE
}
) is valid."
return
1
return
0
fi
else
eerror
"Tor configuration (
${
CONFFILE
}
) not valid."
/usr/bin/tor
--verify-config
-f
${
CONFFILE
}
return
1
fi
}
}
start
()
{
start_pre
()
{
checkconfig
||
return
1
checkconfig
||
return
1
checkpath
-d
-m
0755
-o
tor /var/run/tor
checkpath
-d
-m
0755
-o
tor
"
$(
dirname
"
$pidfile
"
)
"
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
()
{
gracefulstop
()
{
ebegin
"Stopping Tor"
ebegin
"Gracefully stopping Tor, this can take up to
$graceful_timeout
seconds"
start-stop-daemon
--stop
--pidfile
"
${
PIDFILE
}
"
--exec
/usr/bin/tor
--
--PidFile
"
${
PIDFILE
}
"
start-stop-daemon
--stop
\
eend
$?
--progress
\
--signal
INT
\
--retry
$graceful_timeout
\
--pidfile
"
$pidfile
"
\
--exec
$command
--
$command_args
eend
$?
}
}
reload
()
{
reload
()
{
if
[
!
-f
${
PIDFILE
}
]
;
then
start_pre
||
return
1
eerror
"
${
SVCNAME
}
isn't running"
return
1
fi
checkconfig
||
return
1
ebegin
"Reloading Tor configuration"
start-stop-daemon
--signal
HUP
--pidfile
${
PIDFILE
}
eend
$?
}
ebegin
"Reloading Tor configuration"
start-stop-daemon
--signal
HUP
--pidfile
"
$pidfile
"
eend
$?
}
This diff is collapsed.
Click to expand it.
community/tor/tor.pre-install
+
1
−
1
View file @
bd84b033
#!/bin/sh
#!/bin/sh
adduser
-S
-D
-h
/var/
run
/tor
-s
/sbin/nologin
-g
tor tor 2>/dev/null
adduser
-S
-D
-H
-h
/var/
lib
/tor
-s
/sbin/nologin
-g
tor tor 2>/dev/null
exit
0
exit
0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment