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.

122 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.5.12
  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:=89745069a7efb7aafd01ae263bd0fe5c
  15. PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
  16. PKG_LICENSE_FILES:=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. 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
  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-fw-helper
  43. $(call Package/tor/Default)
  44. TITLE:=Firewall helper for tor
  45. DEPENDS:=+tor +libminiupnpc +libnatpmp
  46. endef
  47. define Package/tor-fw-helper/description
  48. $(call Package/tor/Default/description)
  49. This package contains a helper for automatically configuring port forwarding.
  50. endef
  51. define Package/tor-geoip
  52. $(call Package/tor/Default)
  53. TITLE:=GeoIP db for tor
  54. DEPENDS:=+tor
  55. endef
  56. define Package/tor-geoip/description
  57. $(call Package/tor/Default/description)
  58. This package contains a GeoIP database mapping IP addresses to countries.
  59. endef
  60. define Package/tor/conffiles
  61. /etc/tor/torrc
  62. endef
  63. CONFIGURE_ARGS += \
  64. --with-libevent-dir="$(STAGING_DIR)/usr" \
  65. --with-ssl-dir="$(STAGING_DIR)/usr" \
  66. --enable-upnp \
  67. --with-libminiupnpc-dir="$(STAGING_DIR)/usr" \
  68. --enable-nat-pmp \
  69. --with-libnatpmp-dir="$(STAGING_DIR)/usr" \
  70. --disable-asciidoc \
  71. --disable-seccomp
  72. ifneq ($(CONFIG_SSP_SUPPORT),y)
  73. CONFIGURE_ARGS += \
  74. --disable-gcc-hardening
  75. MAKE_FLAGS += \
  76. CFLAGS="$(TARGET_CFLAGS)"
  77. else
  78. MAKE_FLAGS += \
  79. CFLAGS="$(TARGET_CFLAGS) -fPIC"
  80. endif
  81. CONFIGURE_VARS += \
  82. CROSS_COMPILE="yes"
  83. define Package/tor/install
  84. $(INSTALL_DIR) $(1)/usr/sbin
  85. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
  86. $(INSTALL_DIR) $(1)/etc/init.d
  87. $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
  88. $(INSTALL_DIR) $(1)/etc/tor
  89. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
  90. endef
  91. define Package/tor-fw-helper/install
  92. $(INSTALL_DIR) $(1)/usr/bin
  93. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-fw-helper $(1)/usr/bin/
  94. endef
  95. define Package/tor-geoip/install
  96. $(INSTALL_DIR) $(1)/usr/share/tor
  97. $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor/
  98. endef
  99. $(eval $(call BuildPackage,tor))
  100. $(eval $(call BuildPackage,tor-fw-helper))
  101. $(eval $(call BuildPackage,tor-geoip))