4afdd0d2e5faf97c5f08aace149219c79bec0398
[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.4.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:=826a4cb2c099a29c7cf91516ffffcfcb5aace7533b8853a8c8bddcfe2bfb1023
18 PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de> \
19 Peter Wagner <tripolar@gmx.at>
20 PKG_LICENSE_FILES:=LICENSE
21
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 +zlib +libcap
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-gencert
53 $(call Package/tor/Default)
54 TITLE:=Tor certificate generation
55 DEPENDS:=+tor
56 endef
57
58 define Package/tor-gencert/description
59 $(call Package/tor/Default/description)
60 Generate certs and keys for Tor directory authorities
61 endef
62
63 define Package/tor-resolve
64 $(call Package/tor/Default)
65 TITLE:=tor hostname resolve
66 DEPENDS:=+tor
67 endef
68
69 define Package/tor-resolve/description
70 $(call Package/tor/Default/description)
71 Resolve a hostname to an IP address via tor
72 endef
73
74 define Package/tor-geoip
75 $(call Package/tor/Default)
76 TITLE:=GeoIP db for tor
77 DEPENDS:=+tor
78 endef
79
80 define Package/tor-geoip/description
81 $(call Package/tor/Default/description)
82 This package contains a GeoIP database mapping IP addresses to countries.
83 endef
84
85 define Package/tor/conffiles
86 /etc/tor/torrc
87 /var/lib/tor/fingerprint
88 /var/lib/tor/keys/*
89 endef
90
91 CONFIGURE_ARGS += \
92 --with-libevent-dir="$(STAGING_DIR)/usr" \
93 --with-ssl-dir="$(STAGING_DIR)/usr" \
94 --with-openssl-dir="$(STAGING_DIR)/usr" \
95 --with-zlib-dir="$(STAGING_DIR)/usr" \
96 --disable-asciidoc \
97 --disable-seccomp \
98 --disable-libscrypt \
99 --disable-unittests \
100 --disable-largefile \
101 --disable-lzma \
102 --with-tor-user=tor \
103 --with-tor-group=tor
104
105 EXTRA_CFLAGS += -std=gnu99
106
107 ifneq ($(CONFIG_SSP_SUPPORT),y)
108 CONFIGURE_ARGS += \
109 --disable-gcc-hardening
110 else
111 EXTRA_CFLAGS += -fPIC
112 endif
113
114 CONFIGURE_VARS += \
115 CROSS_COMPILE="yes"
116
117 define Package/tor/install
118 $(INSTALL_DIR) $(1)/usr/sbin
119 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
120 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/torify $(1)/usr/sbin/
121 $(INSTALL_DIR) $(1)/etc/init.d
122 $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
123 $(INSTALL_DIR) $(1)/etc/tor
124 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
125 endef
126
127 define Package/tor-gencert/install
128 $(INSTALL_DIR) $(1)/usr/sbin
129 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-gencert $(1)/usr/sbin/
130 endef
131
132 define Package/tor-resolve/install
133 $(INSTALL_DIR) $(1)/usr/sbin
134 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-resolve $(1)/usr/sbin/
135 endef
136
137 define Package/tor-geoip/install
138 $(INSTALL_DIR) $(1)/usr/share/tor
139 $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor/
140 $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip6 $(1)/usr/share/tor/
141 endef
142
143 $(eval $(call BuildPackage,tor))
144 $(eval $(call BuildPackage,tor-gencert))
145 $(eval $(call BuildPackage,tor-resolve))
146 $(eval $(call BuildPackage,tor-geoip))