You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
3.8 KiB

  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=tor
  9. PKG_VERSION:=0.4.2.6
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://dist.torproject.org/ \
  13. https://archive.torproject.org/tor-package-archive
  14. PKG_HASH:=0500102433849bbe3231c590973d126c2d2d6b3943b4b9f9962bdb108436e6c4
  15. PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de> \
  16. Peter Wagner <tripolar@gmx.at>
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_CPE_ID:=cpe:/a:torproject:tor
  19. PKG_INSTALL:=1
  20. PKG_FIXUP:=autoreconf
  21. PKG_BUILD_PARALLEL:=1
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/tor/Default
  24. SECTION:=net
  25. CATEGORY:=Network
  26. URL:=https://www.torproject.org/
  27. USERID:=tor=52:tor=52
  28. endef
  29. define Package/tor/Default/description
  30. Tor is a toolset for a wide range of organizations and people that want to
  31. improve their safety and security on the Internet. Using Tor can help you
  32. anonymize web browsing and publishing, instant messaging, IRC, SSH, and
  33. more. Tor also provides a platform on which software developers can build
  34. new applications with built-in anonymity, safety, and privacy features.
  35. endef
  36. define Package/tor
  37. $(call Package/tor/Default)
  38. TITLE:=An anonymous Internet communication system
  39. DEPENDS:=+libevent2 +libopenssl +libpthread +librt +zlib +libcap
  40. endef
  41. define Package/tor/description
  42. $(call Package/tor/Default/description)
  43. This package contains the tor daemon.
  44. endef
  45. define Package/tor-gencert
  46. $(call Package/tor/Default)
  47. TITLE:=Tor certificate generation
  48. DEPENDS:=+tor
  49. endef
  50. define Package/tor-gencert/description
  51. $(call Package/tor/Default/description)
  52. Generate certs and keys for Tor directory authorities
  53. endef
  54. define Package/tor-resolve
  55. $(call Package/tor/Default)
  56. TITLE:=tor hostname resolve
  57. DEPENDS:=+tor
  58. endef
  59. define Package/tor-resolve/description
  60. $(call Package/tor/Default/description)
  61. Resolve a hostname to an IP address via tor
  62. endef
  63. define Package/tor-geoip
  64. $(call Package/tor/Default)
  65. TITLE:=GeoIP db for tor
  66. DEPENDS:=+tor
  67. endef
  68. define Package/tor-geoip/description
  69. $(call Package/tor/Default/description)
  70. This package contains a GeoIP database mapping IP addresses to countries.
  71. endef
  72. define Package/tor/conffiles
  73. /etc/tor/torrc
  74. /var/lib/tor/fingerprint
  75. /var/lib/tor/keys/*
  76. endef
  77. CONFIGURE_ARGS += \
  78. --with-libevent-dir="$(STAGING_DIR)/usr" \
  79. --with-openssl-dir="$(STAGING_DIR)/usr" \
  80. --with-zlib-dir="$(STAGING_DIR)/usr" \
  81. --disable-asciidoc \
  82. --disable-seccomp \
  83. --disable-libscrypt \
  84. --disable-unittests \
  85. --disable-lzma \
  86. --disable-zstd \
  87. --with-tor-user=tor \
  88. --with-tor-group=tor
  89. TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
  90. TARGET_LDFLAGS += -Wl,--gc-sections -flto
  91. ifneq ($(CONFIG_SSP_SUPPORT),y)
  92. CONFIGURE_ARGS += \
  93. --disable-gcc-hardening
  94. else
  95. EXTRA_CFLAGS += $(FPIC)
  96. endif
  97. CONFIGURE_VARS += \
  98. CROSS_COMPILE="yes"
  99. define Package/tor/install
  100. $(INSTALL_DIR) $(1)/usr/sbin
  101. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
  102. $(INSTALL_DIR) $(1)/etc/init.d
  103. $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
  104. $(INSTALL_DIR) $(1)/etc/tor
  105. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
  106. endef
  107. define Package/tor-gencert/install
  108. $(INSTALL_DIR) $(1)/usr/sbin
  109. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-gencert $(1)/usr/sbin/
  110. endef
  111. define Package/tor-resolve/install
  112. $(INSTALL_DIR) $(1)/usr/sbin
  113. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-resolve $(1)/usr/sbin/
  114. endef
  115. define Package/tor-geoip/install
  116. $(INSTALL_DIR) $(1)/usr/share/tor
  117. $(INSTALL_DATA) \
  118. $(PKG_INSTALL_DIR)/usr/share/tor/geoip \
  119. $(PKG_INSTALL_DIR)/usr/share/tor/geoip6 \
  120. $(1)/usr/share/tor/
  121. endef
  122. $(eval $(call BuildPackage,tor))
  123. $(eval $(call BuildPackage,tor-gencert))
  124. $(eval $(call BuildPackage,tor-resolve))
  125. $(eval $(call BuildPackage,tor-geoip))