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.24-alpha
14 PKG_SOURCE
:=tor-
$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=https
://www.torproject.org
/dist \
16 https
://archive.torproject.org
/tor-package-archive
17 PKG_MD5SUM
:=4c1e2c7d778f813d09227433fffe3990
19 PKG_BUILD_DIR
:=$(BUILD_DIR
)/tor-
$(PKG_VERSION
)
22 include $(INCLUDE_DIR
)/package.mk
24 define Package
/tor-alpha
/Default
27 URL
:=https
://www.torproject.org
/
30 define Package
/tor-alpha
/Default
/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-alpha
39 $(call Package
/tor-alpha
/Default
)
40 TITLE
:=An anonymous Internet communication system
41 DEPENDS
:=+libevent
+libopenssl
+libpthread
+librt
+miniupnpc
44 define Package
/tor-alpha
/description
45 $(call Package
/tor-alpha
/Default
/description
)
46 This package contains the tor daemon.
49 define Package
/tor-alpha-geoip
50 $(call Package
/tor-alpha
/Default
)
51 TITLE
:=GeoIP db for tor
55 define Package
/tor-alpha-geoip
/description
56 $(call Package
/tor-alpha
/Default
/description
)
57 This package contains a GeoIP database mapping IP addresses to countries.
60 define Package
/tor-alpha
/conffiles
64 define Package
/tor-alpha
/postinst
71 # # check if we are on real system
72 if
[ -z
"$${IPKG_INSTROOT}" ]; then
73 # create copies of passwd and group, if we use squashfs
74 rootfs
=`mount |awk '/root/ { print $$5 }'`
75 if
[ "$$rootfs" = "squashfs" ]; then
76 if
[ -h
/etc
/group
]; then
78 cp
/rom
/etc
/group
/etc
/group
80 if
[ -h
/etc
/passwd
]; then
82 cp
/rom
/etc
/passwd
/etc
/passwd
88 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
89 echo
"adding group $$name to /etc/group"
90 echo
"$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc
/group
93 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
94 echo
"adding user $$name to /etc/passwd"
95 echo
"$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc
/passwd
100 --with-libevent-dir
="$(STAGING_DIR)/usr" \
101 --with-ssl-dir
="$(STAGING_DIR)/usr" \
103 --with-libminiupnpc-dir
="$(STAGING_DIR)/usr" \
106 CROSS_COMPILE
="yes" \
108 # pass CFLAGS again to override -O2 set by configure
110 CFLAGS
="$(TARGET_CFLAGS)" \
112 define Package
/tor-alpha
/install
113 $(INSTALL_DIR
) $(1)/usr
/sbin
114 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/tor
$(1)/usr
/sbin
/
115 $(INSTALL_DIR
) $(1)/etc
/init.d
116 $(INSTALL_BIN
) .
/files
/tor.init
$(1)/etc
/init.d
/tor
117 $(INSTALL_DIR
) $(1)/etc
/tor
118 $(INSTALL_CONF
) $(PKG_INSTALL_DIR
)/etc
/tor
/torrc.sample
$(1)/etc
/tor
/torrc
121 define Package
/tor-alpha-geoip
/install
122 $(INSTALL_DIR
) $(1)/usr
/share
/tor
123 $(CP
) $(PKG_INSTALL_DIR
)/usr
/share
/tor
/geoip
$(1)/usr
/share
/tor
/
126 $(eval
$(call BuildPackage
,tor-alpha
))
127 $(eval
$(call BuildPackage
,tor-alpha-geoip
))