Makefile 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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.2.9.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_MD5SUM:=33325d2b250fd047ba2ddc5d11c2190c4e2951f4b03ec48ebd8bf0666e990d43
  15. PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
  16. PKG_LICENSE_FILES:=LICENSE
  17. PKG_INSTALL:=1
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/tor/Default
  20. SECTION:=net
  21. CATEGORY:=Network
  22. URL:=https://www.torproject.org/
  23. USERID:=tor=52:tor=52
  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 +zlib +libcap
  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-gencert
  42. $(call Package/tor/Default)
  43. TITLE:=Tor certificate generation
  44. DEPENDS:=+tor
  45. endef
  46. define Package/tor-gencert/description
  47. $(call Package/tor/Default/description)
  48. Generate certs and keys for Tor directory authorities
  49. endef
  50. define Package/tor-resolve
  51. $(call Package/tor/Default)
  52. TITLE:=tor hostname resolve
  53. DEPENDS:=+tor
  54. endef
  55. define Package/tor-resolve/description
  56. $(call Package/tor/Default/description)
  57. Resolve a hostname to an IP address via tor
  58. endef
  59. define Package/tor-geoip
  60. $(call Package/tor/Default)
  61. TITLE:=GeoIP db for tor
  62. DEPENDS:=+tor
  63. endef
  64. define Package/tor-geoip/description
  65. $(call Package/tor/Default/description)
  66. This package contains a GeoIP database mapping IP addresses to countries.
  67. endef
  68. define Package/tor/conffiles
  69. /etc/tor/torrc
  70. /var/lib/tor/fingerprint
  71. /var/lib/tor/keys/*
  72. endef
  73. CONFIGURE_ARGS += \
  74. --with-libevent-dir="$(STAGING_DIR)/usr" \
  75. --with-ssl-dir="$(STAGING_DIR)/usr" \
  76. --with-openssl-dir="$(STAGING_DIR)/usr" \
  77. --with-zlib-dir="$(STAGING_DIR)/usr" \
  78. --disable-asciidoc \
  79. --disable-seccomp \
  80. --disable-libscrypt \
  81. --disable-unittests \
  82. --disable-largefile \
  83. --with-tor-user=tor \
  84. --with-tor-group=tor
  85. EXTRA_CFLAGS += -std=gnu99
  86. ifneq ($(CONFIG_SSP_SUPPORT),y)
  87. CONFIGURE_ARGS += \
  88. --disable-gcc-hardening
  89. else
  90. EXTRA_CFLAGS += -fPIC
  91. endif
  92. CONFIGURE_VARS += \
  93. CROSS_COMPILE="yes"
  94. define Package/tor/install
  95. $(INSTALL_DIR) $(1)/usr/sbin
  96. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
  97. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/torify $(1)/usr/sbin/
  98. $(INSTALL_DIR) $(1)/etc/init.d
  99. $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
  100. $(INSTALL_DIR) $(1)/etc/tor
  101. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
  102. endef
  103. define Package/tor-gencert/install
  104. $(INSTALL_DIR) $(1)/usr/sbin
  105. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-gencert $(1)/usr/sbin/
  106. endef
  107. define Package/tor-resolve/install
  108. $(INSTALL_DIR) $(1)/usr/sbin
  109. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-resolve $(1)/usr/sbin/
  110. endef
  111. define Package/tor-geoip/install
  112. $(INSTALL_DIR) $(1)/usr/share/tor
  113. $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor/
  114. $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip6 $(1)/usr/share/tor/
  115. endef
  116. $(eval $(call BuildPackage,tor))
  117. $(eval $(call BuildPackage,tor-gencert))
  118. $(eval $(call BuildPackage,tor-resolve))
  119. $(eval $(call BuildPackage,tor-geoip))