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.

149 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.3.5.8
  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:=d5c56603942a8927670f50a4a469fb909e29d3571fdd013389d567e57abc0b47
  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. --with-tor-user=tor \
  87. --with-tor-group=tor
  88. TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
  89. TARGET_LDFLAGS += -Wl,--gc-sections -flto
  90. ifneq ($(CONFIG_SSP_SUPPORT),y)
  91. CONFIGURE_ARGS += \
  92. --disable-gcc-hardening
  93. else
  94. EXTRA_CFLAGS += $(FPIC)
  95. endif
  96. CONFIGURE_VARS += \
  97. CROSS_COMPILE="yes"
  98. define Package/tor/install
  99. $(INSTALL_DIR) $(1)/usr/sbin
  100. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
  101. $(INSTALL_DIR) $(1)/etc/init.d
  102. $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
  103. $(INSTALL_DIR) $(1)/etc/tor
  104. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
  105. endef
  106. define Package/tor-gencert/install
  107. $(INSTALL_DIR) $(1)/usr/sbin
  108. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-gencert $(1)/usr/sbin/
  109. endef
  110. define Package/tor-resolve/install
  111. $(INSTALL_DIR) $(1)/usr/sbin
  112. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-resolve $(1)/usr/sbin/
  113. endef
  114. define Package/tor-geoip/install
  115. $(INSTALL_DIR) $(1)/usr/share/tor
  116. $(INSTALL_DATA) \
  117. $(PKG_INSTALL_DIR)/usr/share/tor/geoip \
  118. $(PKG_INSTALL_DIR)/usr/share/tor/geoip6 \
  119. $(1)/usr/share/tor/
  120. endef
  121. $(eval $(call BuildPackage,tor))
  122. $(eval $(call BuildPackage,tor-gencert))
  123. $(eval $(call BuildPackage,tor-resolve))
  124. $(eval $(call BuildPackage,tor-geoip))