Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-vpn/tor/, net-vpn/tor/files/
Date: Sun, 25 Feb 2018 00:58:44
Message-Id: 1519520249.c0fe6a0d4e379ce403f88e54f23d77695fe2cf05.blueness@gentoo
1 commit: c0fe6a0d4e379ce403f88e54f23d77695fe2cf05
2 Author: William Breathitt Gray <vilhelm.gray <AT> gmail <DOT> com>
3 AuthorDate: Sun Feb 25 00:26:52 2018 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 25 00:57:29 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0fe6a0d
7
8 net-vpn/tor: Fix tor.service failure when /var/run is tmpfs
9
10 Closes: https://bugs.gentoo.org/640040
11
12 .../files/tor-0.3.3.2-alpha-tor.service.in.patch | 12 +++
13 net-vpn/tor/tor-0.3.3.2_alpha-r1.ebuild | 85 ++++++++++++++++++++++
14 2 files changed, 97 insertions(+)
15
16 diff --git a/net-vpn/tor/files/tor-0.3.3.2-alpha-tor.service.in.patch b/net-vpn/tor/files/tor-0.3.3.2-alpha-tor.service.in.patch
17 new file mode 100644
18 index 00000000000..76e88bbaba9
19 --- /dev/null
20 +++ b/net-vpn/tor/files/tor-0.3.3.2-alpha-tor.service.in.patch
21 @@ -0,0 +1,12 @@
22 +--- a/contrib/dist/tor.service.in 2017-11-11 13:40:46.000000000 -0500
23 ++++ b/contrib/dist/tor.service.in 2018-02-24 19:06:12.307506884 -0500
24 +@@ -21,6 +21,9 @@
25 + LimitNOFILE=32768
26 +
27 + # Hardening
28 ++Group=tor
29 ++RuntimeDirectory=tor
30 ++RuntimeDirectoryMode=0770
31 + PrivateTmp=yes
32 + PrivateDevices=yes
33 + ProtectHome=yes
34
35 diff --git a/net-vpn/tor/tor-0.3.3.2_alpha-r1.ebuild b/net-vpn/tor/tor-0.3.3.2_alpha-r1.ebuild
36 new file mode 100644
37 index 00000000000..65525074136
38 --- /dev/null
39 +++ b/net-vpn/tor/tor-0.3.3.2_alpha-r1.ebuild
40 @@ -0,0 +1,85 @@
41 +# Copyright 1999-2018 Gentoo Foundation
42 +# Distributed under the terms of the GNU General Public License v2
43 +
44 +EAPI="6"
45 +
46 +inherit flag-o-matic readme.gentoo-r1 systemd versionator user
47 +
48 +MY_PV="$(replace_version_separator 4 -)"
49 +MY_PF="${PN}-${MY_PV}"
50 +DESCRIPTION="Anonymizing overlay network for TCP"
51 +HOMEPAGE="http://www.torproject.org/"
52 +SRC_URI="https://www.torproject.org/dist/${MY_PF}.tar.gz
53 + https://archive.torproject.org/tor-package-archive/${MY_PF}.tar.gz"
54 +S="${WORKDIR}/${MY_PF}"
55 +
56 +LICENSE="BSD GPL-2"
57 +SLOT="0"
58 +# We need to keyword app-arch/zstd
59 +#KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~sparc ~x86 ~ppc-macos"
60 +KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~x86 ~ppc-macos"
61 +IUSE="libressl lzma scrypt seccomp selinux systemd tor-hardening test web zstd"
62 +
63 +DEPEND="
64 + app-text/asciidoc
65 + dev-libs/libevent[ssl]
66 + sys-libs/zlib
67 + !libressl? ( dev-libs/openssl:0=[-bindist] )
68 + libressl? ( dev-libs/libressl:0= )
69 + lzma? ( app-arch/xz-utils )
70 + scrypt? ( app-crypt/libscrypt )
71 + seccomp? ( sys-libs/libseccomp )
72 + systemd? ( sys-apps/systemd )
73 + zstd? ( app-arch/zstd )"
74 +RDEPEND="${DEPEND}
75 + selinux? ( sec-policy/selinux-tor )"
76 +
77 +PATCHES=(
78 + "${FILESDIR}"/${PN}-0.2.7.4-torrc.sample.patch
79 + "${FILESDIR}"/${PN}-0.3.3.2-alpha-tor.service.in.patch
80 +)
81 +
82 +DOCS=( README ChangeLog ReleaseNotes doc/HACKING )
83 +
84 +pkg_setup() {
85 + enewgroup tor
86 + enewuser tor -1 -1 /var/lib/tor tor
87 +}
88 +
89 +src_configure() {
90 + econf \
91 + --localstatedir="${EPREFIX}/var" \
92 + --enable-system-torrc \
93 + --enable-asciidoc \
94 + --disable-android \
95 + --disable-libfuzzer \
96 + --disable-rust \
97 + --disable-restart-debugging \
98 + $(use_enable lzma) \
99 + $(use_enable scrypt libscrypt) \
100 + $(use_enable seccomp) \
101 + $(use_enable systemd) \
102 + $(use_enable tor-hardening gcc-hardening) \
103 + $(use_enable tor-hardening linker-hardening) \
104 + $(use_enable web tor2web-mode) \
105 + $(use_enable test unittests) \
106 + $(use_enable test coverage) \
107 + $(use_enable zstd)
108 +}
109 +
110 +src_install() {
111 + default
112 + readme.gentoo_create_doc
113 +
114 + newconfd "${FILESDIR}"/tor.confd tor
115 + newinitd "${FILESDIR}"/tor.initd-r8 tor
116 + systemd_dounit contrib/dist/tor.service
117 +
118 + keepdir /var/lib/tor
119 +
120 + fperms 750 /var/lib/tor
121 + fowners tor:tor /var/lib/tor
122 +
123 + insinto /etc/tor/
124 + newins "${FILESDIR}"/torrc-r1 torrc
125 +}