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