# Description: Tor is a anonymous network and proxy.
# URL: http://www.torproject.org/
# Packager: NuTyX core team
# Depends on: libevent openssl libseccomp

name=tor
version=0.2.7.6
release=1
source=(https://www.torproject.org/dist/tor-$version.tar.gz torrc tor.rc)

build() {
	cd $name-$version
	
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var 
	make
	make DESTDIR=$PKG install
	install -dm0700 -o 43 -g 43 ${PKG}/var/lib/tor
	mv ${PKG}/etc/tor/torrc.sample ${PKG}/etc/tor/torrc-dist
	install -Dm0644 ${SRC}/torrc ${PKG}/etc/tor/torrc
	install -Dm0750 ${SRC}/tor.rc ${PKG}/etc/rc.d/tor
	install -Dm0644 LICENSE ${PKG}/usr/share/licenses/${name}/LICENSE
}
