tor: update to 0.4.8.10 stable
[feed/packages.git] / net / tor / Makefile
1 #
2 # Copyright (C) 2008-2019 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=tor
11 PKG_VERSION:=0.4.8.10
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://dist.torproject.org/ \
16 https://archive.torproject.org/tor-package-archive
17 PKG_HASH:=e628b4fab70edb4727715b23cf2931375a9f7685ac08f2c59ea498a178463a86
18 PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de> \
19 Peter Wagner <tripolar@gmx.at>
20 PKG_LICENSE:=BSD-3-Clause
21 PKG_LICENSE_FILES:=LICENSE
22 PKG_CPE_ID:=cpe:/a:torproject:tor
23
24 PKG_INSTALL:=1
25 PKG_FIXUP:=autoreconf
26 PKG_BUILD_PARALLEL:=1
27 PKG_BUILD_FLAGS:=gc-sections lto
28
29 include $(INCLUDE_DIR)/package.mk
30
31 define Package/tor/Default
32 SECTION:=net
33 CATEGORY:=Network
34 URL:=https://www.torproject.org/
35 USERID:=tor=52:tor=52
36 DEPENDS:=+libevent2 +libopenssl +libpthread +librt +zlib +libcap
37 TITLE:=Tor routing daemon
38 endef
39
40 define Package/tor/Default/description
41 Tor is a toolset for a wide range of organizations and people that want to
42 improve their safety and security on the Internet. Using Tor can help you
43 anonymize web browsing and publishing, instant messaging, IRC, SSH, and
44 more. Tor also provides a platform on which software developers can build
45 new applications with built-in anonymity, safety, and privacy features.
46 endef
47
48 define Package/tor
49 $(call Package/tor/Default)
50 TITLE+= (full)
51 CONFLICTS:=tor-basic
52 PROVIDES:=tor-basic
53 VARIANT:=full
54 endef
55
56 define Package/tor/description
57 $(call Package/tor/Default/description)
58
59 This package contains the full tor daemon.
60
61 endef
62
63 define Package/tor-basic
64 $(call Package/tor/Default)
65 TITLE+= (no bridge/relay support)
66 VARIANT:=basic
67 endef
68
69 define Package/tor-basic/description
70 $(call Package/tor/Default/description)
71
72 This package contains the basic tor daemon, without bridge/relay support.
73
74 endef
75
76 define Package/tor-gencert
77 $(call Package/tor/Default)
78 TITLE:=Tor certificate generation
79 DEPENDS:=tor
80 endef
81
82 define Package/tor-gencert/description
83 $(call Package/tor/Default/description)
84
85 Generate certs and keys for Tor directory authorities.
86
87 endef
88
89 define Package/tor-resolve
90 $(call Package/tor/Default)
91 TITLE:=tor hostname resolve
92 DEPENDS:=tor-basic
93 endef
94
95 define Package/tor-resolve/description
96 $(call Package/tor/Default/description)
97
98 Resolve a hostname to an IP address via tor.
99
100 endef
101
102 define Package/tor-geoip
103 $(call Package/tor/Default)
104 TITLE:=GeoIP db for tor
105 DEPENDS:=tor-basic
106 endef
107
108 define Package/tor-geoip/description
109 $(call Package/tor/Default/description)
110
111 This package contains a GeoIP database mapping IP addresses to countries.
112
113 endef
114
115 define Package/tor/conffiles
116 /etc/tor/torrc
117 /var/lib/tor/fingerprint
118 /var/lib/tor/keys/*
119 /etc/config/tor
120 endef
121
122 Package/tor-basic/conffiles = $(Package/tor/conffiles)
123
124 CONFIGURE_ARGS += \
125 --with-libevent-dir="$(STAGING_DIR)/usr" \
126 --with-openssl-dir="$(STAGING_DIR)/usr" \
127 --with-zlib-dir="$(STAGING_DIR)/usr" \
128 --disable-asciidoc \
129 --disable-html-manual \
130 --disable-manpage \
131 --disable-seccomp \
132 --disable-libscrypt \
133 --disable-unittests \
134 --disable-lzma \
135 --disable-zstd \
136 --with-tor-user=tor \
137 --with-tor-group=tor \
138 --enable-pic
139
140 ifeq ($(BUILD_VARIANT),basic)
141 CONFIGURE_ARGS += --disable-module-relay
142 endif
143
144
145 TARGET_CFLAGS += $(if $(CONFIG_OPENSSL_ENGINE),,-DDISABLE_ENGINES)
146
147 CONFIGURE_VARS += \
148 CROSS_COMPILE="yes" \
149 ac_cv_func_mallinfo=no
150
151 define Package/tor/install
152 $(INSTALL_DIR) $(1)/usr/sbin
153 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
154 $(INSTALL_DIR) $(1)/etc/init.d
155 $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
156 $(INSTALL_DIR) $(1)/etc/tor
157 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
158 $(INSTALL_DIR) $(1)/etc/config
159 $(INSTALL_CONF) ./files/tor.conf $(1)/etc/config/tor
160 endef
161
162 Package/tor-basic/install = $(Package/tor/install)
163
164 define Package/tor-gencert/install
165 $(INSTALL_DIR) $(1)/usr/sbin
166 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-gencert $(1)/usr/sbin/
167 endef
168
169 define Package/tor-resolve/install
170 $(INSTALL_DIR) $(1)/usr/sbin
171 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-resolve $(1)/usr/sbin/
172 endef
173
174 define Package/tor-geoip/install
175 $(INSTALL_DIR) $(1)/usr/share/tor
176 $(INSTALL_DATA) \
177 $(PKG_INSTALL_DIR)/usr/share/tor/geoip \
178 $(PKG_INSTALL_DIR)/usr/share/tor/geoip6 \
179 $(1)/usr/share/tor/
180 endef
181
182 $(eval $(call BuildPackage,tor))
183 $(eval $(call BuildPackage,tor-basic))
184 $(eval $(call BuildPackage,tor-gencert))
185 $(eval $(call BuildPackage,tor-resolve))
186 $(eval $(call BuildPackage,tor-geoip))