2 # Copyright (C) 2008-2019 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
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
:=3b5d969712c467851bd028f314343ef15a97ea457191e93ffa97310b05b9e395
18 PKG_MAINTAINER
:=Hauke Mehrtens
<hauke@hauke-m.de
> \
19 Peter Wagner
<tripolar@gmx.at
>
20 PKG_LICENSE_FILES
:=LICENSE
21 PKG_CPE_ID
:=cpe
:/a
:torproject
:tor
27 include $(INCLUDE_DIR
)/package.mk
29 define Package
/tor
/Default
32 URL
:=https
://www.torproject.org
/
34 DEPENDS
:=+libevent2
+libopenssl
+libpthread
+librt
+zlib
+libcap
35 TITLE
:=Tor routing daemon
38 define Package
/tor
/Default
/description
39 Tor is a toolset for a wide range of organizations and people that want to
40 improve their safety and security on the Internet. Using Tor can help you
41 anonymize web browsing and publishing
, instant messaging
, IRC
, SSH
, and
42 more. Tor also provides a platform on which software developers can build
43 new applications with built-in anonymity
, safety
, and privacy features.
47 $(call Package
/tor
/Default
)
54 define Package
/tor
/description
55 $(call Package
/tor
/Default
/description
)
57 This package contains the full tor daemon.
61 define Package
/tor-basic
62 $(call Package
/tor
/Default
)
63 TITLE
+= (no bridge
/relay support
)
67 define Package
/tor-basic
/description
68 $(call Package
/tor
/Default
/description
)
70 This package contains the basic tor daemon
, without bridge
/relay support.
74 define Package
/tor-gencert
75 $(call Package
/tor
/Default
)
76 TITLE
:=Tor certificate generation
80 define Package
/tor-gencert
/description
81 $(call Package
/tor
/Default
/description
)
83 Generate certs and keys for Tor directory authorities.
87 define Package
/tor-resolve
88 $(call Package
/tor
/Default
)
89 TITLE
:=tor hostname resolve
93 define Package
/tor-resolve
/description
94 $(call Package
/tor
/Default
/description
)
96 Resolve a hostname to an IP address via tor.
100 define Package
/tor-geoip
101 $(call Package
/tor
/Default
)
102 TITLE
:=GeoIP db for tor
106 define Package
/tor-geoip
/description
107 $(call Package
/tor
/Default
/description
)
109 This package contains a GeoIP database mapping IP addresses to countries.
113 define Package
/tor
/conffiles
115 /var
/lib
/tor
/fingerprint
120 Package
/tor-basic
/conffiles
= $(Package
/tor
/conffiles
)
123 --with-libevent-dir
="$(STAGING_DIR)/usr" \
124 --with-openssl-dir
="$(STAGING_DIR)/usr" \
125 --with-zlib-dir
="$(STAGING_DIR)/usr" \
127 --disable-html-manual \
130 --disable-libscrypt \
131 --disable-unittests \
134 --with-tor-user
=tor \
135 --with-tor-group
=tor \
138 ifeq ($(BUILD_VARIANT
),basic
)
139 CONFIGURE_ARGS
+= --disable-module-relay
143 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
-flto \
144 $(if
$(CONFIG_OPENSSL_ENGINE
),,-DDISABLE_ENGINES
)
146 TARGET_LDFLAGS
+= -Wl
,--gc-sections
-flto
149 CROSS_COMPILE
="yes" \
150 ac_cv_func_mallinfo
=no
152 define Package
/tor
/install
153 $(INSTALL_DIR
) $(1)/usr
/sbin
154 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/tor
$(1)/usr
/sbin
/
155 $(INSTALL_DIR
) $(1)/etc
/init.d
156 $(INSTALL_BIN
) .
/files
/tor.init
$(1)/etc
/init.d
/tor
157 $(INSTALL_DIR
) $(1)/etc
/tor
158 $(INSTALL_CONF
) $(PKG_INSTALL_DIR
)/etc
/tor
/torrc.sample
$(1)/etc
/tor
/torrc
159 $(INSTALL_DIR
) $(1)/etc
/config
160 $(INSTALL_CONF
) .
/files
/tor.conf
$(1)/etc
/config
/tor
163 Package
/tor-basic
/install = $(Package
/tor
/install)
165 define Package
/tor-gencert
/install
166 $(INSTALL_DIR
) $(1)/usr
/sbin
167 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/tor-gencert
$(1)/usr
/sbin
/
170 define Package
/tor-resolve
/install
171 $(INSTALL_DIR
) $(1)/usr
/sbin
172 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/tor-resolve
$(1)/usr
/sbin
/
175 define Package
/tor-geoip
/install
176 $(INSTALL_DIR
) $(1)/usr
/share
/tor
178 $(PKG_INSTALL_DIR
)/usr
/share
/tor
/geoip \
179 $(PKG_INSTALL_DIR
)/usr
/share
/tor
/geoip6 \
183 $(eval
$(call BuildPackage
,tor
))
184 $(eval
$(call BuildPackage
,tor-basic
))
185 $(eval
$(call BuildPackage
,tor-gencert
))
186 $(eval
$(call BuildPackage
,tor-resolve
))
187 $(eval
$(call BuildPackage
,tor-geoip
))