[patch-team] - tor-alpha new package - Signed-off-by: Jacob Appelbaum <jacob@appelbau...
[openwrt/svn-archive/archive.git] / net / tor-alpha / Makefile
1 #
2 # Copyright (C) 2008-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # Want to test this package? Try this:
8 # make package/tor-alpha/{clean,compile,install} V=99
9 #
10
11 include $(TOPDIR)/rules.mk
12
13 PKG_NAME:=tor-alpha
14 PKG_VERSION:=0.2.2.19-alpha
15 PKG_RELEASE:=1
16
17 PKG_SOURCE:=tor-$(PKG_VERSION).tar.gz
18 PKG_SOURCE_URL:=https://www.torproject.org/dist
19 PKG_MD5SUM:=619f0c4243adc67360e8a99710935697
20 PKG_BUILD_DIR=$(BUILD_DIR)/tor-$(PKG_VERSION)/
21
22 PKG_INSTALL:=1
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/tor-alpha
27 SECTION:=net
28 CATEGORY:=Network
29 DEPENDS:=+libevent +libopenssl +libpthread +miniupnpc
30 TITLE:=An anonymous Internet communication system
31 URL:=http://www.torproject.org/
32 endef
33
34 define Package/tor-alpha/description
35 Tor is a toolset for a wide range of organizations and people that want to
36 improve their safety and security on the Internet. Using Tor can help you
37 anonymize web browsing and publishing, instant messaging, IRC, SSH, and
38 more. Tor also provides a platform on which software developers can build
39 new applications with built-in anonymity, safety, and privacy features.
40 endef
41
42 define Package/tor-alpha/conffiles
43 /etc/tor/torrc
44 endef
45
46 define Package/tor-alpha/postinst
47 #!/bin/sh
48
49 name=tor
50 id=52
51
52 # do not change below
53 # # check if we are on real system
54 if [ -z "$${IPKG_INSTROOT}" ]; then
55 # create copies of passwd and group, if we use squashfs
56 rootfs=`mount |awk '/root/ { print $$5 }'`
57 if [ "$$rootfs" = "squashfs" ]; then
58 if [ -h /etc/group ]; then
59 rm /etc/group
60 cp /rom/etc/group /etc/group
61 fi
62 if [ -h /etc/passwd ]; then
63 rm /etc/passwd
64 cp /rom/etc/passwd /etc/passwd
65 fi
66 fi
67 fi
68
69 echo ""
70 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
71 echo "adding group $$name to /etc/group"
72 echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
73 fi
74
75 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
76 echo "adding user $$name to /etc/passwd"
77 echo "$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc/passwd
78 fi
79 endef
80
81 CONFIGURE_ARGS += \
82 --with-libevent-dir="$(STAGING_DIR)/usr" \
83 --with-ssl-dir="$(STAGING_DIR)/usr" \
84 --enable-upnp \
85 --with-libminiupnpc-dir="$(STAGING_DIR)/usr" \
86
87 CONFIGURE_VARS += \
88 CROSS_COMPILE="yes" \
89
90 # pass CFLAGS again to override -O2 set by configure
91 MAKE_FLAGS += \
92 CFLAGS="$(TARGET_CFLAGS)" \
93
94 define Package/tor-alpha/install
95 $(INSTALL_DIR) $(1)/usr/sbin
96 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
97 $(INSTALL_DIR) $(1)/etc/init.d
98 $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
99 $(INSTALL_DIR) $(1)/etc/tor
100 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
101 endef
102
103 $(eval $(call BuildPackage,tor-alpha))