libgd: avoid recursive and redundant dependencies
[feed/packages.git] / net / tor / Makefile
1 #
2 # Copyright (C) 2008-2019 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.4.7.8
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:=9e9a5c67ad2acdd5f0f8be14ed591fed076b1708abf8344066990a0fa66fe195
18 PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de> \
19 Peter Wagner <tripolar@gmx.at>
20 PKG_LICENSE_FILES:=LICENSE
21 PKG_CPE_ID:=cpe:/a:torproject:tor
22
23 PKG_INSTALL:=1
24 PKG_FIXUP:=autoreconf
25 PKG_BUILD_PARALLEL:=1
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/tor/Default
30 SECTION:=net
31 CATEGORY:=Network
32 URL:=https://www.torproject.org/
33 USERID:=tor=52:tor=52
34 DEPENDS:=+libevent2 +libopenssl +libpthread +librt +zlib +libcap
35 TITLE:=Tor routing daemon
36 endef
37
38 define Package/tor/Default/description
39 Tor is a toolset for a wide range of organizations and people that want to
40 improve their safety and security on the Internet. Using Tor can help you
41 anonymize web browsing and publishing, instant messaging, IRC, SSH, and
42 more. Tor also provides a platform on which software developers can build
43 new applications with built-in anonymity, safety, and privacy features.
44 endef
45
46 define Package/tor
47 $(call Package/tor/Default)
48 TITLE+= (full)
49 CONFLICTS:=tor-basic
50 PROVIDES:=tor-basic
51 VARIANT:=full
52 endef
53
54 define Package/tor/description
55 $(call Package/tor/Default/description)
56
57 This package contains the full tor daemon.
58
59 endef
60
61 define Package/tor-basic
62 $(call Package/tor/Default)
63 TITLE+= (no bridge/relay support)
64 VARIANT:=basic
65 endef
66
67 define Package/tor-basic/description
68 $(call Package/tor/Default/description)
69
70 This package contains the basic tor daemon, without bridge/relay support.
71
72 endef
73
74 define Package/tor-gencert
75 $(call Package/tor/Default)
76 TITLE:=Tor certificate generation
77 DEPENDS:=tor
78 endef
79
80 define Package/tor-gencert/description
81 $(call Package/tor/Default/description)
82
83 Generate certs and keys for Tor directory authorities.
84
85 endef
86
87 define Package/tor-resolve
88 $(call Package/tor/Default)
89 TITLE:=tor hostname resolve
90 DEPENDS:=tor-basic
91 endef
92
93 define Package/tor-resolve/description
94 $(call Package/tor/Default/description)
95
96 Resolve a hostname to an IP address via tor.
97
98 endef
99
100 define Package/tor-geoip
101 $(call Package/tor/Default)
102 TITLE:=GeoIP db for tor
103 DEPENDS:=tor-basic
104 endef
105
106 define Package/tor-geoip/description
107 $(call Package/tor/Default/description)
108
109 This package contains a GeoIP database mapping IP addresses to countries.
110
111 endef
112
113 define Package/tor/conffiles
114 /etc/tor/torrc
115 /var/lib/tor/fingerprint
116 /var/lib/tor/keys/*
117 /etc/config/tor
118 endef
119
120 Package/tor-basic/conffiles = $(Package/tor/conffiles)
121
122 CONFIGURE_ARGS += \
123 --with-libevent-dir="$(STAGING_DIR)/usr" \
124 --with-openssl-dir="$(STAGING_DIR)/usr" \
125 --with-zlib-dir="$(STAGING_DIR)/usr" \
126 --disable-asciidoc \
127 --disable-html-manual \
128 --disable-manpage \
129 --disable-seccomp \
130 --disable-libscrypt \
131 --disable-unittests \
132 --disable-lzma \
133 --disable-zstd \
134 --with-tor-user=tor \
135 --with-tor-group=tor \
136 --enable-pic
137
138 ifeq ($(BUILD_VARIANT),basic)
139 CONFIGURE_ARGS += --disable-module-relay
140 endif
141
142
143 TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto \
144 $(if $(CONFIG_OPENSSL_ENGINE),,-DDISABLE_ENGINES)
145
146 TARGET_LDFLAGS += -Wl,--gc-sections -flto
147
148 CONFIGURE_VARS += \
149 CROSS_COMPILE="yes" \
150 ac_cv_func_mallinfo=no
151
152 define Package/tor/install
153 $(INSTALL_DIR) $(1)/usr/sbin
154 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
155 $(INSTALL_DIR) $(1)/etc/init.d
156 $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
157 $(INSTALL_DIR) $(1)/etc/tor
158 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
159 $(INSTALL_DIR) $(1)/etc/config
160 $(INSTALL_CONF) ./files/tor.conf $(1)/etc/config/tor
161 endef
162
163 Package/tor-basic/install = $(Package/tor/install)
164
165 define Package/tor-gencert/install
166 $(INSTALL_DIR) $(1)/usr/sbin
167 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-gencert $(1)/usr/sbin/
168 endef
169
170 define Package/tor-resolve/install
171 $(INSTALL_DIR) $(1)/usr/sbin
172 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-resolve $(1)/usr/sbin/
173 endef
174
175 define Package/tor-geoip/install
176 $(INSTALL_DIR) $(1)/usr/share/tor
177 $(INSTALL_DATA) \
178 $(PKG_INSTALL_DIR)/usr/share/tor/geoip \
179 $(PKG_INSTALL_DIR)/usr/share/tor/geoip6 \
180 $(1)/usr/share/tor/
181 endef
182
183 $(eval $(call BuildPackage,tor))
184 $(eval $(call BuildPackage,tor-basic))
185 $(eval $(call BuildPackage,tor-gencert))
186 $(eval $(call BuildPackage,tor-resolve))
187 $(eval $(call BuildPackage,tor-geoip))