[packages] tor-alpha: update to 0.2.2.22-alpha, add archive mirror
[openwrt/svn-archive/archive.git] / net / tor-alpha / 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-alpha
11 PKG_VERSION:=0.2.2.22-alpha
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=tor-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://www.torproject.org/dist \
16 http://archive.torproject.org/tor-package-archive
17 PKG_MD5SUM:=482617714694340054b6669955e4271e
18 PKG_BUILD_DIR=$(BUILD_DIR)/tor-$(PKG_VERSION)/
19
20 PKG_INSTALL:=1
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/tor-alpha
25 SECTION:=net
26 CATEGORY:=Network
27 DEPENDS:=+libevent +libopenssl +libpthread +miniupnpc
28 TITLE:=An anonymous Internet communication system
29 URL:=http://www.torproject.org/
30 endef
31
32 define Package/tor-alpha/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/conffiles
41 /etc/tor/torrc
42 endef
43
44 define Package/tor-alpha/postinst
45 #!/bin/sh
46
47 name=tor
48 id=52
49
50 # do not change below
51 # # check if we are on real system
52 if [ -z "$${IPKG_INSTROOT}" ]; then
53 # create copies of passwd and group, if we use squashfs
54 rootfs=`mount |awk '/root/ { print $$5 }'`
55 if [ "$$rootfs" = "squashfs" ]; then
56 if [ -h /etc/group ]; then
57 rm /etc/group
58 cp /rom/etc/group /etc/group
59 fi
60 if [ -h /etc/passwd ]; then
61 rm /etc/passwd
62 cp /rom/etc/passwd /etc/passwd
63 fi
64 fi
65 fi
66
67 echo ""
68 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
69 echo "adding group $$name to /etc/group"
70 echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
71 fi
72
73 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
74 echo "adding user $$name to /etc/passwd"
75 echo "$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc/passwd
76 fi
77 endef
78
79 CONFIGURE_ARGS += \
80 --with-libevent-dir="$(STAGING_DIR)/usr" \
81 --with-ssl-dir="$(STAGING_DIR)/usr" \
82 --enable-upnp \
83 --with-libminiupnpc-dir="$(STAGING_DIR)/usr" \
84
85 CONFIGURE_VARS += \
86 CROSS_COMPILE="yes" \
87
88 # pass CFLAGS again to override -O2 set by configure
89 MAKE_FLAGS += \
90 CFLAGS="$(TARGET_CFLAGS)" \
91
92 define Package/tor-alpha/install
93 $(INSTALL_DIR) $(1)/usr/sbin
94 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
95 $(INSTALL_DIR) $(1)/etc/init.d
96 $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
97 $(INSTALL_DIR) $(1)/etc/tor
98 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
99 endef
100
101 $(eval $(call BuildPackage,tor-alpha))