2 # Copyright (C) 2008-2010 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:=1719642b3f25a23c3b3843ee99be18fb
20 include $(INCLUDE_DIR)/package.mk
25 DEPENDS:=+libevent +libopenssl +libpthread
26 TITLE:=An anonymous Internet communication system
27 URL:=http://www.torproject.org/
30 define Package/tor/description
31 Tor is a toolset for a wide range of organizations and people that want to
32 improve their safety and security on the Internet. Using Tor can help you
33 anonymize web browsing and publishing, instant messaging, IRC, SSH, and
34 more. Tor also provides a platform on which software developers can build
35 new applications with built-in anonymity, safety, and privacy features.
38 define Package/tor/conffiles
42 define Package/tor/postinst
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
56 cp /rom/etc/group /etc/group
58 if [ -h /etc/passwd ]; then
60 cp /rom/etc/passwd /etc/passwd
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
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
78 --with-libevent-dir="$(STAGING_DIR)/usr" \
79 --with-ssl-dir="$(STAGING_DIR)/usr" \
84 # pass CFLAGS again to override -O2 set by configure
86 CFLAGS="$(TARGET_CFLAGS)" \
88 define Package/tor/install
89 $(INSTALL_DIR) $(1)/usr/sbin
90 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
91 $(INSTALL_DIR) $(1)/etc/init.d
92 $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
93 $(INSTALL_DIR) $(1)/etc/tor
94 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
97 $(eval $(call BuildPackage,tor))