2 # Copyright (C) 2008-2014 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://www.torproject.org/dist \
16 https://archive.torproject.org/tor-package-archive
17 PKG_MD5SUM:=5a7eee0d9df87233255d78b25c6f8270
19 PKG_BUILD_DEPENDS:=libminiupnpc libnatpmp
22 include $(INCLUDE_DIR)/package.mk
24 define Package/tor/Default
27 URL:=https://www.torproject.org/
30 define Package/tor/Default/description
31 Tor is a toolset for a wide range of organizations and people that want to
32 improve their safety and security on the Internet. Using Tor can help you
33 anonymize web browsing and publishing, instant messaging, IRC, SSH, and
34 more. Tor also provides a platform on which software developers can build
35 new applications with built-in anonymity, safety, and privacy features.
39 $(call Package/tor/Default)
40 TITLE:=An anonymous Internet communication system
41 DEPENDS:=+libevent2 +libopenssl +libpthread +librt +SSP_SUPPORT:libssp
44 define Package/tor/description
45 $(call Package/tor/Default/description)
46 This package contains the tor daemon.
49 define Package/tor-fw-helper
50 $(call Package/tor/Default)
51 TITLE:=Firewall helper for tor
52 DEPENDS:=+tor +libminiupnpc +libnatpmp
55 define Package/tor-fw-helper/description
56 $(call Package/tor/Default/description)
57 This package contains a helper for automatically configuring port forwarding.
60 define Package/tor-geoip
61 $(call Package/tor/Default)
62 TITLE:=GeoIP db for tor
66 define Package/tor-geoip/description
67 $(call Package/tor/Default/description)
68 This package contains a GeoIP database mapping IP addresses to countries.
71 define Package/tor/conffiles
76 --with-libevent-dir="$(STAGING_DIR)/usr" \
77 --with-ssl-dir="$(STAGING_DIR)/usr" \
79 --with-libminiupnpc-dir="$(STAGING_DIR)/usr" \
81 --with-libnatpmp-dir="$(STAGING_DIR)/usr" \
84 ifneq ($(CONFIG_SSP_SUPPORT),y)
86 --disable-gcc-hardening
88 CFLAGS="$(TARGET_CFLAGS)"
91 CFLAGS="$(TARGET_CFLAGS) -fPIC"
97 define Package/tor/install
98 $(INSTALL_DIR) $(1)/usr/sbin
99 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
100 $(INSTALL_DIR) $(1)/etc/init.d
101 $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
102 $(INSTALL_DIR) $(1)/etc/tor
103 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
106 define Package/tor-fw-helper/install
107 $(INSTALL_DIR) $(1)/usr/bin
108 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-fw-helper $(1)/usr/bin/
111 define Package/tor-geoip/install
112 $(INSTALL_DIR) $(1)/usr/share/tor
113 $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor/
116 $(eval $(call BuildPackage,tor))
117 $(eval $(call BuildPackage,tor-fw-helper))
118 $(eval $(call BuildPackage,tor-geoip))