From 8c58635ea7b3c129e3454775df08608903878cd6 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 11 Dec 2013 16:31:00 -0800 Subject: [PATCH] Installer builder for mac. --- buildinstaller.sh | 8 +++++++- installer.cpp | 6 +++--- make-mac.mk | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/buildinstaller.sh b/buildinstaller.sh index 4022bce74..7eb2c243e 100755 --- a/buildinstaller.sh +++ b/buildinstaller.sh @@ -57,7 +57,6 @@ case "$system" in ./file2lz4c ext/installfiles/linux/init.d/zerotier-one linux__init_d__zerotier_one >installer-build/linux__init_d__zerotier_one.h g++ -Os -o "zt1-${vmajor}_${vminor}_${revision}-linux-${machine}-install" installer.cpp ext/lz4/lz4.o ext/lz4/lz4hc.o - ls -l zt1-*-install ;; @@ -65,6 +64,13 @@ case "$system" in Darwin) echo "Assembling OSX installer for x86/x64 (combined) and ZT1 version $vmajor.$vminor.$revision" + ./file2lz4c ext/installfiles/linux/uninstall.sh uninstall_sh >installer-build/uninstall_sh.h + ./file2lz4c ext/bin/tap-mac/tap.kext/Contents/Info.plist tap_mac__Info_plist >installer-build/tap_mac__Info_plist.h + ./file2lz4c ext/bin/tap-mac/tap.kext/Contents/MacOS/tap tap_mac__tap >installer-build/tap_mac__tap.h + + g++ -Os -arch i386 -o "zt1-${vmajor}_${vminor}_${revision}-mac-combined-install" installer.cpp ext/lz4/lz4.o ext/lz4/lz4hc.o + ls -l zt1-*-install + ;; *) diff --git a/installer.cpp b/installer.cpp index ac71396c0..90cc8c052 100644 --- a/installer.cpp +++ b/installer.cpp @@ -211,17 +211,17 @@ int main(int argc,char **argv) #ifdef __APPLE__ // Write tap.kext into home folder - sprintf(buf,"%s/tap.kext"); + sprintf(buf,"%s/tap.kext",zthome); mkdir(buf,0755); chmod(buf,0755); chown(buf,0,0); printf("mkdir %s\n",buf); - sprintf(buf,"%s/tap.kext/Contents"); + sprintf(buf,"%s/tap.kext/Contents",zthome); mkdir(buf,0755); chmod(buf,0755); chown(buf,0,0); printf("mkdir %s\n",buf); - sprintf(buf,"%s/tap.kext/Contents/MacOS"); + sprintf(buf,"%s/tap.kext/Contents/MacOS",zthome); mkdir(buf,0755); chmod(buf,0755); chown(buf,0,0); diff --git a/make-mac.mk b/make-mac.mk index 8658a9c1d..84b989947 100644 --- a/make-mac.mk +++ b/make-mac.mk @@ -43,6 +43,6 @@ file2lz4c: ext/lz4/lz4hc.o FORCE $(CXX) $(CXXFLAGS) -o file2lz4c file2lz4c.cpp node/Utils.cpp node/Salsa20.cpp ext/lz4/lz4hc.o clean: - rm -rf *.dSYM build-ZeroTierUI-* $(OBJS) file2lz4c zerotier-* installer-build + rm -rf *.dSYM build-ZeroTierUI-* $(OBJS) file2lz4c zerotier-* installer-build zt1-*-install FORCE: