diff --git a/configure.in b/configure.in
index 6f414032c6..3c9341beec 100644
--- a/configure.in
+++ b/configure.in
@@ -484,7 +484,7 @@ CFLAGS="$CFLAGS -Wall -g -O2"
echo "confdir: $CONFDIR"
-AC_OUTPUT(Makefile tor.spec contrib/tor.sh contrib/torctl contrib/torify contrib/Makefile contrib/osx/Makefile contrib/osx/TorBundleDesc.plist contrib/osx/TorBundleInfo.plist contrib/osx/TorDesc.plist contrib/osx/TorInfo.plist src/config/torrc.sample doc/tor.1 src/Makefile doc/Makefile doc/design-paper/Makefile src/config/Makefile src/common/Makefile src/or/Makefile src/win32/Makefile src/tools/Makefile)
+AC_OUTPUT(Makefile tor.spec contrib/tor.sh contrib/torctl contrib/torify contrib/Makefile contrib/osx/Makefile contrib/osx/TorBundleDesc.plist contrib/osx/TorBundleInfo.plist contrib/osx/TorDesc.plist contrib/osx/TorInfo.plist contrib/osx/TorStartupDesc.plist src/config/torrc.sample doc/tor.1 src/Makefile doc/Makefile doc/design-paper/Makefile src/config/Makefile src/common/Makefile src/or/Makefile src/win32/Makefile src/tools/Makefile)
if test -x /usr/bin/perl && test -x ./contrib/updateVersions.pl ; then
./contrib/updateVersions.pl
diff --git a/contrib/osx/Makefile.am b/contrib/osx/Makefile.am
index 11380a04bb..447132ea3e 100644
--- a/contrib/osx/Makefile.am
+++ b/contrib/osx/Makefile.am
@@ -3,6 +3,6 @@ confdir = $(sysconfdir)/tor
EXTRA_DIST = PrivoxyConfDesc.plist PrivoxyConfInfo.plist \
ReadMe.rtf StartupParameters.plist Tor TorBundleDesc.plist.in \
TorBundleInfo.plist.in TorBundleWelcome.rtf TorDesc.plist.in \
- TorInfo.plist.in TorStartupDesc.plist TorStartupInfo.plist \
+ TorInfo.plist.in TorStartupDesc.plist.in TorStartupInfo.plist \
package.sh privoxy.config TorPostflight addsysuser
diff --git a/contrib/osx/TorPostflight b/contrib/osx/TorPostflight
index 36cc2a999f..0dd905110a 100644
--- a/contrib/osx/TorPostflight
+++ b/contrib/osx/TorPostflight
@@ -58,11 +58,10 @@ if [ ! -e /var/log/tor -o -L /var/log/tor ]; then
ln -sf $LOGDIR tor
fi
-if [ ! -d /Library/StartupItems/Tor ]; then
- mkdir -p /Library/StartupItems/Tor
+if [ -d /Library/StartupItems/Tor ]; then
+ rm -f /Library/StartupItems/Tor/Tor.loc
+ echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc
fi
-rm -f /Library/StartupItems/Tor/Tor.loc
-echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc
if [ -d /Library/StartupItems/Privoxy ]; then
find /Library/StartupItems/Privoxy -print0 | xargs -0 chown root:wheel
diff --git a/contrib/osx/TorStartupDesc.plist b/contrib/osx/TorStartupDesc.plist.in
similarity index 91%
rename from contrib/osx/TorStartupDesc.plist
rename to contrib/osx/TorStartupDesc.plist.in
index b94a12c38a..b0a48fafe0 100644
--- a/contrib/osx/TorStartupDesc.plist
+++ b/contrib/osx/TorStartupDesc.plist.in
@@ -5,6 +5,6 @@
IFPkgDescriptionTitle
Tor Startup Script
IFPkgDescriptionVersion
- 0.0.9.1
+ @VERSION@