Merge branch 'maint-0.2.2'

This commit is contained in:
Roger Dingledine 2010-09-30 22:02:54 -04:00
commit 28b55c92d5
3 changed files with 61 additions and 7 deletions

View File

@ -89,7 +89,6 @@ EOF
DOC=$BUILD_DIR/tor_resources/documents DOC=$BUILD_DIR/tor_resources/documents
mkdir $DOC mkdir $DOC
mkdir $DOC/howto mkdir $DOC/howto
cp AUTHORS $DOC/AUTHORS.txt
groff doc/tor.1.in -T ps -m man | pstopdf -i -o $DOC/tor-reference.pdf groff doc/tor.1.in -T ps -m man | pstopdf -i -o $DOC/tor-reference.pdf
groff doc/tor-resolve.1 -T ps -m man | pstopdf -i -o $DOC/tor-resolve.pdf groff doc/tor-resolve.1 -T ps -m man | pstopdf -i -o $DOC/tor-resolve.pdf
mkdir $DOC/Advanced mkdir $DOC/Advanced
@ -145,7 +144,7 @@ cp LICENSE $BUILD_DIR/output/Tor\ License.txt
find $BUILD_DIR/output -print0 | sudo xargs -0 chown root:wheel find $BUILD_DIR/output -print0 | sudo xargs -0 chown root:wheel
mv $BUILD_DIR/output "$BUILD_DIR/Tor-$VERSION-$ARCH-Bundle" sudo mv $BUILD_DIR/output "$BUILD_DIR/Tor-$VERSION-$ARCH-Bundle"
rm -f "Tor-$VERSION-$ARCH-Bundle.dmg" rm -f "Tor-$VERSION-$ARCH-Bundle.dmg"
USER="`whoami`" USER="`whoami`"
sudo hdiutil create -format UDZO -imagekey zlib-level=9 -srcfolder "$BUILD_DIR/Tor-$VERSION-$ARCH-Bundle" "Tor-$VERSION-$ARCH-Bundle.dmg" sudo hdiutil create -format UDZO -imagekey zlib-level=9 -srcfolder "$BUILD_DIR/Tor-$VERSION-$ARCH-Bundle" "Tor-$VERSION-$ARCH-Bundle.dmg"

View File

@ -16,6 +16,15 @@
# description: Onion Router - A low-latency anonymous proxy # description: Onion Router - A low-latency anonymous proxy
# #
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/tor
NAME=tor
DESC="tor daemon"
TORPIDDIR=/var/run/tor
TORPID=$TORPIDDIR/tor.pid
WAITFORDAEMON=60
ARGS=""
# Library functions # Library functions
if [ -f /etc/rc.d/init.d/functions ]; then if [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions . /etc/rc.d/init.d/functions
@ -23,9 +32,6 @@ elif [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions . /etc/init.d/functions
fi fi
# Increase open file descriptors a reasonable amount
ulimit -n 8192
TORCTL=@BINDIR@/torctl TORCTL=@BINDIR@/torctl
# torctl will use these environment variables # torctl will use these environment variables
@ -44,9 +50,47 @@ else
SUPROG=/bin/su SUPROG=/bin/su
fi fi
# Raise ulimit based on number of file descriptors available (thanks, Debian)
if [ -r /proc/sys/fs/file-max ]; then
system_max=`cat /proc/sys/fs/file-max`
if [ "$system_max" -gt "80000" ] ; then
MAX_FILEDESCRIPTORS=32768
elif [ "$system_max" -gt "40000" ] ; then
MAX_FILEDESCRIPTORS=16384
elif [ "$system_max" -gt "10000" ] ; then
MAX_FILEDESCRIPTORS=8192
else
MAX_FILEDESCRIPTORS=1024
cat << EOF
Warning: Your system has very few filedescriptors available in total.
Maybe you should try raising that by adding 'fs.file-max=100000' to your
/etc/sysctl.conf file. Feel free to pick any number that you deem appropriate.
Then run 'sysctl -p'. See /proc/sys/fs/file-max for the current value, and
file-nr in the same directory for how many of those are used at the moment.
EOF
fi
else
MAX_FILEDESCRIPTORS=8192
fi
NICE=""
case "$1" in case "$1" in
start) start)
if [ -n "$MAX_FILEDESCRIPTORS" ]; then
echo -n "Raising maximum number of filedescriptors (ulimit -n) to $MAX_FILEDESCRIPTORS"
if ulimit -n "$MAX_FILEDESCRIPTORS" ; then
echo "."
else
echo ": FAILED."
fi
fi
action $"Starting tor:" $TORCTL start action $"Starting tor:" $TORCTL start
RETVAL=$? RETVAL=$?
;; ;;

View File

@ -117,6 +117,7 @@ BuildRequires: openssl-devel >= 0.9.7
%endif %endif
%if %{is_fc} %if %{is_fc}
BuildRequires: rpm-build >= 4.0 BuildRequires: rpm-build >= 4.0
Conflicts: tor-core, tor-lsb, tor-upstart
%endif %endif
Requires(pre): /usr/bin/id, /bin/date, /bin/sh Requires(pre): /usr/bin/id, /bin/date, /bin/sh
Requires(pre): %{_sbindir}/useradd, %{_sbindir}/groupadd Requires(pre): %{_sbindir}/useradd, %{_sbindir}/groupadd
@ -153,7 +154,7 @@ for high-stakes anonymity.
%build %build
%if %{is_suse} %if %{is_suse}
%configure --with-tor-user=%{toruser} --with-tor-group=%{torgroup} %configure --with-tor-user=%{toruser} --with-tor-group=%{torgroup} --docdir=%{_docdir}/%{name}
%else %else
%configure --with-tor-user=%{toruser} --with-tor-group=%{torgroup} %configure --with-tor-user=%{toruser} --with-tor-group=%{torgroup}
%endif %endif
@ -262,14 +263,20 @@ exit 0
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%if %{is_suse}
%doc INSTALL LICENSE README ChangeLog doc/HACKING doc/TODO doc/*html
%endif
%doc INSTALL LICENSE README ChangeLog doc/HACKING doc/TODO %doc INSTALL LICENSE README ChangeLog doc/HACKING doc/TODO
%{_mandir}/man*/* %{_mandir}/man*/*
%{_docdir}/tor/*
%{_bindir}/tor %{_bindir}/tor
%{_bindir}/torctl %{_bindir}/torctl
%{_bindir}/torify %{_bindir}/torify
%{_bindir}/tor-resolve %{_bindir}/tor-resolve
%{_bindir}/tor-gencert %{_bindir}/tor-gencert
%if %{is_suse}
%else
%{_docdir}/*
%endif
%{_datadir}/tor/geoip %{_datadir}/tor/geoip
%config %{_initrddir}/%{name} %config %{_initrddir}/%{name}
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/logrotate.d/%{name} %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/logrotate.d/%{name}
@ -280,6 +287,10 @@ exit 0
%attr(0750,%{toruser},%{torgroup}) %dir %{_localstatedir}/log/%{name} %attr(0750,%{toruser},%{torgroup}) %dir %{_localstatedir}/log/%{name}
%changelog %changelog
* Fri Aug 20 2010 Erinn Clark <erinn@torproject.org>
- add conflicts for Fedora packages
- add logic for SuSE since it requires special doc handling
* Mon Feb 22 2010 Erinn Clark <erinn@torproject.org> * Mon Feb 22 2010 Erinn Clark <erinn@torproject.org>
- remove AUTHORS from %doc line since it no longer exists upstream - remove AUTHORS from %doc line since it no longer exists upstream
- switch maintainers - switch maintainers