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.

148 lines
3.9 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.4.5
  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:=a45ca00afe765e3baa839767c9dd6ac9a46dd01720a3a8ff4d86558c12359926
  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. --enable-pic
  91. TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
  92. TARGET_LDFLAGS += -Wl,--gc-sections -flto
  93. CONFIGURE_VARS += \
  94. CROSS_COMPILE="yes" \
  95. ac_cv_func_mallinfo=no
  96. define Package/tor/install
  97. $(INSTALL_DIR) $(1)/usr/sbin
  98. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
  99. $(INSTALL_DIR) $(1)/etc/init.d
  100. $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
  101. $(INSTALL_DIR) $(1)/etc/tor
  102. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
  103. $(INSTALL_DIR) $(1)/etc/config
  104. $(INSTALL_CONF) ./files/tor.conf $(1)/etc/config/tor
  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))