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.

147 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.3.5
  10. PKG_RELEASE:=2
  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:=616a0e4ae688d0e151d46e3e4258565da4d443d1ddbd316db0b90910e2d5d868
  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. /etc/config/tor
  77. endef
  78. CONFIGURE_ARGS += \
  79. --with-libevent-dir="$(STAGING_DIR)/usr" \
  80. --with-openssl-dir="$(STAGING_DIR)/usr" \
  81. --with-zlib-dir="$(STAGING_DIR)/usr" \
  82. --disable-asciidoc \
  83. --disable-seccomp \
  84. --disable-libscrypt \
  85. --disable-unittests \
  86. --disable-lzma \
  87. --disable-zstd \
  88. --with-tor-user=tor \
  89. --with-tor-group=tor \
  90. --with-pic
  91. TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
  92. TARGET_LDFLAGS += -Wl,--gc-sections -flto
  93. CONFIGURE_VARS += \
  94. CROSS_COMPILE="yes"
  95. define Package/tor/install
  96. $(INSTALL_DIR) $(1)/usr/sbin
  97. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
  98. $(INSTALL_DIR) $(1)/etc/init.d
  99. $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
  100. $(INSTALL_DIR) $(1)/etc/tor
  101. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
  102. $(INSTALL_DIR) $(1)/etc/config
  103. $(INSTALL_CONF) ./files/tor.conf $(1)/etc/config/tor
  104. endef
  105. define Package/tor-gencert/install
  106. $(INSTALL_DIR) $(1)/usr/sbin
  107. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-gencert $(1)/usr/sbin/
  108. endef
  109. define Package/tor-resolve/install
  110. $(INSTALL_DIR) $(1)/usr/sbin
  111. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-resolve $(1)/usr/sbin/
  112. endef
  113. define Package/tor-geoip/install
  114. $(INSTALL_DIR) $(1)/usr/share/tor
  115. $(INSTALL_DATA) \
  116. $(PKG_INSTALL_DIR)/usr/share/tor/geoip \
  117. $(PKG_INSTALL_DIR)/usr/share/tor/geoip6 \
  118. $(1)/usr/share/tor/
  119. endef
  120. $(eval $(call BuildPackage,tor))
  121. $(eval $(call BuildPackage,tor-gencert))
  122. $(eval $(call BuildPackage,tor-resolve))
  123. $(eval $(call BuildPackage,tor-geoip))