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.8 KiB

  1. #
  2. # Copyright (C) 2008-2016 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.4.10
  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:=adeccb2bd49dbe5164185d702b973e2760009866c11975d9b2b74dae4d0c258a
  15. PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de> \
  16. Peter Wagner <tripolar@gmx.at>
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_INSTALL:=1
  19. PKG_FIXUP:=autoreconf
  20. PKG_BUILD_PARALLEL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/tor/Default
  23. SECTION:=net
  24. CATEGORY:=Network
  25. URL:=https://www.torproject.org/
  26. USERID:=tor=52:tor=52
  27. endef
  28. define Package/tor/Default/description
  29. Tor is a toolset for a wide range of organizations and people that want to
  30. improve their safety and security on the Internet. Using Tor can help you
  31. anonymize web browsing and publishing, instant messaging, IRC, SSH, and
  32. more. Tor also provides a platform on which software developers can build
  33. new applications with built-in anonymity, safety, and privacy features.
  34. endef
  35. define Package/tor
  36. $(call Package/tor/Default)
  37. TITLE:=An anonymous Internet communication system
  38. DEPENDS:=+libevent2 +libopenssl +libpthread +librt +zlib +libcap
  39. endef
  40. define Package/tor/description
  41. $(call Package/tor/Default/description)
  42. This package contains the tor daemon.
  43. endef
  44. define Package/tor-gencert
  45. $(call Package/tor/Default)
  46. TITLE:=Tor certificate generation
  47. DEPENDS:=+tor
  48. endef
  49. define Package/tor-gencert/description
  50. $(call Package/tor/Default/description)
  51. Generate certs and keys for Tor directory authorities
  52. endef
  53. define Package/tor-resolve
  54. $(call Package/tor/Default)
  55. TITLE:=tor hostname resolve
  56. DEPENDS:=+tor
  57. endef
  58. define Package/tor-resolve/description
  59. $(call Package/tor/Default/description)
  60. Resolve a hostname to an IP address via tor
  61. endef
  62. define Package/tor-geoip
  63. $(call Package/tor/Default)
  64. TITLE:=GeoIP db for tor
  65. DEPENDS:=+tor
  66. endef
  67. define Package/tor-geoip/description
  68. $(call Package/tor/Default/description)
  69. This package contains a GeoIP database mapping IP addresses to countries.
  70. endef
  71. define Package/tor/conffiles
  72. /etc/tor/torrc
  73. /var/lib/tor/fingerprint
  74. /var/lib/tor/keys/*
  75. endef
  76. CONFIGURE_ARGS += \
  77. --with-libevent-dir="$(STAGING_DIR)/usr" \
  78. --with-openssl-dir="$(STAGING_DIR)/usr" \
  79. --with-zlib-dir="$(STAGING_DIR)/usr" \
  80. --disable-asciidoc \
  81. --disable-seccomp \
  82. --disable-libscrypt \
  83. --disable-unittests \
  84. --disable-lzma \
  85. --with-tor-user=tor \
  86. --with-tor-group=tor
  87. TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
  88. TARGET_LDFLAGS += -Wl,--gc-sections -flto
  89. ifneq ($(CONFIG_SSP_SUPPORT),y)
  90. CONFIGURE_ARGS += \
  91. --disable-gcc-hardening
  92. else
  93. EXTRA_CFLAGS += $(FPIC)
  94. endif
  95. CONFIGURE_VARS += \
  96. CROSS_COMPILE="yes"
  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
  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))