6229132f94ce60db27b093bf8cdb89e56f5e0a82
[feed/packages.git] / net / tor / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=tor
11 PKG_VERSION:=0.3.2.10
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://dist.torproject.org/ \
16 https://archive.torproject.org/tor-package-archive
17 PKG_HASH:=60df77c31dcf94fdd686c8ca8c34f3b70243b33a7344ecc0b719d5ca2617cbee
18 PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
19 PKG_LICENSE_FILES:=LICENSE
20
21 PKG_INSTALL:=1
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/tor/Default
26 SECTION:=net
27 CATEGORY:=Network
28 URL:=https://www.torproject.org/
29 USERID:=tor=52:tor=52
30 endef
31
32 define Package/tor/Default/description
33 Tor is a toolset for a wide range of organizations and people that want to
34 improve their safety and security on the Internet. Using Tor can help you
35 anonymize web browsing and publishing, instant messaging, IRC, SSH, and
36 more. Tor also provides a platform on which software developers can build
37 new applications with built-in anonymity, safety, and privacy features.
38 endef
39
40 define Package/tor
41 $(call Package/tor/Default)
42 TITLE:=An anonymous Internet communication system
43 DEPENDS:=+libevent2 +libopenssl +libpthread +librt +zlib +libcap
44 endef
45
46 define Package/tor/description
47 $(call Package/tor/Default/description)
48 This package contains the tor daemon.
49 endef
50
51 define Package/tor-gencert
52 $(call Package/tor/Default)
53 TITLE:=Tor certificate generation
54 DEPENDS:=+tor
55 endef
56
57 define Package/tor-gencert/description
58 $(call Package/tor/Default/description)
59 Generate certs and keys for Tor directory authorities
60 endef
61
62 define Package/tor-resolve
63 $(call Package/tor/Default)
64 TITLE:=tor hostname resolve
65 DEPENDS:=+tor
66 endef
67
68 define Package/tor-resolve/description
69 $(call Package/tor/Default/description)
70 Resolve a hostname to an IP address via tor
71 endef
72
73 define Package/tor-geoip
74 $(call Package/tor/Default)
75 TITLE:=GeoIP db for tor
76 DEPENDS:=+tor
77 endef
78
79 define Package/tor-geoip/description
80 $(call Package/tor/Default/description)
81 This package contains a GeoIP database mapping IP addresses to countries.
82 endef
83
84 define Package/tor/conffiles
85 /etc/tor/torrc
86 /var/lib/tor/fingerprint
87 /var/lib/tor/keys/*
88 endef
89
90 CONFIGURE_ARGS += \
91 --with-libevent-dir="$(STAGING_DIR)/usr" \
92 --with-ssl-dir="$(STAGING_DIR)/usr" \
93 --with-openssl-dir="$(STAGING_DIR)/usr" \
94 --with-zlib-dir="$(STAGING_DIR)/usr" \
95 --disable-asciidoc \
96 --disable-seccomp \
97 --disable-libscrypt \
98 --disable-unittests \
99 --disable-largefile \
100 --disable-lzma \
101 --with-tor-user=tor \
102 --with-tor-group=tor
103
104 EXTRA_CFLAGS += -std=gnu99
105
106 ifneq ($(CONFIG_SSP_SUPPORT),y)
107 CONFIGURE_ARGS += \
108 --disable-gcc-hardening
109 else
110 EXTRA_CFLAGS += -fPIC
111 endif
112
113 CONFIGURE_VARS += \
114 CROSS_COMPILE="yes"
115
116 define Package/tor/install
117 $(INSTALL_DIR) $(1)/usr/sbin
118 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
119 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/torify $(1)/usr/sbin/
120 $(INSTALL_DIR) $(1)/etc/init.d
121 $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
122 $(INSTALL_DIR) $(1)/etc/tor
123 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
124 endef
125
126 define Package/tor-gencert/install
127 $(INSTALL_DIR) $(1)/usr/sbin
128 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-gencert $(1)/usr/sbin/
129 endef
130
131 define Package/tor-resolve/install
132 $(INSTALL_DIR) $(1)/usr/sbin
133 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-resolve $(1)/usr/sbin/
134 endef
135
136 define Package/tor-geoip/install
137 $(INSTALL_DIR) $(1)/usr/share/tor
138 $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor/
139 $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip6 $(1)/usr/share/tor/
140 endef
141
142 $(eval $(call BuildPackage,tor))
143 $(eval $(call BuildPackage,tor-gencert))
144 $(eval $(call BuildPackage,tor-resolve))
145 $(eval $(call BuildPackage,tor-geoip))