DISTDIRS:=debian
DISTFILES:=BUGS COPYING CREDITS INSTALL LICENSE.txt Makefile.in \
NEWS NOTES README TODO \
+ setup.mac uk.org.greenend.secnet.plist README.mac \
ac_prog_cc_no_writeable_strings.m4 \
conffile.c conffile.fl conffile.h conffile.y \
conffile_internal.h \
--- /dev/null
+How to install secnet on a Fink-equipped OS X system:
+ - Install GMP:
+ fink install gmp
+ - Download and install ADNS:
+ ./configure --disable-dynamic
+ make
+ sudo make install
+ - Build secnet:
+ ./configure CPPFLAGS=-I/sw/include LDFLAGS=-L/sw/lib
+ make
+ sudo make install
+ - Install tuntap for OSX from http://tuntaposx.sourceforge.net/
+ - Create /etc/secnet/{key,secnet.conf,sites.conf} as usual
+ - If you don't want secnet 'always on', edit
+ uk.org.greenend.secnet.plist and remove *both* these two lines:
+ <key>RunAtLoad</key>
+ <true/>
+ - Create the 'secnet' user and install the job configuration:
+ ./setup.mac.
+
+To start secnet:
+ sudo launchctl start uk.org.greenend.secnet
+
+To stop secnet:
+ sudo launchctl stop uk.org.greenend.secnet
+
+To uninstall:
+ sudo launchctl unload uk.org.greenend.secnet
+ sudo rm -f /Library/LaunchDaemons/uk.org.greenend.secnet.plist
+
+Richard Kettlewell 2011-06-18
--- /dev/null
+#!/bin/bash
+#
+# Richard Kettlewell 2011-06-18
+#
+set -e
+
+group=${group:-secnet}
+user=${user:-secnet}
+
+# pick ID1 ID2 ... IDn
+# Echoes an ID matching none of ID1..IDn
+pick() {
+ local n
+ n=250 # better not choose 0!
+ while :; do
+ ok=true
+ for k in "$@"; do
+ if [ $n = $k ]; then
+ ok=false
+ break
+ fi
+ done
+ if $ok; then
+ echo $n
+ return
+ fi
+ n=$((1+$n))
+ done
+}
+
+if dscl . -read /Groups/$group >/dev/null 2>&1; then
+ :
+else
+ gids=$(dscl . -list /Groups PrimaryGroupID|awk '{print $2}')
+ gid=$(pick $gids)
+ dscl . -create /Groups/$group
+ dscl . -create /Groups/$group PrimaryGroupID $gid
+ dscl . -create /Groups/$group Password \*
+fi
+
+if dscl . -read /Users/$user >/dev/null 2>&1; then
+ :
+else
+ uids=$(dscl . -list /Users UniqueID|awk '{print $2}')
+ uid=$(pick $uids)
+ gid=$(dscl . -read /Groups/$group PrimaryGroupID | awk '{print $2}')
+ dscl . -create /Users/$user
+ dscl . -create /Users/$user UniqueID $uid
+ dscl . -create /Users/$user UserShell /usr/bin/false
+ dscl . -create /Users/$user RealName 'secnet'
+ dscl . -create /Users/$user NFSHomeDirectory pkgstatedir
+ dscl . -create /Users/$user PrimaryGroupID $gid
+ dscl . -create /Users/$user Password \*
+fi
+
+cp uk.org.greenend.secnet.plist /Library/LaunchDaemons/.
+launchctl load /Library/LaunchDaemons
+echo "To start secnet:"
+echo " sudo launchctl start uk.org.greenend.secnet"
+echo
+echo "To stop secnet:"
+echo " sudo launchctl stop uk.org.greenend.secnet"
+echo
+echo "To uninstall:"
+echo " sudo launchctl unload uk.org.greenend.secnet"
+echo " sudo rm -f /Library/LaunchDaemons/uk.org.greenend.secnet.plist"
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>EnvironmentVariables</key>
+ <dict>
+ <key>LANG</key>
+ <string>en_GB.UTF-8</string>
+ <key>LC_ALL</key>
+ <string>en_GB.UTF-8</string>
+ </dict>
+ <key>Label</key>
+ <string>uk.org.greenend.secnet</string>
+ <key>ProgramArguments</key>
+ <array>
+ <string>/usr/local/sbin/secnet</string>
+ <string>-n</string>
+ </array>
+ <key>WorkingDirectory</key>
+ <string>/</string>
+ <key>RunAtLoad</key>
+ <true/>
+</dict>
+</plist>