summaryrefslogtreecommitdiff
path: root/pkg/osx/build_tuntaposx
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/osx/build_tuntaposx')
-rwxr-xr-xpkg/osx/build_tuntaposx45
1 files changed, 45 insertions, 0 deletions
diff --git a/pkg/osx/build_tuntaposx b/pkg/osx/build_tuntaposx
new file mode 100755
index 00000000..10bb7c9c
--- /dev/null
+++ b/pkg/osx/build_tuntaposx
@@ -0,0 +1,45 @@
+#!/bin/zsh
+#
+# Copyright (C) 2012 ...
+#
+
+REPO="https://github.com/bbits/tuntaposx.git"
+
+autoload colors; colors
+# standard output message routines
+# it's always useful to wrap them, in case we change behaviour later
+notice() { if [[ $QUIET == 0 ]]; then print "$fg_bold[green][*]$fg_no_bold[default] $1" >&2; fi }
+error() { if [[ $QUIET == 0 ]]; then print "$fg[red][!]$fg[default] $1" >&2; fi }
+func() { if [[ $DEBUG == 1 ]]; then print "$fg[blue][D]$fg[default] $1" >&2; fi }
+act() {
+ if [[ $QUIET == 0 ]]; then
+ if [ "$1" = "-n" ]; then
+ print -n "$fg_bold[white] . $fg_no_bold[default] $2" >&2;
+ else
+ print "$fg_bold[white] . $fg_no_bold[default] $1" >&2;
+ fi
+ fi
+}
+
+{ test "$1" = "clean" } && {
+ notice "Cleaning up all tuntaposx build"
+ rm -rf tuntaposx
+ act "Done."
+ return 0
+}
+
+build_tuntap() {
+ test -d tuntaposx || git clone $REPO
+ notice "Cloning tuntaposx sources"
+ cd tuntaposx/tuntap
+ notice "Building tuntaposx"
+ make
+ mkdir -p ../../dist/tun.kext
+ cp -r tun.kext/* ../../dist/tun.kext
+ mkdir -p ../../dist/tuntaposx/StartupItems
+ cp -r startup_item/tun ../../dist/tuntaposx/StartupItems
+ cd ../..
+}
+
+act "Building tuntap"
+build_tuntap