[kismac] [binaervarianz] r109 - in KisMACng: . Sources/Support image

  • From: svn@xxxxxxxxxxxxxxxx
  • To: kismac@xxxxxxxxxxxxx
  • Date: Sat, 18 Mar 2006 14:03:39 +0100

Author: mick
Date: 2006-03-18 14:03:39 +0100 (Sat, 18 Mar 2006)
New Revision: 109

Added:
   KisMACng/image/
   KisMACng/image/KisMACraw.dmg
   KisMACng/image/WirelessDriver
Modified:
   KisMACng/Sources/Support/GPSController.m
   KisMACng/compile.command
Log:
- added robins patch for #65
- build system supports now the build of kismac images (./compile.command image)



Modified: KisMACng/Sources/Support/GPSController.m
===================================================================
--- KisMACng/Sources/Support/GPSController.m    2006-03-17 04:48:18 UTC (rev 
108)
+++ KisMACng/Sources/Support/GPSController.m    2006-03-18 13:03:39 UTC (rev 
109)
@@ -170,9 +170,9 @@
                else if (sectortime > 0) return [NSString 
stringWithFormat:@"Sector: %.1f %s (%.1f nm) in %d seconds (avg: %.1f 
%s)\nTotal: %.1f %s (%.1f nm)",(_sectordist * 
VELOCITY_CONVERSION),DISTANCE_UNIT,_sectordist,sectortime,(3600 * _sectordist * 
VELOCITY_CONVERSION)/_sectortime,VELOCITY_UNIT,(_totaldist * 
VELOCITY_CONVERSION),DISTANCE_UNIT,_totaldist];
                else return [NSString stringWithFormat:@"Total: %.1f %s (%.1f 
nm)",(_totaldist * VELOCITY_CONVERSION),DISTANCE_UNIT,_totaldist];
        } else {
-               if (sectortime > 3600) return [NSString 
stringWithFormat:@"Sector: %.1f %s (%.1f nm) in %d:%02d:%02d [ERROR: %ds] (avg: 
%.1f %s)\nTotal: %.1f %s (%.1f nm)",(_sectordist * 
VELOCITY_CONVERSION),DISTANCE_UNIT,_sectordist,(sectortime/3600),(sectortime%3600/60),(sectortime%60),sterror,(3600
 * _sectordist * VELOCITY_CONVERSION)/_sectortime,VELOCITY_UNIT,(_totaldist * 
VELOCITY_CONVERSION),DISTANCE_UNIT,_totaldist];
-               else if (sectortime > 60) return [NSString 
stringWithFormat:@"Sector: %.1f %s (%.1f nm) in %d:%02d [ERROR: %ds] (avg: %.1f 
%s)\nTotal: %.1f %s (%.1f nm)",(_sectordist * 
VELOCITY_CONVERSION),DISTANCE_UNIT,_sectordist,(sectortime/60),(sectortime%60),sterror,(3600
 * _sectordist * VELOCITY_CONVERSION)/_sectortime,VELOCITY_UNIT,(_totaldist * 
VELOCITY_CONVERSION),DISTANCE_UNIT,_totaldist];
-               else return [NSString stringWithFormat:@"Sector: %.1f %s (%.1f 
nm) in %d seconds [ERROR: %ds] (avg: %.1f %s)\nTotal: %.1f %s (%.1f 
nm)",(_sectordist * 
VELOCITY_CONVERSION),DISTANCE_UNIT,_sectordist,sectortime,sterror,(3600 * 
_sectordist * VELOCITY_CONVERSION)/_sectortime,VELOCITY_UNIT,(_totaldist * 
VELOCITY_CONVERSION),DISTANCE_UNIT,_totaldist];
+        if (sectortime > 3600) return [NSString stringWithFormat:@"Sector: 
%.1f %s (%.1f nm) in %d:%02d:%02d (avg: %.1f %s) [ERROR: %ds]\nTotal: %.1f %s 
(%.1f nm)",(_sectordist * 
VELOCITY_CONVERSION),DISTANCE_UNIT,_sectordist,(sectortime/3600),(sectortime%3600/60),(sectortime%60),(3600
 * _sectordist * 
VELOCITY_CONVERSION)/_sectortime,VELOCITY_UNIT,sterror,(_totaldist * 
VELOCITY_CONVERSION),DISTANCE_UNIT,_totaldist];
+        else if (sectortime > 60) return [NSString stringWithFormat:@"Sector: 
%.1f %s (%.1f nm) in %d:%02d (avg: %.1f %s) [ERROR: %ds]\nTotal: %.1f %s (%.1f 
nm)",(_sectordist * 
VELOCITY_CONVERSION),DISTANCE_UNIT,_sectordist,(sectortime/60),(sectortime%60),(3600
 * _sectordist * 
VELOCITY_CONVERSION)/_sectortime,VELOCITY_UNIT,sterror,(_totaldist * 
VELOCITY_CONVERSION),DISTANCE_UNIT,_totaldist];
+        else return [NSString stringWithFormat:@"Sector: %.1f %s (%.1f nm) in 
%d seconds (avg: %.1f %s) [ERROR: %ds]\nTotal: %.1f %s (%.1f nm)",(_sectordist 
* VELOCITY_CONVERSION),DISTANCE_UNIT,_sectordist,sectortime,(3600 * _sectordist 
* VELOCITY_CONVERSION)/_sectortime,VELOCITY_UNIT,sterror,(_totaldist * 
VELOCITY_CONVERSION),DISTANCE_UNIT,_totaldist];
        }
 }
 
@@ -489,7 +489,7 @@
 
     if (_debugEnabled) NSLog(@"GPSd write command");
     
-    if (write(fd, "PAMVTQ\r\n", 8) < 8) {
+    if (write(fd, "PMVTAQ\r\n", 8) < 8) {
         NSLog(@"GPSd write failed");
         return NO;
     }
@@ -507,12 +507,13 @@
     gpsbuf[0+len]=0;
        numsat = -1;
        hdop = 100;
-   
+       elev = 0;
+       
        date = [[NSDate alloc] init];
 
-       if (sscanf(gpsbuf, "GPSD,P=%lg %lg,A=%lg,M=%d,V=%f,T=%f,Q=%d %*f %f",
-        &ns, &ew, &elev, &valid, &velkt, &fveldir, &numsat, &hdop) >=6) {
-                        
+       if (sscanf(gpsbuf, "GPSD,P=%lg %lg,M=%d,V=%f,T=%f,A=%lg,Q=%d %*f %f",
+        &ns, &ew, &valid, &velkt, &fveldir, &elev, &numsat, &hdop) >=4) {
+                    
         if (valid >= 2) _reliable = YES;
         else _reliable = NO;
         
@@ -576,7 +577,7 @@
         }
 
     } else {
-        NSLog(@"GPSd parsing failure");
+        NSLog(@"GPSd parsing failure - received: %s",gpsbuf);
     }
     
     [date release];

Modified: KisMACng/compile.command
===================================================================
--- KisMACng/compile.command    2006-03-17 04:48:18 UTC (rev 108)
+++ KisMACng/compile.command    2006-03-18 13:03:39 UTC (rev 109)
@@ -1,38 +1,87 @@
 #!/bin/bash
 
-configuration=Deployment
+if [ "x$1" == "x--help" ]; then
+  echo "Usage ./compile.command [Universal|Development|Deployment] [image]"
+  exit 0
+fi
 
-echo "Checking for required enviroment..."
+case $1 in
+  "Universal")
+    configuration=Universal;;
+  "Development")
+    configuration=Development;;
+  "Deployment" | "" | "image")
+    configuration=Deployment;;
+  *)
+    echo "Usage ./compile.command [Universal|Development|Deployment] [image]"
+    exit 1
+esac
+
+echo "Building for configuration... $configuration"
+
+echo -n "Building install image... "
+if [ "x$1" == "ximage" ] || [ "x$2" == "ximage" ]; then
+  echo "YES"
+  BUILD_IMAGE=1
+else
+  echo "NO"
+       BUILD_IMAGE=0
+fi
+
+echo -n "Checking for required enviroment... "
 if ! [ -x /usr/bin/tar ]; then
        echo "/usr/bin/tar not found! Make sure you installed the BSD 
subsystem!"
        exit 1
 fi
 
+if ! [ -x /usr/bin/xcodebuild ]; then
+       echo "Could not find a valid XCode version!"
+       exit 1
+fi
+
+XCODEVERSION=`xcodebuild -version  | sed s/.*DevToolsCore-// | sed  s/..\;.*//`
+if [ $XCODEVERSION \< 658 ]; then
+  echo "XCode Version is too old!"
+  exit 1
+fi
+
 if echo $0 | grep " " > /dev/null; then
        echo "KisMAC source path contains a space character. This will lead to 
problems!"
        exit 1
 fi
 
-cd "`dirname "$0"`"
+echo "ok"
 
-echo "Decompressing UnitTest bundle..."
+echo -n "Decompressing UnitTest bundle... "
 mkdir "./build/KisMACUnitTest.bundle/Contents/Frameworks" 2>/dev/null
 cd UnitTest
 ln -s "../build/KisMACUnitTest.bundle/Contents/Frameworks" . 2>/dev/null
 tar -xjf UnitKit.tbz 2>/dev/null
+if ! [ -d UnitKit.framework ]; then
+  echo "*FAILED*"
+  exit 1
+fi
+echo "ok"
 cd ..
 
-echo "Decompressing Growl framework..."
+echo -n "Decompressing Growl framework... "
 cd Resources
 tar -xzf growl.tgz
+if ! [ -d Growl.framework ]; then
+  echo "*FAILED*"
+  exit 1
+fi
+echo "ok"
+
 cd ..
 
-echo "Determine Subversion Revision..."
-val=`svnversion -n .`
-sed -e "s/\\\$Revision.*\\\$/\\\$Revision: $val\\\$/" 
Resources/Info.plist.templ > Resources/Info.plist
-sed -e "s/\\\$Revision.*\\\$/\\\$Revision: $val\\\$/" 
Resources/Strings/English.lproj/InfoPlist.strings.templ > 
Resources/Strings/English.lproj/InfoPlist.strings
+echo -n "Determine Subversion Revision... "
+SVNVERS=`svnversion -n .`
+echo $SVNVERS
+sed -e "s/\\\$Revision.*\\\$/\\\$Revision: $SVNVERS\\\$/" 
Resources/Info.plist.templ > Resources/Info.plist
+sed -e "s/\\\$Revision.*\\\$/\\\$Revision: $SVNVERS\\\$/" 
Resources/Strings/English.lproj/InfoPlist.strings.templ > 
Resources/Strings/English.lproj/InfoPlist.strings
 
-echo "Preparing Enviroment..."
+echo -n "Preparing Enviroment... "
 if [ -f compile.log ]; then
   rm compile.log
 fi
@@ -43,6 +92,8 @@
 rm -rf *.framework 2>/dev/null
 cd ..
 
+echo "ok"
+
 echo -n "Building MACJack driver... "
 cd MACJack
 if ! xcodebuild -configuration $configuration >> ../../compile.log; then
@@ -112,6 +163,57 @@
 if ! xcodebuild -target KisMAC -configuration $configuration >> compile.log; 
then
         exit 1
 else
-        echo "ok"
+         echo "ok"
 fi
 
+if [ $BUILD_IMAGE == 1 ]; then
+  echo -n "Generating KisMAC Disk Image..."
+  
+  if [ -f /Volumes/KisMAC ]; then
+       if hdiutil unmount /Volumes/KisMAC 2>/dev/null; then
+        echo "*FAILED* Could not unmount loaded KisMAC Volume."
+        exit 1
+      fi
+      sleep 10
+  fi
+  
+       cp image/KisMACraw.dmg image/KisMAC.dmg
+       hdiutil attach image/KisMAC.dmg > /dev/null
+       
+       sleep 1
+       
+       if ! [ -d /Volumes/KisMAC ]; then
+    echo " *FAILED* Could not mount KisMAC Volume."
+    exit 1
+  fi 
+  
+       cp -r "Subprojects/KisMACInstaller/build/$configuration/KisMAC 
Installer.app/Contents" "/Volumes/KisMAC/KisMAC Installer.app"
+  cp "image/WirelessDriver" "/Volumes/KisMAC/KisMAC 
Installer.app/Contents/Resources"
+  
+  cp -r build/$configuration/KisMAC.app image
+  cd "image/KisMAC.app"
+       rm `find . -type f -name .DS_Store` 2>/dev/null
+       rm -rf `find . -name .svn`
+       tar -czf "/Volumes/KisMAC/KisMAC 
Installer.app/Contents/Resources/KisMAC.tgz" *>/dev/null
+       cd ..
+       rm -rf KisMAC.app
+       cd ..
+       
+       rm `find "/Volumes/KisMAC/KisMAC Installer.app" -type f -name 
.DS_Store` 2>/dev/null
+       rm -rf `find "/Volumes/KisMAC/KisMAC Installer.app" -name .svn`
+
+  while [ -d  /Volumes/KisMAC ]; do
+    hdiutil detach /Volumes/KisMAC >/dev/null
+    sleep 1
+    echo -n .
+  done
+  
+       #trim dumb characters from SVN version
+       SVNVERS=`echo $SVNVERS | sed 's/.*://g'`
+  SVNVERS=`echo $SVNVERS | sed 's/\]//g'`
+  
+       zip -9 KisMACR$SVNVERS.zip image/KisMAC.dmg >/dev/null
+       
+       rm image/KisMAC.dmg
+       echo "ok"
+fi

Added: KisMACng/image/KisMACraw.dmg
===================================================================
(Binary files differ)


Property changes on: KisMACng/image/KisMACraw.dmg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: KisMACng/image/WirelessDriver
===================================================================
(Binary files differ)


Property changes on: KisMACng/image/WirelessDriver
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream


Other related posts:

  • » [kismac] [binaervarianz] r109 - in KisMACng: . Sources/Support image