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.

146 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.3.9
  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:=85346b4d026e6a041c8e326d2cc64b5f5361b032075c89c5854f16dbc02fce6f
  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. include $(INCLUDE_DIR)/package.mk
  20. define Package/tor/Default
  21. SECTION:=net
  22. CATEGORY:=Network
  23. URL:=https://www.torproject.org/
  24. USERID:=tor=52:tor=52
  25. endef
  26. define Package/tor/Default/description
  27. Tor is a toolset for a wide range of organizations and people that want to
  28. improve their safety and security on the Internet. Using Tor can help you
  29. anonymize web browsing and publishing, instant messaging, IRC, SSH, and
  30. more. Tor also provides a platform on which software developers can build
  31. new applications with built-in anonymity, safety, and privacy features.
  32. endef
  33. define Package/tor
  34. $(call Package/tor/Default)
  35. TITLE:=An anonymous Internet communication system
  36. DEPENDS:=+libevent2 +libopenssl +libpthread +librt +zlib +libcap
  37. endef
  38. define Package/tor/description
  39. $(call Package/tor/Default/description)
  40. This package contains the tor daemon.
  41. endef
  42. define Package/tor-gencert
  43. $(call Package/tor/Default)
  44. TITLE:=Tor certificate generation
  45. DEPENDS:=+tor
  46. endef
  47. define Package/tor-gencert/description
  48. $(call Package/tor/Default/description)
  49. Generate certs and keys for Tor directory authorities
  50. endef
  51. define Package/tor-resolve
  52. $(call Package/tor/Default)
  53. TITLE:=tor hostname resolve
  54. DEPENDS:=+tor
  55. endef
  56. define Package/tor-resolve/description
  57. $(call Package/tor/Default/description)
  58. Resolve a hostname to an IP address via tor
  59. endef
  60. define Package/tor-geoip
  61. $(call Package/tor/Default)
  62. TITLE:=GeoIP db for tor
  63. DEPENDS:=+tor
  64. endef
  65. define Package/tor-geoip/description
  66. $(call Package/tor/Default/description)
  67. This package contains a GeoIP database mapping IP addresses to countries.
  68. endef
  69. define Package/tor/conffiles
  70. /etc/tor/torrc
  71. /var/lib/tor/fingerprint
  72. /var/lib/tor/keys/*
  73. endef
  74. CONFIGURE_ARGS += \
  75. --with-libevent-dir="$(STAGING_DIR)/usr" \
  76. --with-ssl-dir="$(STAGING_DIR)/usr" \
  77. --with-openssl-dir="$(STAGING_DIR)/usr" \
  78. --with-zlib-dir="$(STAGING_DIR)/usr" \
  79. --disable-asciidoc \
  80. --disable-seccomp \
  81. --disable-libscrypt \
  82. --disable-unittests \
  83. --disable-largefile \
  84. --disable-lzma \
  85. --with-tor-user=tor \
  86. --with-tor-group=tor
  87. EXTRA_CFLAGS += -std=gnu99
  88. ifneq ($(CONFIG_SSP_SUPPORT),y)
  89. CONFIGURE_ARGS += \
  90. --disable-gcc-hardening
  91. else
  92. EXTRA_CFLAGS += -fPIC
  93. endif
  94. CONFIGURE_VARS += \
  95. CROSS_COMPILE="yes"
  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_BIN) $(PKG_INSTALL_DIR)/usr/bin/torify $(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. $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor/
  116. $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip6 $(1)/usr/share/tor/
  117. endef
  118. $(eval $(call BuildPackage,tor))
  119. $(eval $(call BuildPackage,tor-gencert))
  120. $(eval $(call BuildPackage,tor-resolve))
  121. $(eval $(call BuildPackage,tor-geoip))