2 # Copyright (C) 2008-2011 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
11 PKG_VERSION
:=0.2.2.21-alpha
14 PKG_SOURCE
:=tor-
$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=https
://www.torproject.org
/dist
16 PKG_MD5SUM
:=4543aa232eed38c80dfb1f6419807ea9
17 PKG_BUILD_DIR
=$(BUILD_DIR
)/tor-
$(PKG_VERSION
)/
21 include $(INCLUDE_DIR
)/package.mk
23 define Package
/tor-alpha
26 DEPENDS
:=+libevent
+libopenssl
+libpthread
+miniupnpc
27 TITLE
:=An anonymous Internet communication system
28 URL
:=http
://www.torproject.org
/
31 define Package
/tor-alpha
/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-alpha
/conffiles
43 define Package
/tor-alpha
/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" \
82 --with-libminiupnpc-dir
="$(STAGING_DIR)/usr" \
87 # pass CFLAGS again to override -O2 set by configure
89 CFLAGS
="$(TARGET_CFLAGS)" \
91 define Package
/tor-alpha
/install
92 $(INSTALL_DIR
) $(1)/usr
/sbin
93 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/tor
$(1)/usr
/sbin
/
94 $(INSTALL_DIR
) $(1)/etc
/init.d
95 $(INSTALL_BIN
) .
/files
/tor.init
$(1)/etc
/init.d
/tor
96 $(INSTALL_DIR
) $(1)/etc
/tor
97 $(INSTALL_CONF
) $(PKG_INSTALL_DIR
)/etc
/tor
/torrc.sample
$(1)/etc
/tor
/torrc
100 $(eval
$(call BuildPackage
,tor-alpha
))