2 # Copyright (C) 2008 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=http
://www.torproject.org
/dist/
16 PKG_MD5SUM
:=f20011be23d5a76988233df12c346f41
18 include $(INCLUDE_DIR
)/package.mk
23 DEPENDS
:=+libevent
+libopenssl
+libpthread
+zlib
24 TITLE
:=An anonymous Internet communication system
25 URL
:=http
://tor.eff.org
/
28 define Package
/tor
/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.
36 define Package
/tor
/conffiles
40 define Package
/tor
/postinst
47 # # check if we are on real system
48 if
[ -z
"$${IPKG_INSTROOT}" ]; then
49 # create copies of passwd and group, if we use squashfs
50 rootfs
=`mount |awk '/root/ { print $$5 }'`
51 if
[ "$$rootfs" = "squashfs" ]; then
52 if
[ -h
/etc
/group
]; then
54 cp
/rom
/etc
/group
/etc
/group
56 if
[ -h
/etc
/passwd
]; then
58 cp
/rom
/etc
/passwd
/etc
/passwd
64 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
65 echo
"adding group $$name to /etc/group"
66 echo
"$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc
/group
69 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
70 echo
"adding user $name to /etc/passwd"
71 echo
"$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc
/passwd
76 --with-libevent-dir
="$(STAGING_DIR)/usr" \
77 --with-ssl-dir
="$(STAGING_DIR)/usr" \
82 # pass CFLAGS again to override -O2 set by configure
84 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
85 CFLAGS
="$(TARGET_CFLAGS)" \
86 DESTDIR
="$(PKG_INSTALL_DIR)" \
90 define Package
/tor
/install
91 $(INSTALL_DIR
) $(1)/usr
/sbin
92 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/src
/or
/tor
$(1)/usr
/sbin
/
93 $(INSTALL_DIR
) $(1)/etc
/init.d
94 $(INSTALL_BIN
) .
/files
/tor.init
$(1)/etc
/init.d
/tor
95 $(INSTALL_DIR
) $(1)/etc
/tor
96 $(INSTALL_DATA
) .
/files
/torrc
$(1)/etc
/tor
/torrc
99 $(eval
$(call BuildPackage
,tor
))