First Commit
[librecmc/package-feed.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.2.8.9
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_MD5SUM:=3f5c273bb887be4aff11f4d99b9e2e52d293b81ff4f6302b730161ff16dc5316
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-geoip
52 $(call Package/tor/Default)
53   TITLE:=GeoIP db for tor
54   DEPENDS:=+tor
55 endef
56
57 define Package/tor-geoip/description
58 $(call Package/tor/Default/description)
59  This package contains a GeoIP database mapping IP addresses to countries.
60 endef
61
62 define Package/tor/conffiles
63 /etc/tor/torrc
64 endef
65
66 CONFIGURE_ARGS += \
67         --with-libevent-dir="$(STAGING_DIR)/usr" \
68         --with-ssl-dir="$(STAGING_DIR)/usr" \
69         --disable-asciidoc \
70         --disable-seccomp
71
72 ifneq ($(CONFIG_SSP_SUPPORT),y)
73         CONFIGURE_ARGS += \
74                 --disable-gcc-hardening
75         MAKE_FLAGS += \
76                 CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
77 else
78         MAKE_FLAGS += \
79                 CFLAGS="$(TARGET_CFLAGS) -fPIC -std=gnu99"
80 endif
81
82 CONFIGURE_VARS += \
83         CROSS_COMPILE="yes"
84
85 define Package/tor/install
86         $(INSTALL_DIR) $(1)/usr/sbin
87         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
88         $(INSTALL_DIR) $(1)/etc/init.d
89         $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
90         $(INSTALL_DIR) $(1)/etc/tor
91         $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
92 endef
93
94 define Package/tor-geoip/install
95         $(INSTALL_DIR) $(1)/usr/share/tor
96         $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor/
97 endef
98
99 $(eval $(call BuildPackage,tor))
100 $(eval $(call BuildPackage,tor-geoip))