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:=6a2d0637d4e514be2ec574723a05065245cce51da78a21cec1dc831be5ccac62
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/
36 define Package/tor/Default/description
37 Tor is a toolset for a wide range of organizations and people that want to
38 improve their safety and security on the Internet. Using Tor can help you
39 anonymize web browsing and publishing, instant messaging, IRC, SSH, and
40 more. Tor also provides a platform on which software developers can build
41 new applications with built-in anonymity, safety, and privacy features.
45 $(call Package/tor/Default)
46 TITLE:=An anonymous Internet communication system
47 DEPENDS:=+libevent2 +libopenssl +libpthread +librt +zlib +libcap
50 define Package/tor/description
51 $(call Package/tor/Default/description)
52 This package contains the tor daemon.
55 define Package/tor-gencert
56 $(call Package/tor/Default)
57 TITLE:=Tor certificate generation
61 define Package/tor-gencert/description
62 $(call Package/tor/Default/description)
63 Generate certs and keys for Tor directory authorities
66 define Package/tor-resolve
67 $(call Package/tor/Default)
68 TITLE:=tor hostname resolve
72 define Package/tor-resolve/description
73 $(call Package/tor/Default/description)
74 Resolve a hostname to an IP address via tor
77 define Package/tor-geoip
78 $(call Package/tor/Default)
79 TITLE:=GeoIP db for tor
83 define Package/tor-geoip/description
84 $(call Package/tor/Default/description)
85 This package contains a GeoIP database mapping IP addresses to countries.
88 define Package/tor/conffiles
90 /var/lib/tor/fingerprint
96 --with-libevent-dir="$(STAGING_DIR)/usr" \
97 --with-openssl-dir="$(STAGING_DIR)/usr" \
98 --with-zlib-dir="$(STAGING_DIR)/usr" \
101 --disable-libscrypt \
102 --disable-unittests \
105 --with-tor-user=tor \
106 --with-tor-group=tor \
109 TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
110 TARGET_LDFLAGS += -Wl,--gc-sections -flto
115 define Package/tor/install
116 $(INSTALL_DIR) $(1)/usr/sbin
117 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
118 $(INSTALL_DIR) $(1)/etc/init.d
119 $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
120 $(INSTALL_DIR) $(1)/etc/tor
121 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
122 $(INSTALL_DIR) $(1)/etc/config
123 $(INSTALL_CONF) ./files/tor.conf $(1)/etc/config/tor
126 define Package/tor-gencert/install
127 $(INSTALL_DIR) $(1)/usr/sbin
128 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-gencert $(1)/usr/sbin/
131 define Package/tor-resolve/install
132 $(INSTALL_DIR) $(1)/usr/sbin
133 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-resolve $(1)/usr/sbin/
136 define Package/tor-geoip/install
137 $(INSTALL_DIR) $(1)/usr/share/tor
139 $(PKG_INSTALL_DIR)/usr/share/tor/geoip \
140 $(PKG_INSTALL_DIR)/usr/share/tor/geoip6 \
144 $(eval $(call BuildPackage,tor))
145 $(eval $(call BuildPackage,tor-gencert))
146 $(eval $(call BuildPackage,tor-resolve))
147 $(eval $(call BuildPackage,tor-geoip))