unfs3: add support for compiling with the external librpc
[openwrt/svn-archive/archive.git] / net / tor / Makefile
1 #
2 # Copyright (C) 2008-2011 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.1.29
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.torproject.org/dist
16 PKG_MD5SUM:=1cd4feea84f2b066717b500d090bcf65
17
18 PKG_INSTALL:=1
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/tor/Default
23 SECTION:=net
24 CATEGORY:=Network
25 URL:=http://www.torproject.org/
26 endef
27
28 define Package/tor/Default/description
29 Tor is a toolset for a wide range of organizations and people that want to
30 improve their safety and security on the Internet. Using Tor can help you
31 anonymize web browsing and publishing, instant messaging, IRC, SSH, and
32 more. Tor also provides a platform on which software developers can build
33 new applications with built-in anonymity, safety, and privacy features.
34 endef
35
36 define Package/tor
37 $(call Package/tor/Default)
38 TITLE:=An anonymous Internet communication system
39 DEPENDS:=+libevent +libopenssl +libpthread
40 endef
41
42 define Package/tor-geoip
43 $(call Package/tor/Default)
44 TITLE:=GeoIP db for tor
45 DEPENDS:=+tor
46 endef
47
48 define Package/tor/conffiles
49 /etc/tor/torrc
50 endef
51
52 define Package/tor/postinst
53 #!/bin/sh
54
55 name=tor
56 id=52
57
58 # do not change below
59 # # check if we are on real system
60 if [ -z "$${IPKG_INSTROOT}" ]; then
61 # create copies of passwd and group, if we use squashfs
62 rootfs=`mount |awk '/root/ { print $$5 }'`
63 if [ "$$rootfs" = "squashfs" ]; then
64 if [ -h /etc/group ]; then
65 rm /etc/group
66 cp /rom/etc/group /etc/group
67 fi
68 if [ -h /etc/passwd ]; then
69 rm /etc/passwd
70 cp /rom/etc/passwd /etc/passwd
71 fi
72 fi
73 fi
74
75 echo ""
76 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
77 echo "adding group $$name to /etc/group"
78 echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
79 fi
80
81 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
82 echo "adding user $$name to /etc/passwd"
83 echo "$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc/passwd
84 fi
85 endef
86
87 CONFIGURE_ARGS += \
88 --with-libevent-dir="$(STAGING_DIR)/usr" \
89 --with-ssl-dir="$(STAGING_DIR)/usr" \
90
91 CONFIGURE_VARS += \
92 CROSS_COMPILE="yes" \
93
94 # pass CFLAGS again to override -O2 set by configure
95 MAKE_FLAGS += \
96 CFLAGS="$(TARGET_CFLAGS)" \
97
98 define Package/tor/install
99 $(INSTALL_DIR) $(1)/usr/sbin
100 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
101 $(INSTALL_DIR) $(1)/etc/init.d
102 $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
103 $(INSTALL_DIR) $(1)/etc/tor
104 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
105 endef
106
107 define Package/tor-geoip/install
108 $(INSTALL_DIR) $(1)/usr/share/tor
109 $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor
110 endef
111
112 $(eval $(call BuildPackage,tor))
113 $(eval $(call BuildPackage,tor-geoip))