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.

120 lines
3.2 KiB

  1. #
  2. # Copyright (C) 2008-2014 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.2.4.23
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://www.torproject.org/dist \
  13. https://archive.torproject.org/tor-package-archive
  14. PKG_MD5SUM:=9e39928e310612c3bffee727f554c63f
  15. PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
  16. PKG_LICENSE_FILE:=LICENSE
  17. PKG_BUILD_DEPENDS:=libminiupnpc libnatpmp
  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. endef
  25. define Package/tor/Default/description
  26. Tor is a toolset for a wide range of organizations and people that want to
  27. improve their safety and security on the Internet. Using Tor can help you
  28. anonymize web browsing and publishing, instant messaging, IRC, SSH, and
  29. more. Tor also provides a platform on which software developers can build
  30. new applications with built-in anonymity, safety, and privacy features.
  31. endef
  32. define Package/tor
  33. $(call Package/tor/Default)
  34. TITLE:=An anonymous Internet communication system
  35. DEPENDS:=+libevent2 +libopenssl +libpthread +librt +SSP_SUPPORT:libssp
  36. endef
  37. define Package/tor/description
  38. $(call Package/tor/Default/description)
  39. This package contains the tor daemon.
  40. endef
  41. define Package/tor-fw-helper
  42. $(call Package/tor/Default)
  43. TITLE:=Firewall helper for tor
  44. DEPENDS:=+tor +libminiupnpc +libnatpmp
  45. endef
  46. define Package/tor-fw-helper/description
  47. $(call Package/tor/Default/description)
  48. This package contains a helper for automatically configuring port forwarding.
  49. endef
  50. define Package/tor-geoip
  51. $(call Package/tor/Default)
  52. TITLE:=GeoIP db for tor
  53. DEPENDS:=+tor
  54. endef
  55. define Package/tor-geoip/description
  56. $(call Package/tor/Default/description)
  57. This package contains a GeoIP database mapping IP addresses to countries.
  58. endef
  59. define Package/tor/conffiles
  60. /etc/tor/torrc
  61. endef
  62. CONFIGURE_ARGS += \
  63. --with-libevent-dir="$(STAGING_DIR)/usr" \
  64. --with-ssl-dir="$(STAGING_DIR)/usr" \
  65. --enable-upnp \
  66. --with-libminiupnpc-dir="$(STAGING_DIR)/usr" \
  67. --enable-nat-pmp \
  68. --with-libnatpmp-dir="$(STAGING_DIR)/usr" \
  69. --disable-asciidoc
  70. ifneq ($(CONFIG_SSP_SUPPORT),y)
  71. CONFIGURE_ARGS += \
  72. --disable-gcc-hardening
  73. MAKE_FLAGS += \
  74. CFLAGS="$(TARGET_CFLAGS)"
  75. else
  76. MAKE_FLAGS += \
  77. CFLAGS="$(TARGET_CFLAGS) -fPIC"
  78. endif
  79. CONFIGURE_VARS += \
  80. CROSS_COMPILE="yes"
  81. define Package/tor/install
  82. $(INSTALL_DIR) $(1)/usr/sbin
  83. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
  84. $(INSTALL_DIR) $(1)/etc/init.d
  85. $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
  86. $(INSTALL_DIR) $(1)/etc/tor
  87. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
  88. endef
  89. define Package/tor-fw-helper/install
  90. $(INSTALL_DIR) $(1)/usr/bin
  91. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-fw-helper $(1)/usr/bin/
  92. endef
  93. define Package/tor-geoip/install
  94. $(INSTALL_DIR) $(1)/usr/share/tor
  95. $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor/
  96. endef
  97. $(eval $(call BuildPackage,tor))
  98. $(eval $(call BuildPackage,tor-fw-helper))
  99. $(eval $(call BuildPackage,tor-geoip))