b2e3e6e70e22dbca2a566443bad7efe4e816147a
[openwrt/svn-archive/archive.git] / net / tor / Makefile
1 #
2 # Copyright (C) 2007 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=tor
12 PKG_VERSION:=0.1.2.16
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://tor.eff.org/dist/ \
17 http://ftp.se.linux.org/crypto/tor/ \
18 http://tor.meulie.net/
19 PKG_MD5SUM:=f340777b3f6c3175de976856d2d2e4be
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/tor
24 SECTION:=net
25 CATEGORY:=Network
26 DEPENDS:=+libevent +libopenssl +libpthread +zlib
27 TITLE:=An anonymous Internet communication system
28 DESCRIPTION:=\
29 Tor is a toolset for a wide range of organizations and people that want \\\
30 to improve their safety and security on the Internet. Using Tor can \\\
31 help you anonymize web browsing and publishing, instant messaging, \\\
32 IRC, SSH, and more. Tor also provides a platform on which software \\\
33 developers can build new applications with built-in anonymity, safety, \\\
34 and privacy features.
35 URL:=http://tor.eff.org/
36 endef
37
38 define Package/tor/conffiles
39 /etc/tor/torrc
40 endef
41
42 define Package/tor/postinst
43 #!/bin/sh
44
45 name=tor
46 id=52
47
48 # do not change below
49 # # check if we are on real system
50 if [ -z "$${IPKG_INSTROOT}" ]; then
51 # create copies of passwd and group, if we use squashfs
52 rootfs=`mount |awk '/root/ { print $$5 }'`
53 if [ "$$rootfs" = "squashfs" ]; then
54 if [ -h /etc/group ]; then
55 rm /etc/group
56 cp /rom/etc/group /etc/group
57 fi
58 if [ -h /etc/passwd ]; then
59 rm /etc/passwd
60 cp /rom/etc/passwd /etc/passwd
61 fi
62 fi
63 fi
64
65 echo ""
66 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
67 echo "adding group $$name to /etc/group"
68 echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
69 fi
70
71 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
72 echo "adding user $name to /etc/passwd"
73 echo "$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc/passwd
74 fi
75 endef
76
77 CONFIGURE_ARGS += \
78 --with-libevent-dir="$(STAGING_DIR)/usr" \
79 --with-ssl-dir="$(STAGING_DIR)/usr" \
80 , \
81 CROSS_COMPILE=yes
82
83 define Package/tor/install
84 $(INSTALL_DIR) $(1)/usr/sbin
85 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/or/tor $(1)/usr/sbin/
86 $(INSTALL_DIR) $(1)/etc/init.d
87 $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
88 $(INSTALL_DIR) $(1)/etc/tor
89 $(INSTALL_DATA) ./files/torrc $(1)/etc/tor/torrc
90 endef
91
92 $(eval $(call BuildPackage,tor))