79f61af32f4404469d32bed343f00717f69ecf56
[feed/packages.git] / net / tor / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=tor
11 PKG_VERSION:=0.2.6.10
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://www.torproject.org/dist \
16 https://archive.torproject.org/tor-package-archive
17 PKG_MD5SUM:=04f919e7882d1ca80f835545af562bad
18 PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
19 PKG_LICENSE_FILES:=LICENSE
20
21 PKG_BUILD_DEPENDS:=libminiupnpc libnatpmp
22 PKG_INSTALL:=1
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/tor/Default
27 SECTION:=net
28 CATEGORY:=Network
29 URL:=https://www.torproject.org/
30 USERID:=tor=52:tor=52
31 endef
32
33 define Package/tor/Default/description
34 Tor is a toolset for a wide range of organizations and people that want to
35 improve their safety and security on the Internet. Using Tor can help you
36 anonymize web browsing and publishing, instant messaging, IRC, SSH, and
37 more. Tor also provides a platform on which software developers can build
38 new applications with built-in anonymity, safety, and privacy features.
39 endef
40
41 define Package/tor
42 $(call Package/tor/Default)
43 TITLE:=An anonymous Internet communication system
44 DEPENDS:=+libevent2 +libopenssl +libpthread +librt
45 endef
46
47 define Package/tor/description
48 $(call Package/tor/Default/description)
49 This package contains the tor daemon.
50 endef
51
52 define Package/tor-fw-helper
53 $(call Package/tor/Default)
54 TITLE:=Firewall helper for tor
55 DEPENDS:=+tor +libminiupnpc +libnatpmp
56 endef
57
58 define Package/tor-fw-helper/description
59 $(call Package/tor/Default/description)
60 This package contains a helper for automatically configuring port forwarding.
61 endef
62
63 define Package/tor-geoip
64 $(call Package/tor/Default)
65 TITLE:=GeoIP db for tor
66 DEPENDS:=+tor
67 endef
68
69 define Package/tor-geoip/description
70 $(call Package/tor/Default/description)
71 This package contains a GeoIP database mapping IP addresses to countries.
72 endef
73
74 define Package/tor/conffiles
75 /etc/tor/torrc
76 endef
77
78 CONFIGURE_ARGS += \
79 --with-libevent-dir="$(STAGING_DIR)/usr" \
80 --with-ssl-dir="$(STAGING_DIR)/usr" \
81 --enable-upnp \
82 --with-libminiupnpc-dir="$(STAGING_DIR)/usr" \
83 --enable-nat-pmp \
84 --with-libnatpmp-dir="$(STAGING_DIR)/usr" \
85 --disable-asciidoc \
86 --disable-seccomp
87
88 ifneq ($(CONFIG_SSP_SUPPORT),y)
89 CONFIGURE_ARGS += \
90 --disable-gcc-hardening
91 MAKE_FLAGS += \
92 CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
93 else
94 MAKE_FLAGS += \
95 CFLAGS="$(TARGET_CFLAGS) -fPIC -std=gnu99"
96 endif
97
98 CONFIGURE_VARS += \
99 CROSS_COMPILE="yes"
100
101 define Package/tor/install
102 $(INSTALL_DIR) $(1)/usr/sbin
103 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
104 $(INSTALL_DIR) $(1)/etc/init.d
105 $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
106 $(INSTALL_DIR) $(1)/etc/tor
107 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
108 endef
109
110 define Package/tor-fw-helper/install
111 $(INSTALL_DIR) $(1)/usr/bin
112 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-fw-helper $(1)/usr/bin/
113 endef
114
115 define Package/tor-geoip/install
116 $(INSTALL_DIR) $(1)/usr/share/tor
117 $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor/
118 endef
119
120 $(eval $(call BuildPackage,tor))
121 $(eval $(call BuildPackage,tor-fw-helper))
122 $(eval $(call BuildPackage,tor-geoip))