5d4f292af257dbf44c68a2ff5173559d8657c0e8
[packages.git] / net / tor-alpha / Makefile
1 #
2 # Copyright (C) 2008-2013 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-alpha
11 PKG_VERSION:=0.2.4.15-rc
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=tor-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://www.torproject.org/dist \
16         https://archive.torproject.org/tor-package-archive \
17         http://tor.mirror.tn/dist
18 PKG_MD5SUM:=d05da33b2c99978adc55c78ead8b25d2
19
20 PKG_BUILD_DEPENDS:=libminiupnpc libnatpmp
21 PKG_BUILD_DIR:=$(BUILD_DIR)/tor-$(PKG_VERSION)
22 PKG_INSTALL:=1
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/tor-alpha/Default
27   SECTION:=net
28   CATEGORY:=Network
29   URL:=https://www.torproject.org/
30 endef
31
32 define Package/tor-alpha/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-alpha
41 $(call Package/tor-alpha/Default)
42   TITLE:=An anonymous Internet communication system
43   DEPENDS:=+libevent2 +libopenssl +libpthread +librt +SSP_SUPPORT:libssp
44 endef
45
46 define Package/tor-alpha/description
47 $(call Package/tor-alpha/Default/description)
48  This package contains the tor daemon.
49 endef
50
51 define Package/tor-alpha-fw-helper
52 $(call Package/tor-alpha/Default)
53   TITLE:=Firewall helper for tor
54   DEPENDS:=+tor-alpha +libminiupnpc +libnatpmp
55 endef
56
57 define Package/tor-alpha-fw-helper/description
58 $(call Package/tor-alpha/Default/description)
59  This package contains a helper for automatically configuring port forwarding.
60 endef
61
62 define Package/tor-alpha-geoip
63 $(call Package/tor-alpha/Default)
64   TITLE:=GeoIP db for tor
65   DEPENDS:=+tor-alpha
66 endef
67
68 define Package/tor-alpha-geoip/description
69 $(call Package/tor-alpha/Default/description)
70  This package contains a GeoIP database mapping IP addresses to countries.
71 endef
72
73 define Package/tor-alpha/conffiles
74 /etc/tor/torrc
75 endef
76
77 CONFIGURE_ARGS += \
78         --with-libevent-dir="$(STAGING_DIR)/usr" \
79         --with-ssl-dir="$(STAGING_DIR)/usr" \
80         --enable-upnp \
81         --with-libminiupnpc-dir="$(STAGING_DIR)/usr" \
82         --enable-nat-pmp \
83         --with-libnatpmp-dir="$(STAGING_DIR)/usr" \
84         --disable-asciidoc \
85         --disable-threads
86
87 ifneq ($(CONFIG_SSP_SUPPORT),y)
88         CONFIGURE_ARGS += \
89                 --disable-gcc-hardening
90         MAKE_FLAGS += \
91                 CFLAGS="$(TARGET_CFLAGS)"
92 else
93         MAKE_FLAGS += \
94                 CFLAGS="$(TARGET_CFLAGS) -fPIC"
95
96 endif
97
98 CONFIGURE_VARS += \
99         CROSS_COMPILE="yes"
100
101 define Package/tor-alpha/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-alpha-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-alpha-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-alpha))
121 $(eval $(call BuildPackage,tor-alpha-fw-helper))
122 $(eval $(call BuildPackage,tor-alpha-geoip))