2014-09-14 12:18:29 +00:00
|
|
|
#
|
2019-02-23 11:52:26 +00:00
|
|
|
# Copyright (C) 2008-2019 OpenWrt.org
|
2014-09-14 12:18:29 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=tor
|
2022-12-08 18:40:05 +00:00
|
|
|
PKG_VERSION:=0.4.7.12
|
2020-11-16 09:35:44 +00:00
|
|
|
PKG_RELEASE:=1
|
2014-09-14 12:18:29 +00:00
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
2016-05-24 09:01:38 +00:00
|
|
|
PKG_SOURCE_URL:=https://dist.torproject.org/ \
|
2014-09-14 12:18:29 +00:00
|
|
|
https://archive.torproject.org/tor-package-archive
|
2022-12-08 18:40:05 +00:00
|
|
|
PKG_HASH:=3b5d969712c467851bd028f314343ef15a97ea457191e93ffa97310b05b9e395
|
2018-06-25 19:45:13 +00:00
|
|
|
PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de> \
|
|
|
|
Peter Wagner <tripolar@gmx.at>
|
2014-11-25 07:42:42 +00:00
|
|
|
PKG_LICENSE_FILES:=LICENSE
|
2019-03-26 15:54:29 +00:00
|
|
|
PKG_CPE_ID:=cpe:/a:torproject:tor
|
2014-09-14 12:18:29 +00:00
|
|
|
|
|
|
|
PKG_INSTALL:=1
|
2018-11-17 15:55:06 +00:00
|
|
|
PKG_FIXUP:=autoreconf
|
|
|
|
PKG_BUILD_PARALLEL:=1
|
2014-09-14 12:18:29 +00:00
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
|
|
|
define Package/tor/Default
|
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
|
|
|
URL:=https://www.torproject.org/
|
2014-10-08 01:45:30 +00:00
|
|
|
USERID:=tor=52:tor=52
|
2020-10-24 21:38:52 +00:00
|
|
|
DEPENDS:=+libevent2 +libopenssl +libpthread +librt +zlib +libcap
|
|
|
|
TITLE:=Tor routing daemon
|
2014-09-14 12:18:29 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/tor/Default/description
|
2020-10-24 21:33:59 +00:00
|
|
|
Tor is a toolset for a wide range of organizations and people that want to
|
|
|
|
improve their safety and security on the Internet. Using Tor can help you
|
|
|
|
anonymize web browsing and publishing, instant messaging, IRC, SSH, and
|
|
|
|
more. Tor also provides a platform on which software developers can build
|
|
|
|
new applications with built-in anonymity, safety, and privacy features.
|
2014-09-14 12:18:29 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/tor
|
|
|
|
$(call Package/tor/Default)
|
2020-10-24 21:38:52 +00:00
|
|
|
TITLE+= (full)
|
|
|
|
CONFLICTS:=tor-basic
|
|
|
|
PROVIDES:=tor-basic
|
|
|
|
VARIANT:=full
|
2014-09-14 12:18:29 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/tor/description
|
|
|
|
$(call Package/tor/Default/description)
|
2020-10-24 21:33:59 +00:00
|
|
|
|
2020-10-24 21:38:52 +00:00
|
|
|
This package contains the full tor daemon.
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/tor-basic
|
|
|
|
$(call Package/tor/Default)
|
|
|
|
TITLE+= (no bridge/relay support)
|
|
|
|
VARIANT:=basic
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/tor-basic/description
|
|
|
|
$(call Package/tor/Default/description)
|
|
|
|
|
|
|
|
This package contains the basic tor daemon, without bridge/relay support.
|
2020-10-24 21:33:59 +00:00
|
|
|
|
2014-09-14 12:18:29 +00:00
|
|
|
endef
|
|
|
|
|
2017-01-14 14:38:14 +00:00
|
|
|
define Package/tor-gencert
|
|
|
|
$(call Package/tor/Default)
|
|
|
|
TITLE:=Tor certificate generation
|
2020-10-24 21:38:52 +00:00
|
|
|
DEPENDS:=tor
|
2017-01-14 14:38:14 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/tor-gencert/description
|
|
|
|
$(call Package/tor/Default/description)
|
2020-10-24 21:33:59 +00:00
|
|
|
|
|
|
|
Generate certs and keys for Tor directory authorities.
|
|
|
|
|
2017-01-14 14:38:14 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/tor-resolve
|
|
|
|
$(call Package/tor/Default)
|
|
|
|
TITLE:=tor hostname resolve
|
2020-10-24 21:38:52 +00:00
|
|
|
DEPENDS:=tor-basic
|
2017-01-14 14:38:14 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/tor-resolve/description
|
|
|
|
$(call Package/tor/Default/description)
|
2020-10-24 21:33:59 +00:00
|
|
|
|
|
|
|
Resolve a hostname to an IP address via tor.
|
|
|
|
|
2017-01-14 14:38:14 +00:00
|
|
|
endef
|
|
|
|
|
2014-09-14 12:18:29 +00:00
|
|
|
define Package/tor-geoip
|
|
|
|
$(call Package/tor/Default)
|
|
|
|
TITLE:=GeoIP db for tor
|
2020-10-24 21:38:52 +00:00
|
|
|
DEPENDS:=tor-basic
|
2014-09-14 12:18:29 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/tor-geoip/description
|
|
|
|
$(call Package/tor/Default/description)
|
2020-10-24 21:33:59 +00:00
|
|
|
|
|
|
|
This package contains a GeoIP database mapping IP addresses to countries.
|
|
|
|
|
2014-09-14 12:18:29 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/tor/conffiles
|
|
|
|
/etc/tor/torrc
|
2017-01-14 14:29:19 +00:00
|
|
|
/var/lib/tor/fingerprint
|
|
|
|
/var/lib/tor/keys/*
|
2019-12-31 08:16:21 +00:00
|
|
|
/etc/config/tor
|
2014-09-14 12:18:29 +00:00
|
|
|
endef
|
|
|
|
|
2020-10-24 21:38:52 +00:00
|
|
|
Package/tor-basic/conffiles = $(Package/tor/conffiles)
|
|
|
|
|
2014-09-14 12:18:29 +00:00
|
|
|
CONFIGURE_ARGS += \
|
|
|
|
--with-libevent-dir="$(STAGING_DIR)/usr" \
|
2017-01-14 14:28:02 +00:00
|
|
|
--with-openssl-dir="$(STAGING_DIR)/usr" \
|
|
|
|
--with-zlib-dir="$(STAGING_DIR)/usr" \
|
2015-04-29 21:12:49 +00:00
|
|
|
--disable-asciidoc \
|
2020-10-09 15:01:07 +00:00
|
|
|
--disable-html-manual \
|
|
|
|
--disable-manpage \
|
2017-01-14 14:28:02 +00:00
|
|
|
--disable-seccomp \
|
|
|
|
--disable-libscrypt \
|
|
|
|
--disable-unittests \
|
2017-10-30 11:21:30 +00:00
|
|
|
--disable-lzma \
|
2019-04-01 07:06:41 +00:00
|
|
|
--disable-zstd \
|
2017-01-14 14:28:02 +00:00
|
|
|
--with-tor-user=tor \
|
2020-06-16 22:41:19 +00:00
|
|
|
--with-tor-group=tor \
|
2020-09-22 12:18:57 +00:00
|
|
|
--enable-pic
|
2017-01-14 14:28:02 +00:00
|
|
|
|
2020-10-24 21:38:52 +00:00
|
|
|
ifeq ($(BUILD_VARIANT),basic)
|
|
|
|
CONFIGURE_ARGS += --disable-module-relay
|
|
|
|
endif
|
|
|
|
|
2021-02-25 08:19:22 +00:00
|
|
|
|
|
|
|
TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto \
|
|
|
|
$(if $(CONFIG_OPENSSL_ENGINE),,-DDISABLE_ENGINES)
|
|
|
|
|
2018-11-17 15:55:06 +00:00
|
|
|
TARGET_LDFLAGS += -Wl,--gc-sections -flto
|
2014-09-14 12:18:29 +00:00
|
|
|
|
|
|
|
CONFIGURE_VARS += \
|
2020-09-22 12:18:57 +00:00
|
|
|
CROSS_COMPILE="yes" \
|
|
|
|
ac_cv_func_mallinfo=no
|
2014-09-14 12:18:29 +00:00
|
|
|
|
|
|
|
define Package/tor/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
|
|
|
|
$(INSTALL_DIR) $(1)/etc/init.d
|
|
|
|
$(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
|
|
|
|
$(INSTALL_DIR) $(1)/etc/tor
|
|
|
|
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
|
2019-12-31 08:16:21 +00:00
|
|
|
$(INSTALL_DIR) $(1)/etc/config
|
|
|
|
$(INSTALL_CONF) ./files/tor.conf $(1)/etc/config/tor
|
2014-09-14 12:18:29 +00:00
|
|
|
endef
|
|
|
|
|
2020-10-24 21:38:52 +00:00
|
|
|
Package/tor-basic/install = $(Package/tor/install)
|
|
|
|
|
2017-01-14 14:38:14 +00:00
|
|
|
define Package/tor-gencert/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-gencert $(1)/usr/sbin/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/tor-resolve/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-resolve $(1)/usr/sbin/
|
|
|
|
endef
|
|
|
|
|
2014-09-14 12:18:29 +00:00
|
|
|
define Package/tor-geoip/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/share/tor
|
2018-11-17 15:55:06 +00:00
|
|
|
$(INSTALL_DATA) \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/tor/geoip \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/tor/geoip6 \
|
|
|
|
$(1)/usr/share/tor/
|
2014-09-14 12:18:29 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,tor))
|
2020-10-24 21:38:52 +00:00
|
|
|
$(eval $(call BuildPackage,tor-basic))
|
2017-01-14 14:38:14 +00:00
|
|
|
$(eval $(call BuildPackage,tor-gencert))
|
|
|
|
$(eval $(call BuildPackage,tor-resolve))
|
2014-09-14 12:18:29 +00:00
|
|
|
$(eval $(call BuildPackage,tor-geoip))
|