2 # Copyright (C) 2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
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
:=ef8fc7f45d167875c337063d437c9832
21 include $(INCLUDE_DIR
)/package.mk
26 DEPENDS
:=+libevent
+libopenssl
+libpthread
+zlib
27 TITLE
:=An anonymous Internet communication system
28 URL
:=http
://tor.eff.org
/
31 define Package
/tor
/description
32 Tor is a toolset for a wide range of organizations and people that want to
33 improve their safety and security on the Internet. Using Tor can help you
34 anonymize web browsing and publishing
, instant messaging
, IRC
, SSH
, and
35 more. Tor also provides a platform on which software developers can build
36 new applications with built-in anonymity
, safety
, and privacy features.
39 define Package
/tor
/conffiles
43 define Package
/tor
/postinst
50 # # check if we are on real system
51 if
[ -z
"$${IPKG_INSTROOT}" ]; then
52 # create copies of passwd and group, if we use squashfs
53 rootfs
=`mount |awk '/root/ { print $$5 }'`
54 if
[ "$$rootfs" = "squashfs" ]; then
55 if
[ -h
/etc
/group
]; then
57 cp
/rom
/etc
/group
/etc
/group
59 if
[ -h
/etc
/passwd
]; then
61 cp
/rom
/etc
/passwd
/etc
/passwd
67 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
68 echo
"adding group $$name to /etc/group"
69 echo
"$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc
/group
72 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
73 echo
"adding user $name to /etc/passwd"
74 echo
"$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc
/passwd
79 --with-libevent-dir
="$(STAGING_DIR)/usr" \
80 --with-ssl-dir
="$(STAGING_DIR)/usr" \
85 # pass CFLAGS again to override -O2 set by configure
87 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
88 CFLAGS
="$(TARGET_CFLAGS)" \
89 DESTDIR
="$(PKG_INSTALL_DIR)" \
93 define Package
/tor
/install
94 $(INSTALL_DIR
) $(1)/usr
/sbin
95 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/src
/or
/tor
$(1)/usr
/sbin
/
96 $(INSTALL_DIR
) $(1)/etc
/init.d
97 $(INSTALL_BIN
) .
/files
/tor.init
$(1)/etc
/init.d
/tor
98 $(INSTALL_DIR
) $(1)/etc
/tor
99 $(INSTALL_DATA
) .
/files
/torrc
$(1)/etc
/tor
/torrc
102 $(eval
$(call BuildPackage
,tor
))