Check in the OS X packaging patch from bug 2341, since I've had
authorGerald Combs <gerald@wireshark.org>
Sat, 15 Mar 2008 18:31:52 +0000 (18:31 -0000)
committerGerald Combs <gerald@wireshark.org>
Sat, 15 Mar 2008 18:31:52 +0000 (18:31 -0000)
confirmation that the OS X package works on at least one system
other than my laptop.

svn path=/trunk/; revision=24640

66 files changed:
Makefile.am
configure.in
epan/filesystem.c
packaging/macosx/ChmodBPF/ChmodBPF [new file with mode: 0755]
packaging/macosx/ChmodBPF/README.macosx [new file with mode: 0644]
packaging/macosx/ChmodBPF/StartupParameters.plist [new file with mode: 0644]
packaging/macosx/Info.plist.in [new file with mode: 0644]
packaging/macosx/Read me first.rtf [new file with mode: 0644]
packaging/macosx/Resources/MenuBar.nib/classes.nib [new file with mode: 0644]
packaging/macosx/Resources/MenuBar.nib/info.nib [new file with mode: 0644]
packaging/macosx/Resources/MenuBar.nib/objects.xib [new file with mode: 0644]
packaging/macosx/Resources/ProgressWindow.nib/classes.nib [new file with mode: 0644]
packaging/macosx/Resources/ProgressWindow.nib/info.nib [new file with mode: 0644]
packaging/macosx/Resources/ProgressWindow.nib/objects.xib [new file with mode: 0644]
packaging/macosx/Resources/Wireshark.icns [new file with mode: 0644]
packaging/macosx/Resources/bin/getdisplay.sh [new file with mode: 0755]
packaging/macosx/Resources/bin/wireshark [new file with mode: 0755]
packaging/macosx/Resources/etc/fonts/fonts.conf [new file with mode: 0644]
packaging/macosx/Resources/openDoc [new file with mode: 0755]
packaging/macosx/Resources/script [new file with mode: 0755]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/stepper-down.png [new file with mode: 0644]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/stepper-left.png [new file with mode: 0644]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/stepper-right.png [new file with mode: 0644]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/stepper-up.png [new file with mode: 0644]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/trough-scrollbar-horiz.png [new file with mode: 0644]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/trough-scrollbar-vert.png [new file with mode: 0644]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/copy-slider.sh [new file with mode: 0755]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/slider-horiz-prelight.png [new file with mode: 0644]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/slider-horiz.png [new file with mode: 0644]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/slider-vert-prelight.png [new file with mode: 0644]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/slider-vert.png [new file with mode: 0644]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/copy-slider.sh [new file with mode: 0755]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/slider-horiz-prelight.png [new file with mode: 0644]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/slider-horiz.png [new file with mode: 0644]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/slider-vert-prelight.png [new file with mode: 0644]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/slider-vert.png [new file with mode: 0644]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/gtkrc [new file with mode: 0644]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/pre_gtkrc [new file with mode: 0644]
packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/sync_osx_look.sh [new file with mode: 0755]
packaging/macosx/Resources/wsicondoc.icns [new file with mode: 0644]
packaging/macosx/ScriptExec/English.lproj/InfoPlist.strings [new file with mode: 0644]
packaging/macosx/ScriptExec/English.lproj/main.nib/classes.nib [new file with mode: 0644]
packaging/macosx/ScriptExec/English.lproj/main.nib/info.nib [new file with mode: 0644]
packaging/macosx/ScriptExec/English.lproj/main.nib/objects.xib [new file with mode: 0644]
packaging/macosx/ScriptExec/Info.plist [new file with mode: 0644]
packaging/macosx/ScriptExec/MenuBar.nib/classes.nib [new file with mode: 0644]
packaging/macosx/ScriptExec/MenuBar.nib/info.nib [new file with mode: 0644]
packaging/macosx/ScriptExec/MenuBar.nib/objects.xib [new file with mode: 0644]
packaging/macosx/ScriptExec/ScriptExec.xcode/project.pbxproj [new file with mode: 0644]
packaging/macosx/ScriptExec/ScriptExec.xcodeproj/project.pbxproj [new file with mode: 0644]
packaging/macosx/ScriptExec/ScriptExec_Prefix.pch [new file with mode: 0644]
packaging/macosx/ScriptExec/main.c [new file with mode: 0644]
packaging/macosx/ScriptExec/openDoc [new file with mode: 0755]
packaging/macosx/ScriptExec/script [new file with mode: 0755]
packaging/macosx/ScriptExec/version.plist [new file with mode: 0644]
packaging/macosx/dmg_background.png [new file with mode: 0644]
packaging/macosx/dmg_background.svg [new file with mode: 0644]
packaging/macosx/dmg_set_style.scpt [new file with mode: 0755]
packaging/macosx/native-gtk/build-gtk.sh [new file with mode: 0755]
packaging/macosx/native-gtk/config.h [new file with mode: 0644]
packaging/macosx/native-gtk/glibconfig.h [new file with mode: 0644]
packaging/macosx/osx-app.sh [new file with mode: 0755]
packaging/macosx/osx-build.sh [new file with mode: 0755]
packaging/macosx/osx-dmg.sh [new file with mode: 0755]
packaging/macosx/utility-launcher [new file with mode: 0755]
packaging/macosx/wireshark.ds_store [new file with mode: 0644]

index f4097da423f377ad09f6819c3fa7630b10397a11..a2aae2902a52af7e7d642adc6e4e7f3783ad7076 100644 (file)
@@ -893,13 +893,15 @@ rawshark.html: doc/rawshark.pod ws.css
 libtool: $(LIBTOOL_DEPS)
        $(SHELL) ./config.status --recheck
 
 libtool: $(LIBTOOL_DEPS)
        $(SHELL) ./config.status --recheck
 
+# Used by svr4-package and osx-package
 # We load top_stagedir with an explicit path so that libtool doesn't freak.
 # We load top_stagedir with an explicit path so that libtool doesn't freak.
-top_stagedir=`cd $(top_srcdir) && pwd`/packaging/svr4.stage
-stagedir=$(top_stagedir)/$(PACKAGE).stage
+top_stagedir=`cd $(top_srcdir) && pwd`/packaging/staging
+stagedir=$(top_stagedir)/$(PACKAGE).inst
+
 host_cpu=@host_cpu@
 host_os=@host_os@
 
 host_cpu=@host_cpu@
 host_os=@host_os@
 
-svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
+svr4-package: $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA)
        @if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
                rm -rf $(stagedir) ; \
                $(MAKE) DESTDIR=$(stagedir) install; \
        @if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \
                rm -rf $(stagedir) ; \
                $(MAKE) DESTDIR=$(stagedir) install; \
@@ -946,7 +948,25 @@ srpm-package: dist
        fi
 
 debian-package: debian/rules
        fi
 
 debian-package: debian/rules
-       dpkg-buildpackage -rfakeroot -us -uc
+       @if test x$(HAVE_DPKG_BUILDPAKCAGE) = xyes ; then \
+               dpkg-buildpackage -rfakeroot -us -uc ; \
+       else \
+               echo "Error: Debian packaging tools not found." ; \
+               echo "Package build abandoned." ; \
+       fi
+
+# XXX - This assumes we're building from the source directory.
+osx-package: $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) packaging/macosx/Info.plist
+       @if test x$(HAVE_OSX_PACKAGING) = xyes ; then \
+               rm -rf $(stagedir) ; \
+               $(MAKE) DESTDIR=$(stagedir) install; \
+               cd $(srcdir)/packaging/macosx ;  \
+               ./osx-app.sh -bp ../staging/$(PACKAGE).inst/$(bindir) ; \
+               ./osx-dmg.sh ; \
+       else \
+               echo "Error: OS X packaging tools not found." ; \
+               echo "Package build abandoned." ; \
+       fi
 
 clean-local:
        rm -rf $(top_stagedir)
 
 clean-local:
        rm -rf $(top_stagedir)
index de8e5f82c1569440ab7b789da8d26cbdf68fbb38..3b5c19ac0db4f58b426203753891530db4c88993 100644 (file)
@@ -166,6 +166,8 @@ AM_CONDITIONAL(HAVE_HHC, test x$HAVE_HHC = xyes)
 # Check for packaging utilities
 # For now, we check to see if the various packaging utilites are in our
 # path.  I'm too lazy to write code to go hunt for them.  -  Gerald
 # Check for packaging utilities
 # For now, we check to see if the various packaging utilites are in our
 # path.  I'm too lazy to write code to go hunt for them.  -  Gerald
+
+# SVR4/Solaris
 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
@@ -178,9 +180,26 @@ else
 fi
 AC_SUBST(HAVE_SVR4_PACKAGING)
 
 fi
 AC_SUBST(HAVE_SVR4_PACKAGING)
 
+# RPM
 AC_WIRESHARK_RPM_CHECK
 AC_SUBST(HAVE_RPM)
 
 AC_WIRESHARK_RPM_CHECK
 AC_SUBST(HAVE_RPM)
 
+# Debian
+AC_CHECK_PROG(HAVE_DPKG_BUILDPACKAGE, dpkg-buildpackage, "yes", "no")
+
+# Mac OS X
+AC_CHECK_PROG(HAVE_XCODEBUILD, xcodebuild, "yes", "no")
+AC_CHECK_PROG(HAVE_HDIUTIL, hdiutil, "yes", "no")
+AC_CHECK_PROG(HAVE_BLESS, bless, "yes", "no")
+
+if test x$HAVE_XCODEBUILD = xyes -a x$HAVE_HDIUTIL = xyes \
+     -a x$HAVE_BLESS = xyes ; then
+  HAVE_OSX_PACKAGING=yes
+else
+  HAVE_OSX_PACKAGING=no
+fi
+AC_SUBST(HAVE_OSX_PACKAGING)
+
 #
 # Try to add some additional gcc checks to CFLAGS
 #
 #
 # Try to add some additional gcc checks to CFLAGS
 #
@@ -1668,6 +1687,7 @@ AC_OUTPUT(
   gtk/doxygen.cfg
   help/Makefile
   packaging/Makefile
   gtk/doxygen.cfg
   help/Makefile
   packaging/Makefile
+  packaging/macosx/Info.plist
   packaging/nsis/Makefile
   packaging/rpm/Makefile
   packaging/rpm/SPECS/Makefile
   packaging/nsis/Makefile
   packaging/rpm/Makefile
   packaging/rpm/SPECS/Makefile
index 43f2f62f5ed5443f60c35aa386b18f415f0d57b1..6a88da0cdd04af2ac671d9b8722b47e38fd0886f 100644 (file)
@@ -224,7 +224,8 @@ test_for_fifo(const char *path)
 static char *progfile_dir;
 
 /*
 static char *progfile_dir;
 
 /*
- * TRUE if we're running from the build directory.
+ * TRUE if we're running from the build directory and we aren't running
+ * with special privileges.
  */
 static gboolean running_in_build_directory_flag = FALSE;
 
  */
 static gboolean running_in_build_directory_flag = FALSE;
 
@@ -611,10 +612,19 @@ get_datafile_dir(void)
                datafile_dir = progfile_dir;
        } else {
                /*
                datafile_dir = progfile_dir;
        } else {
                /*
-                * Return the directory specified when the build
-                * was configured.
+                * Return the directory specified when the build was
+                * configured, prepending the run path prefix if it exists.
                 */
                 */
-               datafile_dir = DATAFILE_DIR;
+               if (getenv("WIRESHARK_DATA_DIR") && !started_with_special_privs()) {
+                       /*
+                        * The user specified a different directory for data files
+                        * and we aren't running with special privileges.
+                        * XXX - We might be able to dispense with the priv check
+                        */
+                       datafile_dir = g_strdup(getenv("WIRESHARK_DATA_DIR"));
+               } else {
+                       datafile_dir = DATAFILE_DIR;
+               }
        }
 
 #endif
        }
 
 #endif
@@ -687,8 +697,17 @@ init_plugin_dir(void)
                 * (the datafile directory is the build directory).
                 */
                plugin_dir = g_strdup_printf("%s/plugins", get_datafile_dir());
                 * (the datafile directory is the build directory).
                 */
                plugin_dir = g_strdup_printf("%s/plugins", get_datafile_dir());
-       } else
-               plugin_dir = PLUGIN_DIR;
+       } else {
+               if (getenv("WIRESHARK_PLUGIN_DIR") && !started_with_special_privs()) {
+                       /*
+                        * The user specified a different directory for plugins
+                        * and we aren't running with special privileges.
+                        */
+                       plugin_dir = g_strdup(getenv("WIRESHARK_PLUGIN_DIR"));
+               } else {
+                       plugin_dir = PLUGIN_DIR;
+               }
+       }
 #endif
 }
 #endif /* HAVE_PLUGINS */
 #endif
 }
 #endif /* HAVE_PLUGINS */
@@ -703,7 +722,7 @@ get_plugin_dir(void)
        if (!plugin_dir) init_plugin_dir();
        return plugin_dir;
 #else
        if (!plugin_dir) init_plugin_dir();
        return plugin_dir;
 #else
-        return NULL;
+       return NULL;
 #endif
 }
 
 #endif
 }
 
@@ -1002,20 +1021,20 @@ int
 rename_persconffile_profile(const char *fromname, const char *toname,
                            char **pf_from_dir_path_return, char **pf_to_dir_path_return)
 {
 rename_persconffile_profile(const char *fromname, const char *toname,
                            char **pf_from_dir_path_return, char **pf_to_dir_path_return)
 {
-  char *from_dir = g_strdup (get_persconffile_dir(fromname));
-  char *to_dir = g_strdup (get_persconffile_dir(toname));
-  int ret = 0;
+       char *from_dir = g_strdup (get_persconffile_dir(fromname));
+       char *to_dir = g_strdup (get_persconffile_dir(toname));
+       int ret = 0;
 
 
-  ret = eth_rename (from_dir, to_dir);
-  if (ret != 0) {
-    *pf_from_dir_path_return = g_strdup (from_dir);
-    *pf_to_dir_path_return = g_strdup (to_dir);
-  }
+       ret = eth_rename (from_dir, to_dir);
+       if (ret != 0) {
+               *pf_from_dir_path_return = g_strdup (from_dir);
+               *pf_to_dir_path_return = g_strdup (to_dir);
+       }
 
 
-  g_free (from_dir);
-  g_free (to_dir);
+       g_free (from_dir);
+       g_free (to_dir);
 
 
-  return ret;
+       return ret;
 }
 
 /*
 }
 
 /*
@@ -1117,8 +1136,8 @@ extern char *
 get_persdatafile_dir(void)
 {
 #ifdef _WIN32
 get_persdatafile_dir(void)
 {
 #ifdef _WIN32
-    char *u3devicedocumentpath;
-    TCHAR tszPath[MAX_PATH];
+       char *u3devicedocumentpath;
+       TCHAR tszPath[MAX_PATH];
        char *szPath;
        BOOL bRet;
 
        char *szPath;
        BOOL bRet;
 
@@ -1135,14 +1154,14 @@ get_persdatafile_dir(void)
        if (u3devicedocumentpath != NULL) {
 
          /* the "My Captures" sub-directory is created (if it doesn't exist)
        if (u3devicedocumentpath != NULL) {
 
          /* the "My Captures" sub-directory is created (if it doesn't exist)
-            by u3util.exe when the U3 Wireshark is first run */
+                by u3util.exe when the U3 Wireshark is first run */
 
          szPath = g_strdup_printf("%s%s", u3devicedocumentpath, U3_MY_CAPTURES);
 
          persdatafile_dir = szPath;
          return szPath;
 
 
          szPath = g_strdup_printf("%s%s", u3devicedocumentpath, U3_MY_CAPTURES);
 
          persdatafile_dir = szPath;
          return szPath;
 
-        } else {
+               } else {
        /* Hint: SHGetFolderPath is not available on MSVC 6 - without Platform SDK */
        bRet = SHGetSpecialFolderPath(NULL, tszPath, CSIDL_PERSONAL, FALSE);
        if(bRet == TRUE) {
        /* Hint: SHGetFolderPath is not available on MSVC 6 - without Platform SDK */
        bRet = SHGetSpecialFolderPath(NULL, tszPath, CSIDL_PERSONAL, FALSE);
        if(bRet == TRUE) {
@@ -1152,7 +1171,7 @@ get_persdatafile_dir(void)
        } else {
                return "";
        }
        } else {
                return "";
        }
- }
+}
 #else
   return "";
 #endif
 #else
   return "";
 #endif
@@ -1279,55 +1298,55 @@ get_persconffile_path(const char *filename, gboolean from_profile, gboolean for_
 int
 filesystem_opt(int opt _U_, const char *optarg)
 {
 int
 filesystem_opt(int opt _U_, const char *optarg)
 {
-  gchar *p, *colonp;
-
-  colonp = strchr(optarg, ':');
-  if (colonp == NULL) {
-    return 1;
-  }
-
-  p = colonp;
-  *p++ = '\0';
-
-  /*
-   * Skip over any white space (there probably won't be any, but
-   * as we allow it in the preferences file, we might as well
-   * allow it here).
-   */
-  while (isspace((guchar)*p))
-    p++;
-  if (*p == '\0') {
-    /*
-     * Put the colon back, so if our caller uses, in an
-     * error message, the string they passed us, the message
-     * looks correct.
-     */
-    *colonp = ':';
-    return 1;
-  }
-
-  /* directory should be existing */
-  /* XXX - is this a requirement? */
-  if(test_for_directory(p) != EISDIR) {
-    /*
-     * Put the colon back, so if our caller uses, in an
-     * error message, the string they passed us, the message
-     * looks correct.
-     */
-    *colonp = ':';
-    return 1;
-  }
-
-  if (strcmp(optarg,"persconf") == 0) {
-    persconffile_dir = p;
-  } else if (strcmp(optarg,"persdata") == 0) {
-    persdatafile_dir = p;
-  /* XXX - might need to add the temp file path */
-  } else {
-    return 1;
-  }
-  *colonp = ':'; /* put the colon back */
-  return 0;
+       gchar *p, *colonp;
+
+       colonp = strchr(optarg, ':');
+       if (colonp == NULL) {
+               return 1;
+       }
+
+       p = colonp;
+       *p++ = '\0';
+
+       /*
+       * Skip over any white space (there probably won't be any, but
+       * as we allow it in the preferences file, we might as well
+       * allow it here).
+       */
+       while (isspace((guchar)*p))
+       p++;
+       if (*p == '\0') {
+               /*
+                * Put the colon back, so if our caller uses, in an
+                * error message, the string they passed us, the message
+                * looks correct.
+                */
+               *colonp = ':';
+               return 1;
+       }
+
+       /* directory should be existing */
+       /* XXX - is this a requirement? */
+       if(test_for_directory(p) != EISDIR) {
+               /*
+                * Put the colon back, so if our caller uses, in an
+                * error message, the string they passed us, the message
+                * looks correct.
+                */
+               *colonp = ':';
+               return 1;
+       }
+
+       if (strcmp(optarg,"persconf") == 0) {
+               persconffile_dir = p;
+       } else if (strcmp(optarg,"persdata") == 0) {
+               persdatafile_dir = p;
+               /* XXX - might need to add the temp file path */
+       } else {
+               return 1;
+       }
+       *colonp = ':'; /* put the colon back */
+       return 0;
 }
 
 /*
 }
 
 /*
@@ -1342,7 +1361,7 @@ get_datafile_path(const char *filename)
 {
 
        return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_datafile_dir(),
 {
 
        return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_datafile_dir(),
-           filename);
+               filename);
 }
 
 /* Delete a file */
 }
 
 /* Delete a file */
@@ -1358,7 +1377,6 @@ deletefile(const char *path)
  */
 char *get_tempfile_path(const char *filename)
 {
  */
 char *get_tempfile_path(const char *filename)
 {
-
        return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", g_get_tmp_dir(), filename);
 }
 
        return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", g_get_tmp_dir(), filename);
 }
 
@@ -1453,31 +1471,29 @@ file_write_error_message(int err)
 gboolean
 file_exists(const char *fname)
 {
 gboolean
 file_exists(const char *fname)
 {
-  struct stat   file_stat;
-
+       struct stat   file_stat;
 
 #ifdef _WIN32
 
 #ifdef _WIN32
-  /*
-   * This is a bit tricky on win32. The st_ino field is documented as:
-   * "The inode, and therefore st_ino, has no meaning in the FAT, ..."
-   * but it *is* set to zero if stat() returns without an error,
-   * so this is working, but maybe not quite the way expected. ULFL
-   */
-   file_stat.st_ino = 1;   /* this will make things work if an error occured */
-   eth_stat(fname, &file_stat);
-   if (file_stat.st_ino == 0) {
-       return TRUE;
-   } else {
-       return FALSE;
-   }
+       /*
+        * This is a bit tricky on win32. The st_ino field is documented as:
+        * "The inode, and therefore st_ino, has no meaning in the FAT, ..."
+        * but it *is* set to zero if stat() returns without an error,
+        * so this is working, but maybe not quite the way expected. ULFL
+        */
+       file_stat.st_ino = 1;   /* this will make things work if an error occured */
+       eth_stat(fname, &file_stat);
+       if (file_stat.st_ino == 0) {
+               return TRUE;
+       } else {
+               return FALSE;
+       }
 #else
 #else
-   if (eth_stat(fname, &file_stat) != 0 && errno == ENOENT) {
-       return FALSE;
-   } else {
-       return TRUE;
-   }
+       if (eth_stat(fname, &file_stat) != 0 && errno == ENOENT) {
+               return FALSE;
+       } else {
+               return TRUE;
+       }
 #endif
 #endif
-
 }
 
 /*
 }
 
 /*
@@ -1490,49 +1506,62 @@ file_exists(const char *fname)
 gboolean
 files_identical(const char *fname1, const char *fname2)
 {
 gboolean
 files_identical(const char *fname1, const char *fname2)
 {
-    /* Two different implementations, because:
-     *
-     * - _fullpath is not available on UN*X, so we can't get full
-     *   paths and compare them (which wouldn't work with hard links
-     *   in any case);
-     *
-     * - st_ino isn't filled in with a meaningful value on Windows.
-     */
+       /* Two different implementations, because:
+        *
+        * - _fullpath is not available on UN*X, so we can't get full
+        *   paths and compare them (which wouldn't work with hard links
+        *   in any case);
+        *
+        * - st_ino isn't filled in with a meaningful value on Windows.
+        */
 #ifdef _WIN32
 #ifdef _WIN32
-    char full1[MAX_PATH], full2[MAX_PATH];
-
-    /*
-     * Get the absolute full paths of the file and compare them.
-     * That won't work if you have hard links, but those aren't
-     * much used on Windows, even though NTFS supports them.
-     *
-     * XXX - will _fullpath work with UNC?
-     */
-    if( _fullpath( full1, fname1, MAX_PATH ) == NULL ) {
-        return FALSE;
-    }
-
-    if( _fullpath( full2, fname2, MAX_PATH ) == NULL ) {
-        return FALSE;
-    }
-
-    if(strcmp(full1, full2) == 0) {
-        return TRUE;
-    } else {
-        return FALSE;
-    }
+       char full1[MAX_PATH], full2[MAX_PATH];
+
+       /*
+        * Get the absolute full paths of the file and compare them.
+        * That won't work if you have hard links, but those aren't
+        * much used on Windows, even though NTFS supports them.
+        *
+        * XXX - will _fullpath work with UNC?
+        */
+       if( _fullpath( full1, fname1, MAX_PATH ) == NULL ) {
+               return FALSE;
+       }
+
+       if( _fullpath( full2, fname2, MAX_PATH ) == NULL ) {
+               return FALSE;
+       }
+
+       if(strcmp(full1, full2) == 0) {
+               return TRUE;
+       } else {
+               return FALSE;
+       }
 #else
 #else
-  struct stat   filestat1, filestat2;
-
-   /*
-    * Compare st_dev and st_ino.
-    */
-   if (eth_stat(fname1, &filestat1) == -1)
-       return FALSE;   /* can't get info about the first file */
-   if (eth_stat(fname2, &filestat2) == -1)
-       return FALSE;   /* can't get info about the second file */
-   return (filestat1.st_dev == filestat2.st_dev &&
-           filestat1.st_ino == filestat2.st_ino);
+       struct stat   filestat1, filestat2;
+
+       /*
+        * Compare st_dev and st_ino.
+        */
+       if (eth_stat(fname1, &filestat1) == -1)
+               return FALSE;   /* can't get info about the first file */
+       if (eth_stat(fname2, &filestat2) == -1)
+               return FALSE;   /* can't get info about the second file */
+       return (filestat1.st_dev == filestat2.st_dev &&
+               filestat1.st_ino == filestat2.st_ino);
 #endif
 }
 
 #endif
 }
 
+/*
+ * Editor modelines
+ *
+ * Local Variables:
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: tabs
+ * End:
+ *
+ * ex: set shiftwidth=4 tabstop=4 noexpandtab
+ * :indentSize=4:tabSize=4:noTabs=false:
+ */
+
diff --git a/packaging/macosx/ChmodBPF/ChmodBPF b/packaging/macosx/ChmodBPF/ChmodBPF
new file mode 100755 (executable)
index 0000000..8f03460
--- /dev/null
@@ -0,0 +1,35 @@
+#! /bin/sh
+#
+# $Id$
+
+. /etc/rc.common
+
+StartService ()
+{
+       #
+       # Unfortunately, Mac OS X's devfs is based on the old FreeBSD
+       # one, not the current one, so there's no way to configure it
+       # to create BPF devices with particular owners or groups.
+       # This startup item will make it owned by the admin group,
+       # with permissions rw-rw----, so that anybody in the admin
+       # group can use programs that capture or send raw packets.
+       #
+       # Change this as appropriate for your site, e.g. to make
+       # it owned by a particular user without changing the permissions,
+       # so only that user and the super-user can capture or send raw
+       # packets, or give it the permissions rw-r-----, so that
+       # only the super-user can send raw packets but anybody in the
+       # admin group can capture packets.
+       #
+       chgrp admin /dev/bpf*
+       chmod g+rw /dev/bpf*
+}
+
+StopService ()
+{
+       return 0;
+}
+
+RestartService () { StartService; }
+
+RunService "$1"
diff --git a/packaging/macosx/ChmodBPF/README.macosx b/packaging/macosx/ChmodBPF/README.macosx
new file mode 100644 (file)
index 0000000..25794d8
--- /dev/null
@@ -0,0 +1,43 @@
+As with other systems using BPF, Mac OS X allows users with read access
+to the BPF devices to capture packets with libpcap and allows users with
+write access to the BPF devices to send packets with libpcap.
+
+On some systems that use BPF, the BPF devices live on the root file
+system, and the permissions and/or ownership on those devices can be
+changed to give users other than root permission to read or write those
+devices.
+
+On newer versions of FreeBSD, the BPF devices live on devfs, and devfs
+can be configured to set the permissions and/or ownership of those
+devices to give users other than root permission to read or write those
+devices.
+
+On Mac OS X, the BPF devices live on devfs, but the OS X version of
+devfs is based on an older (non-default) FreeBSD devfs, and that version
+of devfs cannot be configured to set the permissions and/or ownership of
+those devices.
+
+Therefore, we supply a "startup item" for OS X that will change the
+ownership of the BPF devices so that the "admin" group owns them, and
+will change the permission of the BPF devices to rw-rw----, so that all
+users in the "admin" group - i.e., all users with "Allow user to
+administer this computer" turned on - have both read and write access to
+them.
+
+The startup item is in the ChmodBPF directory in the source tree.  A
+/Library/StartupItems directory should be created if it doesn't already
+exist, and the ChmodBPF directory should be copied to the
+/Library/StartupItems directory (copy the entire directory, so that
+there's a /Library/StartupItems/ChmodBPF directory, containing all the
+files in the source tree's ChmodBPF directory; don't copy the individual
+items in that directory to /Library/StartupItems).
+
+If you want to give a particular user permission to access the BPF
+devices, rather than giving all administrative users permission to
+access them, you can have the ChmodBPF/ChmodBPF script change the
+ownership of /dev/bpf* without changing the permissions.  If you want to
+give a particular user permission to read and write the BPF devices and
+give the administrative users permission to read but not write the BPF
+devices, you can have the script change the owner to that user, the
+group to "admin", and the permissions to rw-r-----.  Other possibilities
+are left as an exercise for the reader.
diff --git a/packaging/macosx/ChmodBPF/StartupParameters.plist b/packaging/macosx/ChmodBPF/StartupParameters.plist
new file mode 100644 (file)
index 0000000..545e2a6
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  Description     = "Change BPF permissions";
+  Provides        = ("Non-root permission to capture or send raw packets");
+}
diff --git a/packaging/macosx/Info.plist.in b/packaging/macosx/Info.plist.in
new file mode 100644 (file)
index 0000000..85c658f
--- /dev/null
@@ -0,0 +1,55 @@
+<?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">
+<!-- $Id -->
+<plist version="1.0">
+<dict>
+    <key>CFBundleDevelopmentRegion</key>
+    <string>English</string>
+    <key>CFBundleExecutable</key>
+    <string>Wireshark</string>
+    <key>CFBundleGetInfoString</key>
+    <string>@VERSION@, Copyright 2003-2007 Wireshark Development Team</string>
+    <key>CFBundleIconFile</key>
+    <string>Wireshark.icns</string>
+    <key>CFBundleIdentifier</key>
+    <string>org.wireshark.Wireshark</string>
+    <key>CFBundleDocumentTypes</key>
+    <array>
+      <dict>
+        <key>CFBundleTypeExtensions</key>
+        <array>
+          <string>PCAP</string>
+        </array>
+        <key>CFBundleTypeIconFile</key>
+        <string>wsicondoc.icns</string>
+        <key>CFBundleTypeMIMETypes</key>
+        <array>
+          <string>pcap</string>
+        </array>
+        <key>CFBundleTypeName</key>
+        <string>Libpcap Network Capture</string>
+        <key>CFBundleTypeOSTypes</key>
+        <array>
+          <string>PCAP</string>
+        </array>
+        <key>CFBundleTypeRole</key>
+        <string>Viewer</string>
+      </dict>
+      <!-- XXX - This dictionary needs a lot more entries -->
+    </array>
+    <key>CFBundleInfoDictionaryVersion</key>
+    <string>6.0</string>
+    <key>CFBundlePackageType</key>
+    <string>APPL</string>
+    <key>CFBundleShortVersionString</key>
+    <string>@VERSION@</string>
+    <key>CFBundleSignature</key>
+    <string>Wshk</string>
+    <key>CFBundleVersion</key>
+    <string>@VERSION@</string>
+    <key>NSHumanReadableCopyright</key>
+    <string>Copyright 2008 Wireshark Developers, GNU General Public License.</string>
+    <key>LSMinimumSystemVersion</key>
+    <string>10.3</string>
+</dict>
+</plist>
diff --git a/packaging/macosx/Read me first.rtf b/packaging/macosx/Read me first.rtf
new file mode 100644 (file)
index 0000000..834c3af
--- /dev/null
@@ -0,0 +1,56 @@
+{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf440
+{\fonttbl\f0\froman\fcharset77 TimesNewRomanPS-BoldMT;\f1\froman\fcharset77 TimesNewRomanPSMT;\f2\fswiss\fcharset77 Helvetica;
+\f3\fswiss\fcharset77 Helvetica-Oblique;\f4\fswiss\fcharset77 Helvetica-Bold;}
+{\colortbl;\red255\green255\blue255;}
+{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{decimal\}.}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid1}
+{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid2}}
+{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}}
+\margl1440\margr1440\vieww13060\viewh12960\viewkind0
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
+
+\f0\b\fs28 \cf0 Quick Setup\
+
+\f1\b0\fs24 \
+\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\ql\qnatural\pardirnatural
+\ls1\ilvl0
+\f2 \cf0 {\listtext    1.      }Drag the Wireshark icon to 
+\f3\i /Applications
+\f2\i0 .\
+{\listtext     2.      }Drag the contents of the 
+\f3\i Utilities/Command Line
+\f2\i0  folder to 
+\f3\i $HOME/bin
+\f2\i0 , 
+\f3\i /usr/local/bin
+\f2\i0 , 
+\f3\i /opt/wireshark/bin
+\f2\i0  or any other location that makes sense (preferably one that's in your PATH).\
+{\listtext     3.      }You will probably need to adjust the permissions of /dev/bpf
+\f4\b *
+\f2\b0  in order to capture. You can do this by hand or by installing the ChmodBPF startup item.\
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
+\cf0 \
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
+
+\f0\b\fs28 \cf0 Details\
+
+\f1\b0\fs24 \
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
+
+\f2 \cf0 This disk contains the following:\
+\
+\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\ql\qnatural\pardirnatural
+\ls2\ilvl0\cf0 {\listtext      \'a5    }The Wireshark application, which can be placed anywhere on your system. It requires X11.\
+{\listtext     \'a5    }The 
+\f3\i Utilities/Command Line
+\f2\i0  folder, which contains links to Wireshark's command line utilities. These can be placed anywhere on your system, but they must all be in the same directory. If you placed Wireshark in a folder other than 
+\f3\i /Applications
+\f2\i0 , you'll have to set WIRESHARK_APP_DIR in order for these to work. \
+{\listtext     \'a5    }The 
+\f3\i Utilties/Startup
+\f2\i0  folder, which contains the ChmodBPF startup item from the libpcap distribution. This can be used to set the permissions of /dev/bpf
+\f4\b *
+\f2\b0  when your system starts up. See 
+\f3\i Utilties/Startup/README.macosx
+\f2\i0  for more details.\
+{\listtext     \'a5    }This file.}
\ No newline at end of file
diff --git a/packaging/macosx/Resources/MenuBar.nib/classes.nib b/packaging/macosx/Resources/MenuBar.nib/classes.nib
new file mode 100644 (file)
index 0000000..ea58db1
--- /dev/null
@@ -0,0 +1,4 @@
+{
+IBClasses = ();
+IBVersion = 1;
+}
diff --git a/packaging/macosx/Resources/MenuBar.nib/info.nib b/packaging/macosx/Resources/MenuBar.nib/info.nib
new file mode 100644 (file)
index 0000000..4c42cc8
--- /dev/null
@@ -0,0 +1,24 @@
+<?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">
+<!-- $Id$ -->
+<plist version="1.0">
+<dict>
+       <key>IBDocumentLocation</key>
+       <string>99 362 356 240 0 0 1280 832 </string>
+       <key>IBEditorPositions</key>
+       <dict>
+               <key>187</key>
+               <string>340 374 240 44 0 0 1280 832 </string>
+       </dict>
+       <key>IBFramework Version</key>
+       <string>349.0</string>
+       <key>IBOpenObjects</key>
+       <array>
+               <integer>187</integer>
+       </array>
+       <key>IBSystem Version</key>
+       <string>7F44</string>
+       <key>targetFramework</key>
+       <string>IBCarbonFramework</string>
+</dict>
+</plist>
diff --git a/packaging/macosx/Resources/MenuBar.nib/objects.xib b/packaging/macosx/Resources/MenuBar.nib/objects.xib
new file mode 100644 (file)
index 0000000..2f61c2e
--- /dev/null
@@ -0,0 +1,74 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- $Id$ -->
+<object class="NSIBObjectData">
+  <string name="targetFramework">IBCarbonFramework</string>
+  <object name="rootObject" class="NSCustomObject" id="1">
+    <string name="customClass">NSApplication</string>
+  </object>
+  <array count="4" name="allObjects">
+    <object class="IBCarbonMenu" id="187">
+      <string name="title">MenuBar</string>
+      <array count="1" name="items">
+        <object class="IBCarbonMenuItem" id="195">
+          <string name="title">ScriptExec</string>
+          <object name="submenu" class="IBCarbonMenu" id="193">
+            <string name="title">ScriptExec</string>
+            <string name="name">_NSAppleMenu</string>
+          </object>
+        </object>
+      </array>
+      <string name="name">_NSMainMenu</string>
+    </object>
+    <reference idRef="193"/>
+    <reference idRef="195"/>
+    <object class="IBCarbonMenuItem" id="204">
+      <string name="title">Window</string>
+      <object name="submenu" class="IBCarbonMenu">
+        <string name="title">Window</string>
+        <array count="5" name="items">
+          <object class="IBCarbonMenuItem">
+            <boolean name="dynamic">TRUE</boolean>
+            <string name="title">Minimize Window</string>
+            <string name="keyEquivalent">m</string>
+            <ostype name="command">mini</ostype>
+          </object>
+          <object class="IBCarbonMenuItem">
+            <boolean name="dynamic">TRUE</boolean>
+            <string name="title">Minimize All Windows</string>
+            <string name="keyEquivalent">m</string>
+            <int name="keyEquivalentModifier">1572864</int>
+            <ostype name="command">mini</ostype>
+          </object>
+          <object class="IBCarbonMenuItem">
+            <boolean name="separator">TRUE</boolean>
+          </object>
+          <object class="IBCarbonMenuItem">
+            <boolean name="dynamic">TRUE</boolean>
+            <string name="title">Bring All to Front</string>
+            <ostype name="command">frnt</ostype>
+          </object>
+          <object class="IBCarbonMenuItem">
+            <boolean name="dynamic">TRUE</boolean>
+            <string name="title">Bring in Front</string>
+            <int name="keyEquivalentModifier">1572864</int>
+            <ostype name="command">frnt</ostype>
+          </object>
+        </array>
+        <string name="name">_NSWindowsMenu</string>
+      </object>
+    </object>
+  </array>
+  <array count="4" name="allParents">
+    <reference idRef="1"/>
+    <reference idRef="195"/>
+    <reference idRef="187"/>
+    <reference idRef="187"/>
+  </array>
+  <dictionary count="2" name="nameTable">
+    <string>File&apos;s Owner</string>
+    <reference idRef="1"/>
+    <string>MenuBar</string>
+    <reference idRef="187"/>
+  </dictionary>
+  <unsigned_int name="nextObjectID">206</unsigned_int>
+</object>
diff --git a/packaging/macosx/Resources/ProgressWindow.nib/classes.nib b/packaging/macosx/Resources/ProgressWindow.nib/classes.nib
new file mode 100644 (file)
index 0000000..ea58db1
--- /dev/null
@@ -0,0 +1,4 @@
+{
+IBClasses = ();
+IBVersion = 1;
+}
diff --git a/packaging/macosx/Resources/ProgressWindow.nib/info.nib b/packaging/macosx/Resources/ProgressWindow.nib/info.nib
new file mode 100644 (file)
index 0000000..94a06b0
--- /dev/null
@@ -0,0 +1,19 @@
+<?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">
+<!-- $Id$ -->
+<plist version="1.0">
+<dict>
+       <key>IBDocumentLocation</key>
+       <string>124 298 356 240 0 0 1280 832 </string>
+       <key>IBFramework Version</key>
+       <string>349.0</string>
+       <key>IBOpenObjects</key>
+       <array>
+               <integer>180</integer>
+       </array>
+       <key>IBSystem Version</key>
+       <string>7F44</string>
+       <key>targetFramework</key>
+       <string>IBCarbonFramework</string>
+</dict>
+</plist>
diff --git a/packaging/macosx/Resources/ProgressWindow.nib/objects.xib b/packaging/macosx/Resources/ProgressWindow.nib/objects.xib
new file mode 100644 (file)
index 0000000..a1ad895
--- /dev/null
@@ -0,0 +1,54 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- $Id$ -->
+<object class="NSIBObjectData">
+  <string name="targetFramework">IBCarbonFramework</string>
+  <object name="rootObject" class="NSCustomObject" id="1">
+    <string name="customClass">NSApplication</string>
+  </object>
+  <array count="4" name="allObjects">
+    <object class="IBCarbonWindow" id="180">
+      <string name="windowRect">404 523 457 899 </string>
+      <string name="title">Caching Fonts...</string>
+      <object name="rootControl" class="IBCarbonRootControl" id="183">
+        <string name="bounds">0 0 53 376 </string>
+        <array count="2" name="subviews">
+          <object class="IBCarbonProgressBar" id="181">
+            <string name="bounds">19 17 32 270 </string>
+            <boolean name="small">TRUE</boolean>
+            <int name="controlSize">1</int>
+            <int name="initialValue">50</int>
+          </object>
+          <object class="IBCarbonButton" id="185">
+            <string name="bounds">16 284 34 356 </string>
+            <boolean name="small">TRUE</boolean>
+            <int name="controlSize">1</int>
+            <string name="title">Cancel</string>
+            <ostype name="command">quit</ostype>
+          </object>
+        </array>
+      </object>
+      <boolean name="hasCloseBox">FALSE</boolean>
+      <boolean name="hasHorizontalZoom">FALSE</boolean>
+      <boolean name="isResizable">FALSE</boolean>
+      <boolean name="hasVerticalZoom">FALSE</boolean>
+      <int name="themeBrush">51</int>
+      <int name="windowPosition">1</int>
+    </object>
+    <reference idRef="181"/>
+    <reference idRef="183"/>
+    <reference idRef="185"/>
+  </array>
+  <array count="4" name="allParents">
+    <reference idRef="1"/>
+    <reference idRef="183"/>
+    <reference idRef="180"/>
+    <reference idRef="183"/>
+  </array>
+  <dictionary count="2" name="nameTable">
+    <string>File&apos;s Owner</string>
+    <reference idRef="1"/>
+    <string>Window</string>
+    <reference idRef="180"/>
+  </dictionary>
+  <unsigned_int name="nextObjectID">186</unsigned_int>
+</object>
diff --git a/packaging/macosx/Resources/Wireshark.icns b/packaging/macosx/Resources/Wireshark.icns
new file mode 100644 (file)
index 0000000..d529d71
Binary files /dev/null and b/packaging/macosx/Resources/Wireshark.icns differ
diff --git a/packaging/macosx/Resources/bin/getdisplay.sh b/packaging/macosx/Resources/bin/getdisplay.sh
new file mode 100755 (executable)
index 0000000..085ac2b
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+#
+# $Id$
+#
+# Author: Aaron Voisine <aaron@voisine.org>
+
+if [ "$DISPLAY"x == "x" ]; then
+    echo :0 > /tmp/display.$UID
+else
+    echo $DISPLAY > /tmp/display.$UID
+fi
diff --git a/packaging/macosx/Resources/bin/wireshark b/packaging/macosx/Resources/bin/wireshark
new file mode 100755 (executable)
index 0000000..f8f0e2b
--- /dev/null
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# $Id$
+#
+# Author: Aaron Voisine <aaron@voisine.org>
+# Wireshark Modifications:
+#      Michael Wybrow <mjwybrow@users.sourceforge.net>
+#      Jean-Olivier Irisson <jo.irisson@gmail.com>
+#
+
+CWD="`(cd \"\`dirname \\\"$0\\\"\`\"; echo $PWD)`"
+# e.g. /Applications/Wireshark.app/Contents/Resources/bin
+TOP="`dirname \"$CWD\"`"
+# e.g. /Applications/Wireshark.app/Contents/Resources
+
+# We might be exec'ed from wireshark, tshark, dumpcap, or any other binary
+# from the Wireshark distribution.
+# XXX - Should we verify that we have a valid name?
+APPNAME=`basename $0`
+
+# Brutally add many things to the PATH. If the directories do not exist, they won't be used anyway.
+# People should really use ~/.macosx/environment.plist to set environment variables as explained by Apple:
+#      http://developer.apple.com/qa/qa2001/qa1067.html
+# but since no one does, we correct this by making the 'classic' PATH additions here:
+#      /usr/local/bin which, though standard, doesn't seem to be in the PATH
+#      newer python as recommended by MacPython http://www.python.org/download/mac/
+#      Fink
+#      MacPorts (former DarwinPorts)
+export PATH="/opt/local/bin:/sw/bin/:/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/local/bin:$CWD:$PATH"
+
+export DYLD_LIBRARY_PATH="$TOP/lib"
+
+export WIRESHARK_DATA_DIR="$TOP/share/wireshark"
+export WIRESHARK_PLUGIN_DIR="$TOP/lib/wireshark/plugins"
+
+if [ "$APPNAME" == "wireshark" ] ; then # Apply GUI settings
+       # For Panther and Tiger, override the default fontconfig configuration
+        # XXX - This apparently isn't needed?
+       #if [[ $VERSION -le 4 ]]; then
+               export FONTCONFIG_PATH="$TOP/etc/fonts"
+       #fi
+       export PANGO_RC_FILE="$HOME/.wireshark-etc/pangorc"
+       export GTK_IM_MODULE_FILE="$HOME/.wireshark-etc/gtk.immodules"
+       export GDK_PIXBUF_MODULE_FILE="$HOME/.wireshark-etc/gdk-pixbuf.loaders"
+       export GTK_DATA_PREFIX="$TOP"
+       export GTK_EXE_PREFIX="$TOP"
+       export GNOME_VFS_MODULE_CONFIG_PATH="$TOP/etc/gnome-vfs-2.0/modules"
+       export GNOME_VFS_MODULE_PATH="$TOP/lib/gnome-vfs-2.0/modules"
+
+       # Set GTK theme (only if there is no .gtkrc-2.0 in the user's home)
+       if [[ ! -e $HOME/.gtkrc-2.0 ]]; then
+               # prepare the theme depending on OS X appearance settings
+               (
+                       cd "$TOP/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/"
+                       ./sync_osx_look.sh
+                       # TODO: make this more robust, probably by integrating this script directly inline here
+               )
+               export GTK2_RC_FILES="$TOP/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/gtkrc"
+       fi
+
+       # TODO: Have to add ".UTF-8" to the LANG since ommiting causes Wireshark
+       #       to crash on startup in locale_from_utf8().
+       export LANG="`grep \"\`defaults read .GlobalPreferences AppleCollationOrder \
+               2>&1\`_\" /usr/share/locale/locale.alias | tail -n1 | sed 's/\./ /' | \
+               awk '{print $2}'`.UTF-8"
+
+       # Handle the case where the directory storing Wireshark has a '#' in the name.
+       # This '#' needs to be escaped in pango.modules for Pango to work properly.
+       ESCAPEDTOP=`echo $TOP | sed 's/#/\\\\\\\\#/'`
+
+       mkdir -p ${HOME}/.wireshark-etc
+       sed 's|${HOME}|'"$HOME|g" "$TOP/etc/pango/pangorc" > ${HOME}/.wireshark-etc/pangorc
+       sed 's|${CWD}|'"$ESCAPEDTOP|g" "$TOP/etc/pango/pango.modules" \
+               > ${HOME}/.wireshark-etc/pango.modules
+       cp -f "$TOP/etc/pango/pangox.aliases" ${HOME}/.wireshark-etc/
+       sed 's|${CWD}|'"$TOP|g" "$TOP/etc/gtk-2.0/gtk.immodules" \
+               > ${HOME}/.wireshark-etc/gtk.immodules
+       sed 's|${CWD}|'"$TOP|g" "$TOP/etc/gtk-2.0/gdk-pixbuf.loaders" \
+               > ${HOME}/.wireshark-etc/gdk-pixbuf.loaders
+fi
+
+exec "$CWD/$APPNAME-bin" "$@"
diff --git a/packaging/macosx/Resources/etc/fonts/fonts.conf b/packaging/macosx/Resources/etc/fonts/fonts.conf
new file mode 100644 (file)
index 0000000..04b7ec7
--- /dev/null
@@ -0,0 +1,155 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<!-- $Id$ -->
+<!-- /etc/fonts/fonts.conf file to configure system font access -->
+<fontconfig>
+
+<!--
+       DO NOT EDIT THIS FILE.
+       IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
+       LOCAL CHANGES BELONG IN 'local.conf'.
+
+       The intent of this standard configuration file is to be adequate for
+       most environments.  If you have a reasonably normal environment and
+       have found problems with this configuration, they are probably
+       things that others will also want fixed.  Please submit any
+       problems to the fontconfig bugzilla system located at fontconfig.org
+
+       Note that the normal 'make install' procedure for fontconfig is to
+       replace any existing fonts.conf file with the new version.  Place
+       any local customizations in local.conf which this file references.
+
+       Keith Packard
+-->
+
+<!-- Font directory list -->
+
+       <dir>/Library/Fonts</dir>
+       <dir>/Network/Library/Fonts</dir>
+       <dir>/System/Library/Fonts</dir>
+       <dir>/usr/X11R6/lib/X11/fonts</dir>
+       <dir>/usr/share/fonts</dir>
+       <dir>/var/root/Library/Fonts</dir>
+       <dir>~/.fonts</dir>
+       <dir>~/Library/Fonts</dir>
+
+<!-- Font cache directory list -->
+
+       <cachedir>~/.fontconfig</cachedir>
+
+<!--
+  Accept deprecated 'mono' alias, replacing it with 'monospace'
+-->
+       <match target="pattern">
+               <test qual="any" name="family">
+                       <string>mono</string>
+               </test>
+               <edit name="family" mode="assign">
+                       <string>monospace</string>
+               </edit>
+       </match>
+
+<!--
+  Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
+-->
+       <match target="pattern">
+               <test qual="any" name="family">
+                       <string>sans serif</string>
+               </test>
+               <edit name="family" mode="assign">
+                       <string>sans-serif</string>
+               </edit>
+       </match>
+
+<!--
+  Accept deprecated 'sans' alias, replacing it with 'sans-serif'
+-->
+       <match target="pattern">
+               <test qual="any" name="family">
+                       <string>sans</string>
+               </test>
+               <edit name="family" mode="assign">
+                       <string>sans-serif</string>
+               </edit>
+       </match>
+
+<!--
+  Load local system customization file
+-->
+       <include ignore_missing="yes">conf.d</include>
+
+       <config>
+<!--
+  These are the default Unicode chars that are expected to be blank
+  in fonts.  All other blank chars are assumed to be broken and
+  won't appear in the resulting charsets
+ -->
+               <blank>
+                       <int>0x0020</int>       <!-- SPACE -->
+                       <int>0x00A0</int>       <!-- NO-BREAK SPACE -->
+                       <int>0x00AD</int>       <!-- SOFT HYPHEN -->
+                       <int>0x034F</int>       <!-- COMBINING GRAPHEME JOINER -->
+                       <int>0x0600</int>       <!-- ARABIC NUMBER SIGN -->
+                       <int>0x0601</int>       <!-- ARABIC SIGN SANAH -->
+                       <int>0x0602</int>       <!-- ARABIC FOOTNOTE MARKER -->
+                       <int>0x0603</int>       <!-- ARABIC SIGN SAFHA -->
+                       <int>0x06DD</int>       <!-- ARABIC END OF AYAH -->
+                       <int>0x070F</int>       <!-- SYRIAC ABBREVIATION MARK -->
+                       <int>0x115F</int>       <!-- HANGUL CHOSEONG FILLER -->
+                       <int>0x1160</int>       <!-- HANGUL JUNGSEONG FILLER -->
+                       <int>0x1680</int>       <!-- OGHAM SPACE MARK -->
+                       <int>0x17B4</int>       <!-- KHMER VOWEL INHERENT AQ -->
+                       <int>0x17B5</int>       <!-- KHMER VOWEL INHERENT AA -->
+                       <int>0x180E</int>       <!-- MONGOLIAN VOWEL SEPARATOR -->
+                       <int>0x2000</int>       <!-- EN QUAD -->
+                       <int>0x2001</int>       <!-- EM QUAD -->
+                       <int>0x2002</int>       <!-- EN SPACE -->
+                       <int>0x2003</int>       <!-- EM SPACE -->
+                       <int>0x2004</int>       <!-- THREE-PER-EM SPACE -->
+                       <int>0x2005</int>       <!-- FOUR-PER-EM SPACE -->
+                       <int>0x2006</int>       <!-- SIX-PER-EM SPACE -->
+                       <int>0x2007</int>       <!-- FIGURE SPACE -->
+                       <int>0x2008</int>       <!-- PUNCTUATION SPACE -->
+                       <int>0x2009</int>       <!-- THIN SPACE -->
+                       <int>0x200A</int>       <!-- HAIR SPACE -->
+                       <int>0x200B</int>       <!-- ZERO WIDTH SPACE -->
+                       <int>0x200C</int>       <!-- ZERO WIDTH NON-JOINER -->
+                       <int>0x200D</int>       <!-- ZERO WIDTH JOINER -->
+                       <int>0x200E</int>       <!-- LEFT-TO-RIGHT MARK -->
+                       <int>0x200F</int>       <!-- RIGHT-TO-LEFT MARK -->
+                       <int>0x2028</int>       <!-- LINE SEPARATOR -->
+                       <int>0x2029</int>       <!-- PARAGRAPH SEPARATOR -->
+                       <int>0x202A</int>       <!-- LEFT-TO-RIGHT EMBEDDING -->
+                       <int>0x202B</int>       <!-- RIGHT-TO-LEFT EMBEDDING -->
+                       <int>0x202C</int>       <!-- POP DIRECTIONAL FORMATTING -->
+                       <int>0x202D</int>       <!-- LEFT-TO-RIGHT OVERRIDE -->
+                       <int>0x202E</int>       <!-- RIGHT-TO-LEFT OVERRIDE -->
+                       <int>0x202F</int>       <!-- NARROW NO-BREAK SPACE -->
+                       <int>0x205F</int>       <!-- MEDIUM MATHEMATICAL SPACE -->
+                       <int>0x2060</int>       <!-- WORD JOINER -->
+                       <int>0x2061</int>       <!-- FUNCTION APPLICATION -->
+                       <int>0x2062</int>       <!-- INVISIBLE TIMES -->
+                       <int>0x2063</int>       <!-- INVISIBLE SEPARATOR -->
+                       <int>0x206A</int>       <!-- INHIBIT SYMMETRIC SWAPPING -->
+                       <int>0x206B</int>       <!-- ACTIVATE SYMMETRIC SWAPPING -->
+                       <int>0x206C</int>       <!-- INHIBIT ARABIC FORM SHAPING -->
+                       <int>0x206D</int>       <!-- ACTIVATE ARABIC FORM SHAPING -->
+                       <int>0x206E</int>       <!-- NATIONAL DIGIT SHAPES -->
+                       <int>0x206F</int>       <!-- NOMINAL DIGIT SHAPES -->
+                       <int>0x3000</int>       <!-- IDEOGRAPHIC SPACE -->
+                       <int>0x3164</int>       <!-- HANGUL FILLER -->
+                       <int>0xFEFF</int>       <!-- ZERO WIDTH NO-BREAK SPACE -->
+                       <int>0xFFA0</int>       <!-- HALFWIDTH HANGUL FILLER -->
+                       <int>0xFFF9</int>       <!-- INTERLINEAR ANNOTATION ANCHOR -->
+                       <int>0xFFFA</int>       <!-- INTERLINEAR ANNOTATION SEPARATOR -->
+                       <int>0xFFFB</int>       <!-- INTERLINEAR ANNOTATION TERMINATOR -->
+               </blank>
+<!--
+  Rescan configuration every 30 seconds when FcFontSetList is called
+ -->
+               <rescan>
+                       <int>30</int>
+               </rescan>
+       </config>
+
+</fontconfig>
diff --git a/packaging/macosx/Resources/openDoc b/packaging/macosx/Resources/openDoc
new file mode 100755 (executable)
index 0000000..588ee37
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# $Id$
+#
+# Author: Aaron Voisine <aaron@voisine.org>
+# Inkscape Modifications: Michael Wybrow <mjwybrow@users.sourceforge.net>
+
+CWD="`dirname \"$0\"`"
+
+# System version: 3 for Panther, 4 for Tiger, 5 for Leopard
+export VERSION=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 -d'.'`
+
+if [[ $VERSION -le 4 ]]; then
+        export "DISPLAY=`cat /tmp/display.$UID`"
+fi
+
+BASE="`echo "$0" | sed -e 's/\/[A-Za-z]*.app\/Contents\/Resources\/openDoc/\//'`"
+cd "$BASE"
+exec "$CWD/bin/wireshark" "$@"
+
diff --git a/packaging/macosx/Resources/script b/packaging/macosx/Resources/script
new file mode 100755 (executable)
index 0000000..0d918ab
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/sh
+#
+# $Id$
+#
+# Author: Aaron Voisine <aaron@voisine.org>
+# Wireshark (Inkscape) Modifications: Michael Wybrow <mjwybrow@users.sourceforge.net>
+
+CWD="`dirname \"$0\"`"
+
+# System version: 3 for Panther, 4 for Tiger, 5 for Leopard
+export VERSION=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 -d'.'`
+
+# On Leopard, X11.app is installed by default, and will be started
+# automatically via launchd.  On older systems, we need to start 
+# X11 ourself.
+
+# For Panther and Tiger, start X11
+if [[ $VERSION -le 4 ]]; then
+       # FIXME apparently this removes the xterm that starts with X 
+       # from xinitrc but when is it really used? Should we modify 
+       # the .xinitrc of the user without warning?
+       ps -wx -ocommand | grep -e '[X]11' > /dev/null
+       if [ "$?" != "0" -a ! -f ${HOME}/.xinitrc ]; then
+           echo "rm -f ${HOME}/.xinitrc" > ${HOME}/.xinitrc
+           sed 's/xterm/# xterm/' /usr/X11R6/lib/X11/xinit/xinitrc >> ${HOME}/.xinitrc
+       fi
+
+       # Start X11 and get DISPLAY
+       cp -f "$CWD/bin/getdisplay.sh" /tmp/
+       rm -f /tmp/display.$UID
+       open-x11 /tmp/getdisplay.sh || \
+       open -a XDarwin /tmp/getdisplay.sh || \
+       echo ":0" > /tmp/display.$UID
+
+       while [ "$?" == "0" -a ! -f /tmp/display.$UID ]; do
+           sleep 1
+       done
+       export DISPLAY="`cat /tmp/display.$UID`"
+
+       ps -wx -ocommand | grep -e '[X]11' > /dev/null || exit 11
+fi
+
+
+# Warn the user about time-consuming generation of fontconfig caches.
+test -f ${HOME}/.wireshark/.fccache-new || exit 12
+
+
+BASE="`echo "$0" | sed -e 's/\/Contents\/Resources\/script/\//'`"
+cd "$BASE"
+exec "$CWD/bin/wireshark" "$@"
+# TODO examine wether it would be wisest to move the code from wireshark shell
+# script and getdisplay.sh to here and only keep the real binary in bin. This
+# may make things easier on Leopard and may also help using Wireshark on the
+# command line
+
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/stepper-down.png b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/stepper-down.png
new file mode 100644 (file)
index 0000000..336ff0e
Binary files /dev/null and b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/stepper-down.png differ
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/stepper-left.png b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/stepper-left.png
new file mode 100644 (file)
index 0000000..14f0b88
Binary files /dev/null and b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/stepper-left.png differ
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/stepper-right.png b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/stepper-right.png
new file mode 100644 (file)
index 0000000..16feb73
Binary files /dev/null and b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/stepper-right.png differ
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/stepper-up.png b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/stepper-up.png
new file mode 100644 (file)
index 0000000..33825ef
Binary files /dev/null and b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/stepper-up.png differ
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/trough-scrollbar-horiz.png b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/trough-scrollbar-horiz.png
new file mode 100644 (file)
index 0000000..4e2954a
Binary files /dev/null and b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/trough-scrollbar-horiz.png differ
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/trough-scrollbar-vert.png b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/trough-scrollbar-vert.png
new file mode 100644 (file)
index 0000000..6d544c8
Binary files /dev/null and b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars/trough-scrollbar-vert.png differ
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/copy-slider.sh b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/copy-slider.sh
new file mode 100755 (executable)
index 0000000..884de3a
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+#
+# $Id$
+
+cp -f slider-vert.png slider-vert-prelight.png
+cp -f slider-vert.png slider-horiz-prelight.png
+cp -f slider-vert.png slider-horiz.png
+convert -rotate 90 slider-horiz.png slider-horiz.png
+convert -rotate 90 slider-horiz-prelight.png slider-horiz-prelight.png
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/slider-horiz-prelight.png b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/slider-horiz-prelight.png
new file mode 100644 (file)
index 0000000..38cc4b8
Binary files /dev/null and b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/slider-horiz-prelight.png differ
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/slider-horiz.png b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/slider-horiz.png
new file mode 100644 (file)
index 0000000..38cc4b8
Binary files /dev/null and b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/slider-horiz.png differ
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/slider-vert-prelight.png b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/slider-vert-prelight.png
new file mode 100644 (file)
index 0000000..d25f98e
Binary files /dev/null and b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/slider-vert-prelight.png differ
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/slider-vert.png b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/slider-vert.png
new file mode 100644 (file)
index 0000000..d25f98e
Binary files /dev/null and b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_1/slider-vert.png differ
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/copy-slider.sh b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/copy-slider.sh
new file mode 100755 (executable)
index 0000000..884de3a
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+#
+# $Id$
+
+cp -f slider-vert.png slider-vert-prelight.png
+cp -f slider-vert.png slider-horiz-prelight.png
+cp -f slider-vert.png slider-horiz.png
+convert -rotate 90 slider-horiz.png slider-horiz.png
+convert -rotate 90 slider-horiz-prelight.png slider-horiz-prelight.png
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/slider-horiz-prelight.png b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/slider-horiz-prelight.png
new file mode 100644 (file)
index 0000000..b48d039
Binary files /dev/null and b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/slider-horiz-prelight.png differ
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/slider-horiz.png b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/slider-horiz.png
new file mode 100644 (file)
index 0000000..b48d039
Binary files /dev/null and b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/slider-horiz.png differ
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/slider-vert-prelight.png b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/slider-vert-prelight.png
new file mode 100644 (file)
index 0000000..253b9bf
Binary files /dev/null and b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/slider-vert-prelight.png differ
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/slider-vert.png b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/slider-vert.png
new file mode 100644 (file)
index 0000000..253b9bf
Binary files /dev/null and b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/Scrollbars_6/slider-vert.png differ
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/gtkrc b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/gtkrc
new file mode 100644 (file)
index 0000000..00dc712
--- /dev/null
@@ -0,0 +1,504 @@
+#
+# GTK theme to be used on Mac OS X, to mimic the appearance of Tiger
+#
+# $Id$
+# 
+# Heavily based on Clearlooks-Quicksilver
+# Scrollbars from OSX-theme by Lauri Taimila (lauri@taimila.com)
+# 
+# (c) 2007 JiHO <jo.irisson@gmail.com>. 
+# GNU General Public License http://www.gnu.org/copyleft/gpl.html
+#
+
+style "clearlooks-default"
+{
+       GtkButton               ::default_border         = { 0, 0, 0, 0 }
+       GtkRange                        ::trough_border  = 0
+       GtkPaned                        ::handle_size            = 6
+       GtkRange                        ::slider_width           = 15
+       GtkRange                        ::stepper_size           = 15
+       GtkScrollbar    ::min_slider_length = 30
+       GtkCheckButton  ::indicator_size         = 12
+       GtkMenuBar              ::internal-padding       = 0
+       GtkTreeView             ::expander_size  = 14
+       GtkExpander             ::expander_size  = 16
+
+       xthickness = 1
+       ythickness = 1
+
+       fg[NORMAL]                      = "#000000" # black
+       fg[PRELIGHT]            = "#000000" # black
+       fg[SELECTED]            = "#ffffff" # white 
+       fg[ACTIVE]                      = "#000000" # black
+       fg[INSENSITIVE] = {0.6, 0.6, 0.6} # dark gray
+
+       bg[NORMAL]                      = {0.95, 0.95, 0.95} # very light gray
+       bg[PRELIGHT]            = "#ffffff" # white
+       bg[SELECTED]            = "#4a76cd"     # menu color
+       bg[INSENSITIVE] = {0.9, 0.9, 0.9} # light gray
+       bg[ACTIVE]                      = {0.85, 0.85, 0.85} # gray
+
+       base[NORMAL]            = "#ffffff" # white 
+       base[PRELIGHT]          = "#4a76cd" # menu color
+       base[ACTIVE]            = {0.6, 0.6, 0.6} # dark gray
+       base[SELECTED]          = {0.709800,0.835300,1.000000} # highlight color
+       base[INSENSITIVE] = {0.9, 0.9, 0.9} # light gray
+
+       text[NORMAL]            = "#000000" # black
+       text[PRELIGHT]          = "#000000" # black
+       text[ACTIVE]            = "#ffffff" # white
+       text[SELECTED]          = "#ffffff" # white
+       text[INSENSITIVE]       = {0.6, 0.6, 0.6} # dark gray
+
+       engine "clearlooks" 
+       {
+       menubarstyle            = 1             # 0 = flat, 1 = sunken, 2 = flat gradient
+       menuitemstyle           = 0             # 0 = flat, 1 = 3d-ish (gradient), 2 = 3d-ish (button)
+       listviewitemstyle       = 0             # 0 = flat, 1 = 3d-ish (gradient)
+       progressbarstyle        = 0             # 0 = candy bar, 1 = flat
+       }
+}
+
+style "clearlooks-wide" = "clearlooks-default"
+{
+       xthickness = 2
+       ythickness = 2
+}
+
+style "clearlooks-button" = "clearlooks-default"
+{
+       xthickness = 3
+       ythickness = 3
+
+       bg[NORMAL] = "#f0f1f2" # a hint of blue...
+}
+
+style "clearlooks-notebook" = "clearlooks-wide"
+{
+       bg[NORMAL] = {0.93, 0.93, 0.93}
+       bg[INSENSITIVE] = {0.93, 0.93, 0.93}
+}
+
+style "clearlooks-tasklist" = "clearlooks-default"
+{
+       xthickness = 5
+       ythickness = 3
+}
+
+style "clearlooks-menu" = "clearlooks-default"
+{
+       xthickness = 2
+       ythickness = 1
+       bg[NORMAL] = "#ffffff"
+}
+
+style "clearlooks-menu-item" = "clearlooks-default"
+{
+       xthickness = 2
+       ythickness = 3
+       fg[PRELIGHT] = "#ffffff"
+       text[PRELIGHT] = "#ffffff"
+}
+
+style "clearlooks-menu-itembar" = "clearlooks-default"
+{
+       xthickness = 3
+       ythickness = 3
+}
+
+style "clearlooks-tree" = "clearlooks-default"
+{
+       xthickness = 2
+       ythickness = 2
+}
+
+style "clearlooks-frame-title" = "clearlooks-default"
+{
+       fg[NORMAL] = "#404040"
+}
+
+style "clearlooks-tooltips" = "clearlooks-default"
+{
+       xthickness = 4
+       ythickness = 4
+       bg[NORMAL] = { 1.0,1.0,0.75 }
+}
+
+style "clearlooks-progressbar" = "clearlooks-default"
+{
+       xthickness = 1
+       ythickness = 1
+
+       fg[PRELIGHT]    = "#ffffff"
+}
+
+style "clearlooks-combo" = "clearlooks-default"
+{
+       xthickness = 2
+       ythickness = 3
+}
+
+# Added pixmaps for scollbars
+style "scrollbar" = "default"
+{
+       # The values I set here have to do with the relative size of three graphic elements
+       # I have used: the slider, the arrow box, and the trough. They all have the same width
+       # of 15 pixels, but gtk wants to put in some spacing between them. It seems like it
+       # places the sliders inside the trough with a default 1 pixel border on either side of the slider,
+       # so that the trough has its width stretched by an additional two pixels(?). Setting the
+       # trough border makes the arrow box sit on top of the trough squarely, by making sure that
+       # the trough stays the same width as the arrowbox(?). I could be totally wrong here.
+       GtkRange::trough_border = 0
+       GtkRange::slider_width = 15
+
+       # This sets the size of the steppers (arrow buttons on the end of the scrollbar). 
+       # The image I am using is 15x15 pixels, and if I dont set this a one pixel line 
+       # gets cut off of the top of the "up" stepper.
+       GtkRange::stepper_size = 15
+
+       # Set a minimum length for the slider. Since I set the border on the slider 
+       # image to 15 pixels on either end of the slider I want the min length to be 
+       # at least 30 pixels to avoid an ugly slider when gtk wants to make it smaller 
+       # than 30 pixels.
+       GtkScrollbar::min_slider_length = 30
+
+       engine "pixmap" 
+       {
+               # Horizontal slider background
+               image 
+               {
+                       function                = BOX
+                       recolorable             = TRUE
+                       detail                  = "trough"
+                       file                    = "Scrollbars/trough-scrollbar-horiz.png"
+                       border                  = { 30, 30, 0, 0 }
+                       stretch                 = TRUE
+                       orientation             = HORIZONTAL
+               }
+               
+               # Vertical slider background
+               image 
+               {
+                       function                = BOX
+                       recolorable             = TRUE
+                       detail                  = "trough"
+                       file                    = "Scrollbars/trough-scrollbar-vert.png"
+                       border                  = { 0, 0, 30, 30 }
+                       stretch                 = TRUE
+                       orientation             = VERTICAL
+               }
+
+               # Normal horizontal slider
+               image 
+               {
+                       function                = SLIDER
+                       recolorable             = TRUE
+                       state                   = NORMAL
+                       file                    = "Scrollbars_1/slider-horiz.png"
+                       border                  = { 15, 15, 6, 6 }
+                       stretch                 = TRUE
+                       orientation             = HORIZONTAL
+               }
+               
+               # Horizontal slider (active)
+               image 
+               {
+                       function                = SLIDER
+                       recolorable             = TRUE
+                       state                   = ACTIVE
+                       file                    = "Scrollbars_1/slider-horiz-prelight.png"
+                       border                  = { 15, 15, 6, 6 }
+                       stretch                 = TRUE
+                       orientation             = HORIZONTAL
+               }
+
+               # Horizontal slider (mouse over)
+               image 
+               {
+                       function                = SLIDER 
+                       recolorable             = TRUE
+                       state                   = PRELIGHT
+                       file                    = "Scrollbars_1/slider-horiz-prelight.png"
+                       border                  = { 15, 15, 6, 6 }
+                       stretch                 = TRUE
+                       orientation             = HORIZONTAL
+               }
+               
+               # Horizontal slider (Insesitive)
+               image 
+               {
+                       function                = SLIDER 
+                       recolorable             = TRUE
+                       state                   = INSENSITIVE
+                       file                    = "Scrollbars_1/slider-horiz.png"
+                       border                  = { 15, 15, 6, 6 }
+                       stretch                 = TRUE
+                       orientation             = HORIZONTAL
+               }
+
+               # Normal vertical slider
+               image 
+               {
+                       function                = SLIDER
+                       recolorable             = TRUE
+                       state                   = NORMAL
+                       file                    = "Scrollbars_1/slider-vert.png"
+                       border                  = { 6, 6, 15, 15 }
+                       stretch                 = TRUE
+                       orientation             = VERTICAL
+               }
+               
+               # Vertical slider (Active)
+               image 
+               {
+                       function                = SLIDER
+                       recolorable             = TRUE
+                       state                   = ACTIVE
+                       file                    = "Scrollbars_1/slider-vert.png"
+                       border                  = { 6, 6, 15, 15 }
+                       stretch                 = TRUE
+                       orientation             = VERTICAL
+               }
+
+               # Vertical slider (mouse over)
+               image 
+               {
+                       function                = SLIDER 
+                       recolorable             = TRUE
+                       state                   = PRELIGHT
+                       file                    = "Scrollbars_1/slider-vert-prelight.png"
+                       border                  = { 6, 6, 15, 15 }
+                       stretch                 = TRUE
+                       orientation             = VERTICAL
+               }
+               
+               # Vertical slider (Insesitive)
+               image 
+               {
+                       function                = SLIDER 
+                       recolorable             = TRUE
+                       state                   = INSENSITIVE
+                       file                    = "Scrollbars_1/slider-vert-prelight.png"
+                       border                  = { 6, 6, 15, 15 }
+                       stretch                 = TRUE
+                       orientation             = VERTICAL
+               }
+
+################################################################################
+# SCROLLBAR STEPPERS
+################################################################################
+
+       # Up
+       image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = NORMAL
+               file                            = "Scrollbars/stepper-up.png"
+               #border                 = { 12, 2, 2, 9 }
+               stretch                 = TRUE
+               arrow_direction = UP
+       }
+       image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = PRELIGHT
+               file                            = "Scrollbars/stepper-up.png"
+               #border                 = { 12, 2, 2, 9 }
+               stretch                 = TRUE
+               arrow_direction = UP
+       }
+ image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = ACTIVE
+               file                            = "Scrollbars/stepper-up.png"
+               #border                 = { 12, 2, 2, 9 }
+               stretch                 = TRUE
+               arrow_direction = UP
+       }
+ image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = INSENSITIVE
+               file                            = "Scrollbars/stepper-up.png"
+               #border                 = { 12, 2, 2, 9 }
+               stretch                 = TRUE
+               arrow_direction = UP
+       }
+
+ ######### DOWN ############
+
+
+       image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = NORMAL
+               file                            = "Scrollbars/stepper-down.png"
+               #border                 = { 12, 2, 10, 2 }
+               stretch                 = TRUE
+               arrow_direction = DOWN
+       }
+ image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = PRELIGHT
+               file                            = "Scrollbars/stepper-down.png"
+               #border                 = { 12, 2, 10, 2 }
+               stretch                 = TRUE
+               arrow_direction = DOWN
+       }
+ image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = ACTIVE
+               file                            = "Scrollbars/stepper-down.png"
+               #border                 = { 12, 2, 10, 2 }
+               stretch                 = TRUE
+               arrow_direction = DOWN
+       }
+ image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = INSENSITIVE
+               file                            = "Scrollbars/stepper-down.png"
+               #border                 = { 12, 2, 10, 2 }
+               stretch                 = TRUE
+               arrow_direction = DOWN
+       }
+
+############ RIGHT ################
+
+       image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = NORMAL
+               file                            = "Scrollbars/stepper-right.png"
+               #border                 = { 2, 9, 2, 13 }
+               stretch                 = TRUE
+               arrow_direction = RIGHT
+       }
+ image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = PRELIGHT
+               file                            = "Scrollbars/stepper-right.png"
+               #border                 = { 2, 9, 2, 13 }
+               stretch                 = TRUE
+               arrow_direction = RIGHT
+       }
+ image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = ACTIVE
+               file                            = "Scrollbars/stepper-right.png"
+               #border                 = { 2, 9, 2, 13 }
+               stretch                 = TRUE
+               arrow_direction = RIGHT
+       }
+ image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = INSENSITIVE
+               file                            = "Scrollbars/stepper-right.png"
+               #border                 = { 2, 9, 2, 13 }
+               stretch                 = TRUE
+               arrow_direction = RIGHT
+       }
+
+############### LEFT ###################
+
+
+       image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = NORMAL
+               file                            = "Scrollbars/stepper-left.png"
+               #border                 = { 2, 9, 2, 13 }
+               stretch                 = TRUE
+               arrow_direction = LEFT
+       }
+       image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = PRELIGHT
+               file                            = "Scrollbars/stepper-left.png"
+               #border                 = { 2, 9, 2, 13 }
+               stretch                 = TRUE
+               arrow_direction = LEFT
+       }
+       image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = ACTIVE
+               file                            = "Scrollbars/stepper-left.png"
+               #border                 = { 2, 9, 2, 13 }
+               stretch                 = TRUE
+               arrow_direction = LEFT
+       }
+       image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = INSENSITIVE
+               file                            = "Scrollbars/stepper-left.png"
+               #border                 = { 2, 9, 2, 13 }
+               stretch                 = TRUE
+               arrow_direction = LEFT
+       }
+       }
+}
+
+# widget styles
+class "GtkWidget" style "clearlooks-default"
+class "GtkButton" style "clearlooks-button"
+class "GtkCombo"       style "clearlooks-button"
+class "GtkRange"       style "clearlooks-wide"
+class "GtkFrame"       style "clearlooks-wide"
+class "GtkMenu"                style "clearlooks-menu"
+class "GtkEntry"       style "clearlooks-button"
+class "GtkMenuItem"             style "clearlooks-menu-item"
+class "GtkStatusbar"    style "clearlooks-wide"
+class "GtkNotebook"             style "clearlooks-notebook"
+class "GtkProgressBar" style "clearlooks-progressbar"
+class "GtkScrollbar"    style "scrollbar"
+
+widget_class "*MenuItem.*" style "clearlooks-menu-item"
+
+# combobox stuff
+widget_class "*.GtkComboBox.GtkButton" style "clearlooks-combo"
+widget_class "*.GtkCombo.GtkButton"             style "clearlooks-combo"
+
+# tooltips stuff
+widget_class "*.tooltips.*.GtkToggleButton" style "clearlooks-tasklist"
+widget "gtk-tooltips" style "clearlooks-tooltips"
+
+# treeview stuff
+widget_class "*.GtkTreeView.GtkButton" style "clearlooks-tree"
+widget_class "*.GtkCTree.GtkButton" style "clearlooks-tree"
+widget_class "*.GtkList.GtkButton" style "clearlooks-tree"
+widget_class "*.GtkCList.GtkButton" style "clearlooks-tree"
+widget_class "*.GtkFrame.GtkLabel" style "clearlooks-frame-title"
+
+# notebook stuff
+widget_class "*.GtkNotebook.*.GtkEventBox" style "clearlooks-notebook"
+widget_class "*.GtkNotebook.*.GtkViewport" style "clearlooks-notebook"
+
+gtk-font-name="Lucida Grande 12"
+gtk-icon-theme-name = "gnome"
+gtk-icon-sizes = "gtk-menu=16,16:gtk-dialog=48,48:gtk-dnd=32,32:gtk-button=20,20:gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:wireshark-decoration=12,12"
+
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/pre_gtkrc b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/pre_gtkrc
new file mode 100644 (file)
index 0000000..bc8952e
--- /dev/null
@@ -0,0 +1,508 @@
+#
+# GTK theme to be used on Mac OS X, to mimic the appearance of Tiger
+#
+# $Id$
+# 
+# Heavily based on Clearlooks-Quicksilver
+# Scrollbars from OSX-theme by Lauri Taimila (lauri@taimila.com)
+# 
+# (c) 2007 JiHO <jo.irisson@gmail.com>. 
+# GNU General Public License http://www.gnu.org/copyleft/gpl.html
+#
+
+style "clearlooks-default"
+{
+       GtkButton               ::default_border         = { 0, 0, 0, 0 }
+       GtkRange                        ::trough_border  = 0
+       GtkPaned                        ::handle_size            = 6
+       GtkRange                        ::slider_width           = 15
+       GtkRange                        ::stepper_size           = 15
+       GtkScrollbar    ::min_slider_length = 30
+       GtkCheckButton  ::indicator_size         = 12
+       GtkMenuBar              ::internal-padding       = 0
+       GtkTreeView             ::expander_size  = 14
+       GtkExpander             ::expander_size  = 16
+
+       xthickness = 1
+       ythickness = 1
+
+       fg[NORMAL]                      = "#000000" # black
+       fg[PRELIGHT]            = "#000000" # black
+       fg[SELECTED]            = "#ffffff" # white 
+       fg[ACTIVE]                      = "#000000" # black
+       fg[INSENSITIVE] = {0.6, 0.6, 0.6} # dark gray
+
+       bg[NORMAL]                      = {0.95, 0.95, 0.95} # very light gray
+       bg[PRELIGHT]            = "#ffffff" # white
+       bg[SELECTED]            = OSX_MENU_COLOR_PLACEHOLDER    # menu color
+       bg[INSENSITIVE] = {0.9, 0.9, 0.9} # light gray
+       bg[ACTIVE]                      = {0.85, 0.85, 0.85} # gray
+
+       base[NORMAL]            = "#ffffff" # white 
+       base[PRELIGHT]          = OSX_MENU_COLOR_PLACEHOLDER # menu color
+       base[ACTIVE]            = {0.6, 0.6, 0.6} # dark gray
+       base[SELECTED]          = OSX_HILI_COLOR_PLACEHOLDER # highlight color
+       base[INSENSITIVE] = {0.9, 0.9, 0.9} # light gray
+
+       text[NORMAL]            = "#000000" # black
+       text[PRELIGHT]          = "#000000" # black
+       text[ACTIVE]            = "#ffffff" # white
+       text[SELECTED]          = "#ffffff" # white
+       text[INSENSITIVE]       = {0.6, 0.6, 0.6} # dark gray
+
+       engine "clearlooks" 
+       {
+       menubarstyle            = 1             # 0 = flat, 1 = sunken, 2 = flat gradient
+       menuitemstyle           = 0             # 0 = flat, 1 = 3d-ish (gradient), 2 = 3d-ish (button)
+       listviewitemstyle       = 0             # 0 = flat, 1 = 3d-ish (gradient)
+       progressbarstyle        = 0             # 0 = candy bar, 1 = flat
+       }
+}
+       
+
+style "clearlooks-wide" = "clearlooks-default"
+{
+       xthickness = 2
+       ythickness = 2
+}
+
+style "clearlooks-button" = "clearlooks-default"
+{
+       xthickness = 3
+       ythickness = 3
+
+       bg[NORMAL] = "#f0f1f2" # a hint of blue...
+}
+
+style "clearlooks-notebook" = "clearlooks-wide"
+{
+       bg[NORMAL] = {0.93, 0.93, 0.93}
+       bg[INSENSITIVE] = {0.93, 0.93, 0.93}
+}
+
+style "clearlooks-tasklist" = "clearlooks-default"
+{
+       xthickness = 5
+       ythickness = 3
+}
+
+style "clearlooks-menu" = "clearlooks-default"
+{
+       xthickness = 2
+       ythickness = 1
+       bg[NORMAL] = "#ffffff"
+}
+
+style "clearlooks-menu-item" = "clearlooks-default"
+{
+       xthickness = 2
+       ythickness = 3
+       fg[PRELIGHT] = "#ffffff"
+       text[PRELIGHT] = "#ffffff"
+       # We want PRELIGHT to be white for widgets, but coloured for the menu.
+       bg[PRELIGHT]            = OSX_MENU_COLOR_PLACEHOLDER
+
+}
+
+style "clearlooks-menu-itembar" = "clearlooks-default"
+{
+       xthickness = 3
+       ythickness = 3
+}
+
+style "clearlooks-tree" = "clearlooks-default"
+{
+       xthickness = 2
+       ythickness = 2
+}
+
+style "clearlooks-frame-title" = "clearlooks-default"
+{
+       fg[NORMAL] = "#404040"
+}
+
+style "clearlooks-tooltips" = "clearlooks-default"
+{
+       xthickness = 4
+       ythickness = 4
+       bg[NORMAL] = { 1.0,1.0,0.75 }
+}
+
+style "clearlooks-progressbar" = "clearlooks-default"
+{
+       xthickness = 1
+       ythickness = 1
+
+       fg[PRELIGHT]    = "#ffffff"
+}
+
+style "clearlooks-combo" = "clearlooks-default"
+{
+       xthickness = 2
+       ythickness = 3
+}
+
+# Added pixmaps for scollbars
+style "scrollbar" = "default"
+{
+       # The values I set here have to do with the relative size of three graphic elements
+       # I have used: the slider, the arrow box, and the trough. They all have the same width
+       # of 15 pixels, but gtk wants to put in some spacing between them. It seems like it
+       # places the sliders inside the trough with a default 1 pixel border on either side of the slider,
+       # so that the trough has its width stretched by an additional two pixels(?). Setting the
+       # trough border makes the arrow box sit on top of the trough squarely, by making sure that
+       # the trough stays the same width as the arrowbox(?). I could be totally wrong here.
+       GtkRange::trough_border = 0
+       GtkRange::slider_width = 15
+
+       # This sets the size of the steppers (arrow buttons on the end of the scrollbar). 
+       # The image I am using is 15x15 pixels, and if I dont set this a one pixel line 
+       # gets cut off of the top of the "up" stepper.
+       GtkRange::stepper_size = 15
+
+       # Set a minimum length for the slider. Since I set the border on the slider 
+       # image to 15 pixels on either end of the slider I want the min length to be 
+       # at least 30 pixels to avoid an ugly slider when gtk wants to make it smaller 
+       # than 30 pixels.
+       GtkScrollbar::min_slider_length = 30
+
+       engine "pixmap" 
+       {
+               # Horizontal slider background
+               image 
+               {
+                       function                = BOX
+                       recolorable             = TRUE
+                       detail                  = "trough"
+                       file                    = "Scrollbars/trough-scrollbar-horiz.png"
+                       border                  = { 30, 30, 0, 0 }
+                       stretch                 = TRUE
+                       orientation             = HORIZONTAL
+               }
+               
+               # Vertical slider background
+               image 
+               {
+                       function                = BOX
+                       recolorable             = TRUE
+                       detail                  = "trough"
+                       file                    = "Scrollbars/trough-scrollbar-vert.png"
+                       border                  = { 0, 0, 30, 30 }
+                       stretch                 = TRUE
+                       orientation             = VERTICAL
+               }
+
+               # Normal horizontal slider
+               image 
+               {
+                       function                = SLIDER
+                       recolorable             = TRUE
+                       state                   = NORMAL
+                       file                    = "Scrollbars_AQUASTYLE_PLACEHOLDER/slider-horiz.png"
+                       border                  = { 15, 15, 6, 6 }
+                       stretch                 = TRUE
+                       orientation             = HORIZONTAL
+               }
+               
+               # Horizontal slider (active)
+               image 
+               {
+                       function                = SLIDER
+                       recolorable             = TRUE
+                       state                   = ACTIVE
+                       file                    = "Scrollbars_AQUASTYLE_PLACEHOLDER/slider-horiz-prelight.png"
+                       border                  = { 15, 15, 6, 6 }
+                       stretch                 = TRUE
+                       orientation             = HORIZONTAL
+               }
+
+               # Horizontal slider (mouse over)
+               image 
+               {
+                       function                = SLIDER 
+                       recolorable             = TRUE
+                       state                   = PRELIGHT
+                       file                    = "Scrollbars_AQUASTYLE_PLACEHOLDER/slider-horiz-prelight.png"
+                       border                  = { 15, 15, 6, 6 }
+                       stretch                 = TRUE
+                       orientation             = HORIZONTAL
+               }
+               
+               # Horizontal slider (Insesitive)
+               image 
+               {
+                       function                = SLIDER 
+                       recolorable             = TRUE
+                       state                   = INSENSITIVE
+                       file                    = "Scrollbars_AQUASTYLE_PLACEHOLDER/slider-horiz.png"
+                       border                  = { 15, 15, 6, 6 }
+                       stretch                 = TRUE
+                       orientation             = HORIZONTAL
+               }
+
+               # Normal vertical slider
+               image 
+               {
+                       function                = SLIDER
+                       recolorable             = TRUE
+                       state                   = NORMAL
+                       file                    = "Scrollbars_AQUASTYLE_PLACEHOLDER/slider-vert.png"
+                       border                  = { 6, 6, 15, 15 }
+                       stretch                 = TRUE
+                       orientation             = VERTICAL
+               }
+               
+               # Vertical slider (Active)
+               image 
+               {
+                       function                = SLIDER
+                       recolorable             = TRUE
+                       state                   = ACTIVE
+                       file                    = "Scrollbars_AQUASTYLE_PLACEHOLDER/slider-vert.png"
+                       border                  = { 6, 6, 15, 15 }
+                       stretch                 = TRUE
+                       orientation             = VERTICAL
+               }
+
+               # Vertical slider (mouse over)
+               image 
+               {
+                       function                = SLIDER 
+                       recolorable             = TRUE
+                       state                   = PRELIGHT
+                       file                    = "Scrollbars_AQUASTYLE_PLACEHOLDER/slider-vert-prelight.png"
+                       border                  = { 6, 6, 15, 15 }
+                       stretch                 = TRUE
+                       orientation             = VERTICAL
+               }
+               
+               # Vertical slider (Insesitive)
+               image 
+               {
+                       function                = SLIDER 
+                       recolorable             = TRUE
+                       state                   = INSENSITIVE
+                       file                    = "Scrollbars_AQUASTYLE_PLACEHOLDER/slider-vert-prelight.png"
+                       border                  = { 6, 6, 15, 15 }
+                       stretch                 = TRUE
+                       orientation             = VERTICAL
+               }
+
+################################################################################
+# SCROLLBAR STEPPERS
+################################################################################
+
+       # Up
+       image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = NORMAL
+               file                            = "Scrollbars/stepper-up.png"
+               #border                 = { 12, 2, 2, 9 }
+               stretch                 = TRUE
+               arrow_direction = UP
+       }
+       image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = PRELIGHT
+               file                            = "Scrollbars/stepper-up.png"
+               #border                 = { 12, 2, 2, 9 }
+               stretch                 = TRUE
+               arrow_direction = UP
+       }
+ image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = ACTIVE
+               file                            = "Scrollbars/stepper-up.png"
+               #border                 = { 12, 2, 2, 9 }
+               stretch                 = TRUE
+               arrow_direction = UP
+       }
+ image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = INSENSITIVE
+               file                            = "Scrollbars/stepper-up.png"
+               #border                 = { 12, 2, 2, 9 }
+               stretch                 = TRUE
+               arrow_direction = UP
+       }
+
+ ######### DOWN ############
+
+
+       image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = NORMAL
+               file                            = "Scrollbars/stepper-down.png"
+               #border                 = { 12, 2, 10, 2 }
+               stretch                 = TRUE
+               arrow_direction = DOWN
+       }
+ image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = PRELIGHT
+               file                            = "Scrollbars/stepper-down.png"
+               #border                 = { 12, 2, 10, 2 }
+               stretch                 = TRUE
+               arrow_direction = DOWN
+       }
+ image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = ACTIVE
+               file                            = "Scrollbars/stepper-down.png"
+               #border                 = { 12, 2, 10, 2 }
+               stretch                 = TRUE
+               arrow_direction = DOWN
+       }
+ image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = INSENSITIVE
+               file                            = "Scrollbars/stepper-down.png"
+               #border                 = { 12, 2, 10, 2 }
+               stretch                 = TRUE
+               arrow_direction = DOWN
+       }
+
+############ RIGHT ################
+
+       image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = NORMAL
+               file                            = "Scrollbars/stepper-right.png"
+               #border                 = { 2, 9, 2, 13 }
+               stretch                 = TRUE
+               arrow_direction = RIGHT
+       }
+ image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = PRELIGHT
+               file                            = "Scrollbars/stepper-right.png"
+               #border                 = { 2, 9, 2, 13 }
+               stretch                 = TRUE
+               arrow_direction = RIGHT
+       }
+ image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = ACTIVE
+               file                            = "Scrollbars/stepper-right.png"
+               #border                 = { 2, 9, 2, 13 }
+               stretch                 = TRUE
+               arrow_direction = RIGHT
+       }
+ image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = INSENSITIVE
+               file                            = "Scrollbars/stepper-right.png"
+               #border                 = { 2, 9, 2, 13 }
+               stretch                 = TRUE
+               arrow_direction = RIGHT
+       }
+
+############### LEFT ###################
+
+
+       image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = NORMAL
+               file                            = "Scrollbars/stepper-left.png"
+               #border                 = { 2, 9, 2, 13 }
+               stretch                 = TRUE
+               arrow_direction = LEFT
+       }
+       image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = PRELIGHT
+               file                            = "Scrollbars/stepper-left.png"
+               #border                 = { 2, 9, 2, 13 }
+               stretch                 = TRUE
+               arrow_direction = LEFT
+       }
+       image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = ACTIVE
+               file                            = "Scrollbars/stepper-left.png"
+               #border                 = { 2, 9, 2, 13 }
+               stretch                 = TRUE
+               arrow_direction = LEFT
+       }
+       image 
+       {
+               function                        = STEPPER
+               recolorable             = TRUE
+               state                           = INSENSITIVE
+               file                            = "Scrollbars/stepper-left.png"
+               #border                 = { 2, 9, 2, 13 }
+               stretch                 = TRUE
+               arrow_direction = LEFT
+       }
+       }
+}
+
+# widget styles
+class "GtkWidget" style "clearlooks-default"
+class "GtkButton" style "clearlooks-button"
+class "GtkCombo"       style "clearlooks-button"
+class "GtkRange"       style "clearlooks-wide"
+class "GtkFrame"       style "clearlooks-wide"
+class "GtkMenu"                style "clearlooks-menu"
+class "GtkEntry"       style "clearlooks-button"
+class "GtkMenuItem"             style "clearlooks-menu-item"
+class "GtkStatusbar"    style "clearlooks-wide"
+class "GtkNotebook"             style "clearlooks-notebook"
+class "GtkProgressBar" style "clearlooks-progressbar"
+class "GtkScrollbar"    style "scrollbar"
+
+widget_class "*MenuItem.*" style "clearlooks-menu-item"
+
+# combobox stuff
+widget_class "*.GtkComboBox.GtkButton" style "clearlooks-combo"
+widget_class "*.GtkCombo.GtkButton"             style "clearlooks-combo"
+
+# tooltips stuff
+widget_class "*.tooltips.*.GtkToggleButton" style "clearlooks-tasklist"
+widget "gtk-tooltips" style "clearlooks-tooltips"
+
+# treeview stuff
+widget_class "*.GtkTreeView.GtkButton" style "clearlooks-tree"
+widget_class "*.GtkCTree.GtkButton" style "clearlooks-tree"
+widget_class "*.GtkList.GtkButton" style "clearlooks-tree"
+widget_class "*.GtkCList.GtkButton" style "clearlooks-tree"
+widget_class "*.GtkFrame.GtkLabel" style "clearlooks-frame-title"
+
+# notebook stuff
+widget_class "*.GtkNotebook.*.GtkEventBox" style "clearlooks-notebook"
+widget_class "*.GtkNotebook.*.GtkViewport" style "clearlooks-notebook"
+
+gtk-font-name="Lucida Grande 12"
+gtk-icon-theme-name = "gnome"
+gtk-icon-sizes = "gtk-menu=16,16:gtk-dialog=48,48:gtk-dnd=32,32:gtk-button=20,20:gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:inkscape-decoration=12,12"
+
diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/sync_osx_look.sh b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/sync_osx_look.sh
new file mode 100755 (executable)
index 0000000..7dbfc7d
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# $Id$
+#
+#      Reads defaults from Apple preferences and modifies GTK accordingly
+#
+#      (c) 2007 JiHO <jo.irisson@gmail.com>
+#      GNU General Public License http://www.gnu.org/copyleft/gpl.html
+#
+
+# Appearance setting
+aquaStyle=`defaults read "Apple Global Domain" AppleAquaColorVariant`
+# 1 for aqua, 6 for graphite, inexistant if the default color was never changed
+if [[ "$aquaStyle" == "" ]]; then
+       aquaStyle=1             # set aqua as default
+fi
+
+# Highlight Color setting
+hiliColor=`defaults read "Apple Global Domain" AppleHighlightColor`
+# a RGB value, with components between 0 and 1, also inexistant if it was not changed
+if [[ "$hiliColor" == "" ]]; then
+       hiliColor="0.709800 0.835300 1.000000"  # set blue as default
+fi
+
+# Menu items color
+if [[ aquaStyle -eq 1 ]]; then
+       menuColor="#4a76cd"     # blue
+else
+       menuColor="#7c8da4"     # graphite
+fi
+# Format highlight color as a GTK rgb value
+hiliColorFormated=`echo $hiliColor | awk -F " " '{print "\\\{"$1","$2","$3"\\\}"}'`
+
+# echo $menuColor
+# echo $hiliColorFormated
+
+# Modify the gtkrc
+#      - with the correct colors
+#      - to point to the correct scrollbars folder
+sed 's/OSX_HILI_COLOR_PLACEHOLDER/'$hiliColorFormated'/g' pre_gtkrc | sed 's/OSX_MENU_COLOR_PLACEHOLDER/\"'$menuColor'\"/g' | sed 's/AQUASTYLE_PLACEHOLDER/'$aquaStyle'/g' > gtkrc
diff --git a/packaging/macosx/Resources/wsicondoc.icns b/packaging/macosx/Resources/wsicondoc.icns
new file mode 100644 (file)
index 0000000..d2dbb2b
Binary files /dev/null and b/packaging/macosx/Resources/wsicondoc.icns differ
diff --git a/packaging/macosx/ScriptExec/English.lproj/InfoPlist.strings b/packaging/macosx/ScriptExec/English.lproj/InfoPlist.strings
new file mode 100644 (file)
index 0000000..0bb6ef5
Binary files /dev/null and b/packaging/macosx/ScriptExec/English.lproj/InfoPlist.strings differ
diff --git a/packaging/macosx/ScriptExec/English.lproj/main.nib/classes.nib b/packaging/macosx/ScriptExec/English.lproj/main.nib/classes.nib
new file mode 100644 (file)
index 0000000..ea58db1
--- /dev/null
@@ -0,0 +1,4 @@
+{
+IBClasses = ();
+IBVersion = 1;
+}
diff --git a/packaging/macosx/ScriptExec/English.lproj/main.nib/info.nib b/packaging/macosx/ScriptExec/English.lproj/main.nib/info.nib
new file mode 100644 (file)
index 0000000..2e31b4a
--- /dev/null
@@ -0,0 +1,20 @@
+<?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">
+<!-- $Id$ -->
+<plist version="1.0">
+<dict>
+       <key>IBFramework Version</key>
+       <string>345.0</string>
+       <key>IBOldestOS</key>
+       <integer>3</integer>
+       <key>IBOpenObjects</key>
+       <array>
+               <integer>29</integer>
+               <integer>166</integer>
+       </array>
+       <key>IBSystem Version</key>
+       <string>7B44</string>
+       <key>targetFramework</key>
+       <string>IBCarbonFramework</string>
+</dict>
+</plist>
diff --git a/packaging/macosx/ScriptExec/English.lproj/main.nib/objects.xib b/packaging/macosx/ScriptExec/English.lproj/main.nib/objects.xib
new file mode 100644 (file)
index 0000000..e802d71
--- /dev/null
@@ -0,0 +1,272 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- $Id$ -->
+<object class="NSIBObjectData">
+  <string name="targetFramework">IBCarbonFramework</string>
+  <object name="rootObject" class="NSCustomObject" id="1">
+    <string name="customClass">NSApplication</string>
+  </object>
+  <array count="38" name="allObjects">
+    <object class="IBCarbonMenu" id="29">
+      <string name="title">main</string>
+      <array count="4" name="items">
+        <object class="IBCarbonMenuItem" id="185">
+          <string name="title">Foo</string>
+          <object name="submenu" class="IBCarbonMenu" id="184">
+            <string name="title">Foo</string>
+            <array count="1" name="items">
+              <object class="IBCarbonMenuItem" id="187">
+                <string name="title">About Foo</string>
+                <int name="keyEquivalentModifier">0</int>
+                <ostype name="command">abou</ostype>
+              </object>
+            </array>
+            <string name="name">_NSAppleMenu</string>
+          </object>
+        </object>
+        <object class="IBCarbonMenuItem" id="127">
+          <string name="title">File</string>
+          <object name="submenu" class="IBCarbonMenu" id="131">
+            <string name="title">File</string>
+            <array count="10" name="items">
+              <object class="IBCarbonMenuItem" id="139">
+                <string name="title">New</string>
+                <string name="keyEquivalent">n</string>
+                <ostype name="command">new </ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="134">
+                <string name="title">Open…</string>
+                <string name="keyEquivalent">o</string>
+                <ostype name="command">open</ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="133">
+                <boolean name="separator">TRUE</boolean>
+              </object>
+              <object class="IBCarbonMenuItem" id="130">
+                <string name="title">Close</string>
+                <string name="keyEquivalent">w</string>
+                <ostype name="command">clos</ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="138">
+                <string name="title">Save</string>
+                <string name="keyEquivalent">s</string>
+                <ostype name="command">save</ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="137">
+                <string name="title">Save As…</string>
+                <string name="keyEquivalent">S</string>
+                <ostype name="command">svas</ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="132">
+                <string name="title">Revert</string>
+                <string name="keyEquivalent">r</string>
+                <ostype name="command">rvrt</ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="128">
+                <boolean name="separator">TRUE</boolean>
+              </object>
+              <object class="IBCarbonMenuItem" id="135">
+                <string name="title">Page Setup…</string>
+                <string name="keyEquivalent">P</string>
+                <ostype name="command">page</ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="136">
+                <string name="title">Print…</string>
+                <string name="keyEquivalent">p</string>
+                <ostype name="command">prnt</ostype>
+              </object>
+            </array>
+          </object>
+        </object>
+        <object class="IBCarbonMenuItem" id="152">
+          <string name="title">Edit</string>
+          <object name="submenu" class="IBCarbonMenu" id="147">
+            <string name="title">Edit</string>
+            <array count="10" name="items">
+              <object class="IBCarbonMenuItem" id="141">
+                <string name="title">Undo</string>
+                <string name="keyEquivalent">z</string>
+                <ostype name="command">undo</ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="146">
+                <string name="title">Redo</string>
+                <string name="keyEquivalent">Z</string>
+                <ostype name="command">redo</ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="142">
+                <boolean name="separator">TRUE</boolean>
+              </object>
+              <object class="IBCarbonMenuItem" id="143">
+                <string name="title">Cut</string>
+                <string name="keyEquivalent">x</string>
+                <ostype name="command">cut </ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="149">
+                <string name="title">Copy</string>
+                <string name="keyEquivalent">c</string>
+                <ostype name="command">copy</ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="144">
+                <string name="title">Paste</string>
+                <string name="keyEquivalent">v</string>
+                <ostype name="command">past</ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="151">
+                <string name="title">Delete</string>
+                <ostype name="command">clea</ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="148">
+                <string name="title">Select All</string>
+                <string name="keyEquivalent">a</string>
+                <ostype name="command">sall</ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="199">
+                <boolean name="separator">TRUE</boolean>
+              </object>
+              <object class="IBCarbonMenuItem" id="198">
+                <string name="title">Special Characters…</string>
+                <ostype name="command">chrp</ostype>
+              </object>
+            </array>
+          </object>
+        </object>
+        <object class="IBCarbonMenuItem" id="192">
+          <string name="title">Window</string>
+          <object name="submenu" class="IBCarbonMenu" id="195">
+            <string name="title">Window</string>
+            <array count="6" name="items">
+              <object class="IBCarbonMenuItem" id="197">
+                <string name="title">Zoom Window</string>
+                <ostype name="command">zoom</ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="190">
+                <boolean name="dynamic">TRUE</boolean>
+                <string name="title">Minimize Window</string>
+                <string name="keyEquivalent">m</string>
+                <ostype name="command">mini</ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="191">
+                <boolean name="dynamic">TRUE</boolean>
+                <string name="title">Minimize All Windows</string>
+                <string name="keyEquivalent">m</string>
+                <int name="keyEquivalentModifier">1572864</int>
+                <ostype name="command">mina</ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="194">
+                <boolean name="separator">TRUE</boolean>
+              </object>
+              <object class="IBCarbonMenuItem" id="196">
+                <boolean name="dynamic">TRUE</boolean>
+                <string name="title">Bring All to Front</string>
+                <ostype name="command">bfrt</ostype>
+              </object>
+              <object class="IBCarbonMenuItem" id="193">
+                <boolean name="dynamic">TRUE</boolean>
+                <string name="title">Arrange in Front</string>
+                <int name="keyEquivalentModifier">1572864</int>
+                <ostype name="command">frnt</ostype>
+              </object>
+            </array>
+            <string name="name">_NSWindowsMenu</string>
+          </object>
+        </object>
+      </array>
+      <string name="name">_NSMainMenu</string>
+    </object>
+    <reference idRef="127"/>
+    <reference idRef="128"/>
+    <reference idRef="130"/>
+    <reference idRef="131"/>
+    <reference idRef="132"/>
+    <reference idRef="133"/>
+    <reference idRef="134"/>
+    <reference idRef="135"/>
+    <reference idRef="136"/>
+    <reference idRef="137"/>
+    <reference idRef="138"/>
+    <reference idRef="139"/>
+    <reference idRef="141"/>
+    <reference idRef="142"/>
+    <reference idRef="143"/>
+    <reference idRef="144"/>
+    <reference idRef="146"/>
+    <reference idRef="147"/>
+    <reference idRef="148"/>
+    <reference idRef="149"/>
+    <reference idRef="151"/>
+    <reference idRef="152"/>
+    <object class="IBCarbonWindow" id="166">
+      <string name="windowRect">204 300 564 780 </string>
+      <string name="title">Window</string>
+      <object name="rootControl" class="IBCarbonRootControl" id="167">
+        <string name="bounds">0 0 360 480 </string>
+        <string name="viewFrame">0 0 480 360 </string>
+      </object>
+      <boolean name="receiveUpdates">FALSE</boolean>
+      <boolean name="liveResize">TRUE</boolean>
+      <boolean name="compositing">TRUE</boolean>
+    </object>
+    <reference idRef="167"/>
+    <reference idRef="184"/>
+    <reference idRef="185"/>
+    <reference idRef="187"/>
+    <reference idRef="190"/>
+    <reference idRef="191"/>
+    <reference idRef="192"/>
+    <reference idRef="193"/>
+    <reference idRef="194"/>
+    <reference idRef="195"/>
+    <reference idRef="196"/>
+    <reference idRef="197"/>
+    <reference idRef="198"/>
+    <reference idRef="199"/>
+  </array>
+  <array count="38" name="allParents">
+    <reference idRef="1"/>
+    <reference idRef="29"/>
+    <reference idRef="131"/>
+    <reference idRef="131"/>
+    <reference idRef="127"/>
+    <reference idRef="131"/>
+    <reference idRef="131"/>
+    <reference idRef="131"/>
+    <reference idRef="131"/>
+    <reference idRef="131"/>
+    <reference idRef="131"/>
+    <reference idRef="131"/>
+    <reference idRef="131"/>
+    <reference idRef="147"/>
+    <reference idRef="147"/>
+    <reference idRef="147"/>
+    <reference idRef="147"/>
+    <reference idRef="147"/>
+    <reference idRef="152"/>
+    <reference idRef="147"/>
+    <reference idRef="147"/>
+    <reference idRef="147"/>
+    <reference idRef="29"/>
+    <reference idRef="1"/>
+    <reference idRef="166"/>
+    <reference idRef="185"/>
+    <reference idRef="29"/>
+    <reference idRef="184"/>
+    <reference idRef="195"/>
+    <reference idRef="195"/>
+    <reference idRef="29"/>
+    <reference idRef="195"/>
+    <reference idRef="195"/>
+    <reference idRef="192"/>
+    <reference idRef="195"/>
+    <reference idRef="195"/>
+    <reference idRef="147"/>
+    <reference idRef="147"/>
+  </array>
+  <dictionary count="3" name="nameTable">
+    <string>Files Owner</string>
+    <reference idRef="1"/>
+    <string>MainWindow</string>
+    <reference idRef="166"/>
+    <string>MenuBar</string>
+    <reference idRef="29"/>
+  </dictionary>
+  <unsigned_int name="nextObjectID">200</unsigned_int>
+</object>
diff --git a/packaging/macosx/ScriptExec/Info.plist b/packaging/macosx/ScriptExec/Info.plist
new file mode 100644 (file)
index 0000000..5b1fcc6
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<!-- $Id$ -->
+<plist version="0.9">
+<dict>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>English</string>
+       <key>CFBundleDocumentTypes</key>
+       <array>
+               <dict>
+                       <key>CFBundleTypeExtensions</key>
+                       <array>
+                               <string>*</string>
+                       </array>
+                       <key>CFBundleTypeName</key>
+                       <string>All</string>
+                       <key>CFBundleTypeOSTypes</key>
+                       <array>
+                               <string>****</string>
+                       </array>
+                       <key>CFBundleTypeRole</key>
+                       <string>Viewer</string>
+               </dict>
+       </array>
+       <key>CFBundleExecutable</key>
+       <string>ScriptExec</string>
+       <key>CFBundleIconFile</key>
+       <string></string>
+       <key>CFBundleIdentifier</key>
+       <string>com.apple.myCarbonNibApp</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundlePackageType</key>
+       <string>APPL</string>
+       <key>CFBundleSignature</key>
+       <string>????</string>
+       <key>CFBundleVersion</key>
+       <string>1.1</string>
+</dict>
+</plist>
diff --git a/packaging/macosx/ScriptExec/MenuBar.nib/classes.nib b/packaging/macosx/ScriptExec/MenuBar.nib/classes.nib
new file mode 100644 (file)
index 0000000..ea58db1
--- /dev/null
@@ -0,0 +1,4 @@
+{
+IBClasses = ();
+IBVersion = 1;
+}
diff --git a/packaging/macosx/ScriptExec/MenuBar.nib/info.nib b/packaging/macosx/ScriptExec/MenuBar.nib/info.nib
new file mode 100644 (file)
index 0000000..4c42cc8
--- /dev/null
@@ -0,0 +1,24 @@
+<?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">
+<!-- $Id$ -->
+<plist version="1.0">
+<dict>
+       <key>IBDocumentLocation</key>
+       <string>99 362 356 240 0 0 1280 832 </string>
+       <key>IBEditorPositions</key>
+       <dict>
+               <key>187</key>
+               <string>340 374 240 44 0 0 1280 832 </string>
+       </dict>
+       <key>IBFramework Version</key>
+       <string>349.0</string>
+       <key>IBOpenObjects</key>
+       <array>
+               <integer>187</integer>
+       </array>
+       <key>IBSystem Version</key>
+       <string>7F44</string>
+       <key>targetFramework</key>
+       <string>IBCarbonFramework</string>
+</dict>
+</plist>
diff --git a/packaging/macosx/ScriptExec/MenuBar.nib/objects.xib b/packaging/macosx/ScriptExec/MenuBar.nib/objects.xib
new file mode 100644 (file)
index 0000000..2f61c2e
--- /dev/null
@@ -0,0 +1,74 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- $Id$ -->
+<object class="NSIBObjectData">
+  <string name="targetFramework">IBCarbonFramework</string>
+  <object name="rootObject" class="NSCustomObject" id="1">
+    <string name="customClass">NSApplication</string>
+  </object>
+  <array count="4" name="allObjects">
+    <object class="IBCarbonMenu" id="187">
+      <string name="title">MenuBar</string>
+      <array count="1" name="items">
+        <object class="IBCarbonMenuItem" id="195">
+          <string name="title">ScriptExec</string>
+          <object name="submenu" class="IBCarbonMenu" id="193">
+            <string name="title">ScriptExec</string>
+            <string name="name">_NSAppleMenu</string>
+          </object>
+        </object>
+      </array>
+      <string name="name">_NSMainMenu</string>
+    </object>
+    <reference idRef="193"/>
+    <reference idRef="195"/>
+    <object class="IBCarbonMenuItem" id="204">
+      <string name="title">Window</string>
+      <object name="submenu" class="IBCarbonMenu">
+        <string name="title">Window</string>
+        <array count="5" name="items">
+          <object class="IBCarbonMenuItem">
+            <boolean name="dynamic">TRUE</boolean>
+            <string name="title">Minimize Window</string>
+            <string name="keyEquivalent">m</string>
+            <ostype name="command">mini</ostype>
+          </object>
+          <object class="IBCarbonMenuItem">
+            <boolean name="dynamic">TRUE</boolean>
+            <string name="title">Minimize All Windows</string>
+            <string name="keyEquivalent">m</string>
+            <int name="keyEquivalentModifier">1572864</int>
+            <ostype name="command">mini</ostype>
+          </object>
+          <object class="IBCarbonMenuItem">
+            <boolean name="separator">TRUE</boolean>
+          </object>
+          <object class="IBCarbonMenuItem">
+            <boolean name="dynamic">TRUE</boolean>
+            <string name="title">Bring All to Front</string>
+            <ostype name="command">frnt</ostype>
+          </object>
+          <object class="IBCarbonMenuItem">
+            <boolean name="dynamic">TRUE</boolean>
+            <string name="title">Bring in Front</string>
+            <int name="keyEquivalentModifier">1572864</int>
+            <ostype name="command">frnt</ostype>
+          </object>
+        </array>
+        <string name="name">_NSWindowsMenu</string>
+      </object>
+    </object>
+  </array>
+  <array count="4" name="allParents">
+    <reference idRef="1"/>
+    <reference idRef="195"/>
+    <reference idRef="187"/>
+    <reference idRef="187"/>
+  </array>
+  <dictionary count="2" name="nameTable">
+    <string>File&apos;s Owner</string>
+    <reference idRef="1"/>
+    <string>MenuBar</string>
+    <reference idRef="187"/>
+  </dictionary>
+  <unsigned_int name="nextObjectID">206</unsigned_int>
+</object>
diff --git a/packaging/macosx/ScriptExec/ScriptExec.xcode/project.pbxproj b/packaging/macosx/ScriptExec/ScriptExec.xcode/project.pbxproj
new file mode 100644 (file)
index 0000000..bc081d5
--- /dev/null
@@ -0,0 +1,451 @@
+// !$*UTF8*$!
+{
+       archiveVersion = 1;
+       classes = {
+       };
+       objectVersion = 39;
+       objects = {
+               0249A66BFF388E3F11CA2CEA = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = archive.ar;
+                       name = "libstdc++.a";
+                       path = "/usr/lib/libstdc++.a";
+                       refType = 0;
+                       sourceTree = "<absolute>";
+               };
+//020
+//021
+//022
+//023
+//024
+//080
+//081
+//082
+//083
+//084
+               0867D6AAFE840B52C02AAC07 = {
+                       children = (
+                               0867D6ABFE840B52C02AAC07,
+                       );
+                       isa = PBXVariantGroup;
+                       name = InfoPlist.strings;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               0867D6ABFE840B52C02AAC07 = {
+                       fileEncoding = 10;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text.plist.strings;
+                       name = English;
+                       path = English.lproj/InfoPlist.strings;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+//080
+//081
+//082
+//083
+//084
+//190
+//191
+//192
+//193
+//194
+               195DF8CFFE9D517E11CA2CBB = {
+                       children = (
+                               8D0C4E970486CD37000505A6,
+                       );
+                       isa = PBXGroup;
+                       name = Products;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+//190
+//191
+//192
+//193
+//194
+//200
+//201
+//202
+//203
+//204
+               20286C28FDCF999611CA2CEA = {
+                       buildSettings = {
+                       };
+                       buildStyles = (
+                               4A9504C5FFE6A39111CA0CBA,
+                               4A9504C6FFE6A39111CA0CBA,
+                       );
+                       hasScannedForEncodings = 1;
+                       isa = PBXProject;
+                       mainGroup = 20286C29FDCF999611CA2CEA;
+                       projectDirPath = "";
+                       targets = (
+                               8D0C4E890486CD37000505A6,
+                       );
+               };
+               20286C29FDCF999611CA2CEA = {
+                       children = (
+                               20286C2AFDCF999611CA2CEA,
+                               20286C2CFDCF999611CA2CEA,
+                               20286C32FDCF999611CA2CEA,
+                               195DF8CFFE9D517E11CA2CBB,
+                       );
+                       isa = PBXGroup;
+                       name = ScriptExec;
+                       path = "";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               20286C2AFDCF999611CA2CEA = {
+                       children = (
+                               32DBCF6D0370B57F00C91783,
+                               20286C2BFDCF999611CA2CEA,
+                       );
+                       isa = PBXGroup;
+                       name = Sources;
+                       path = "";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               20286C2BFDCF999611CA2CEA = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.c;
+                       path = main.c;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               20286C2CFDCF999611CA2CEA = {
+                       children = (
+                               664C29F0060ECDC4006EC560,
+                               B8DCE042056DAC3500C390B0,
+                               8D0C4E960486CD37000505A6,
+                               B8DCE048056DAC5000C390B0,
+                               0867D6AAFE840B52C02AAC07,
+                       );
+                       isa = PBXGroup;
+                       name = Resources;
+                       path = "";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               20286C32FDCF999611CA2CEA = {
+                       children = (
+                               20286C33FDCF999611CA2CEA,
+                               4A9504CAFFE6A41611CA0CBA,
+                               4A9504C8FFE6A3BC11CA0CBA,
+                               0249A66BFF388E3F11CA2CEA,
+                               B8DCE04E056DACAE00C390B0,
+                       );
+                       isa = PBXGroup;
+                       name = "External Frameworks and Libraries";
+                       path = "";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               20286C33FDCF999611CA2CEA = {
+                       fallbackIsa = PBXFileReference;
+                       isa = PBXFrameworkReference;
+                       lastKnownFileType = wrapper.framework;
+                       name = Carbon.framework;
+                       path = /System/Library/Frameworks/Carbon.framework;
+                       refType = 0;
+                       sourceTree = "<absolute>";
+               };
+//200
+//201
+//202
+//203
+//204
+//320
+//321
+//322
+//323
+//324
+               32DBCF6D0370B57F00C91783 = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       path = ScriptExec_Prefix.pch;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+//320
+//321
+//322
+//323
+//324
+//4A0
+//4A1
+//4A2
+//4A3
+//4A4
+               4A9504C5FFE6A39111CA0CBA = {
+                       buildRules = (
+                       );
+                       buildSettings = {
+                               COPY_PHASE_STRIP = NO;
+                               DEBUGGING_SYMBOLS = YES;
+                               GCC_DYNAMIC_NO_PIC = NO;
+                               GCC_ENABLE_FIX_AND_CONTINUE = YES;
+                               GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+                               GCC_OPTIMIZATION_LEVEL = 0;
+                               OPTIMIZATION_CFLAGS = "-O0";
+                               ZERO_LINK = YES;
+                       };
+                       isa = PBXBuildStyle;
+                       name = Development;
+               };
+               4A9504C6FFE6A39111CA0CBA = {
+                       buildRules = (
+                       );
+                       buildSettings = {
+                               COPY_PHASE_STRIP = YES;
+                               GCC_ENABLE_FIX_AND_CONTINUE = NO;
+                               GCC_OPTIMIZATION_LEVEL = s;
+                               ZERO_LINK = NO;
+                       };
+                       isa = PBXBuildStyle;
+                       name = Deployment;
+               };
+               4A9504C8FFE6A3BC11CA0CBA = {
+                       fallbackIsa = PBXFileReference;
+                       isa = PBXFrameworkReference;
+                       lastKnownFileType = wrapper.framework;
+                       name = ApplicationServices.framework;
+                       path = /System/Library/Frameworks/ApplicationServices.framework;
+                       refType = 0;
+                       sourceTree = "<absolute>";
+               };
+               4A9504CAFFE6A41611CA0CBA = {
+                       fallbackIsa = PBXFileReference;
+                       isa = PBXFrameworkReference;
+                       lastKnownFileType = wrapper.framework;
+                       name = CoreServices.framework;
+                       path = /System/Library/Frameworks/CoreServices.framework;
+                       refType = 0;
+                       sourceTree = "<absolute>";
+               };
+//4A0
+//4A1
+//4A2
+//4A3
+//4A4
+//660
+//661
+//662
+//663
+//664
+               664C29F0060ECDC4006EC560 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text.script.sh;
+                       path = openDoc;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               664C29F1060ECDC4006EC560 = {
+                       fileRef = 664C29F0060ECDC4006EC560;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+//660
+//661
+//662
+//663
+//664
+//8D0
+//8D1
+//8D2
+//8D3
+//8D4
+               8D0C4E890486CD37000505A6 = {
+                       buildPhases = (
+                               8D0C4E8A0486CD37000505A6,
+                               8D0C4E8C0486CD37000505A6,
+                               8D0C4E8F0486CD37000505A6,
+                               8D0C4E910486CD37000505A6,
+                               8D0C4E940486CD37000505A6,
+                       );
+                       buildRules = (
+                       );
+                       buildSettings = {
+                               FRAMEWORK_SEARCH_PATHS = "";
+                               GCC_ENABLE_TRIGRAPHS = NO;
+                               GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+                               GCC_PRECOMPILE_PREFIX_HEADER = YES;
+                               GCC_PREFIX_HEADER = ScriptExec_Prefix.pch;
+                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
+                               GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
+                               GCC_WARN_UNKNOWN_PRAGMAS = NO;
+                               HEADER_SEARCH_PATHS = "";
+                               INFOPLIST_FILE = Info.plist;
+                               INSTALL_PATH = "$(HOME)/Applications";
+                               LIBRARY_SEARCH_PATHS = "";
+                               LIBRARY_STYLE = Static;
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_REZFLAGS = "";
+                               PRODUCT_NAME = ScriptExec;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+                               WRAPPER_EXTENSION = app;
+                       };
+                       dependencies = (
+                       );
+                       isa = PBXNativeTarget;
+                       name = ScriptExec;
+                       productInstallPath = "$(HOME)/Applications";
+                       productName = ScriptExec;
+                       productReference = 8D0C4E970486CD37000505A6;
+                       productType = "com.apple.product-type.application";
+               };
+               8D0C4E8A0486CD37000505A6 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               8D0C4E8B0486CD37000505A6,
+                       );
+                       isa = PBXHeadersBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               8D0C4E8B0486CD37000505A6 = {
+                       fileRef = 32DBCF6D0370B57F00C91783;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               8D0C4E8C0486CD37000505A6 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               8D0C4E8D0486CD37000505A6,
+                               B8DCE045056DAC3500C390B0,
+                               B8DCE049056DAC5000C390B0,
+                               664C29F1060ECDC4006EC560,
+                       );
+                       isa = PBXResourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               8D0C4E8D0486CD37000505A6 = {
+                       fileRef = 0867D6AAFE840B52C02AAC07;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               8D0C4E8F0486CD37000505A6 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               8D0C4E900486CD37000505A6,
+                       );
+                       isa = PBXSourcesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               8D0C4E900486CD37000505A6 = {
+                       fileRef = 20286C2BFDCF999611CA2CEA;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                               );
+                       };
+               };
+               8D0C4E910486CD37000505A6 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                               8D0C4E920486CD37000505A6,
+                               8D0C4E930486CD37000505A6,
+                               B8DCE04F056DACAE00C390B0,
+                       );
+                       isa = PBXFrameworksBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               8D0C4E920486CD37000505A6 = {
+                       fileRef = 20286C33FDCF999611CA2CEA;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               8D0C4E930486CD37000505A6 = {
+                       fileRef = 0249A66BFF388E3F11CA2CEA;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               8D0C4E940486CD37000505A6 = {
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       isa = PBXRezBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               8D0C4E960486CD37000505A6 = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text.plist;
+                       path = Info.plist;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               8D0C4E970486CD37000505A6 = {
+                       explicitFileType = wrapper.application;
+                       includeInIndex = 0;
+                       isa = PBXFileReference;
+                       path = ScriptExec.app;
+                       refType = 3;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
+//8D0
+//8D1
+//8D2
+//8D3
+//8D4
+//B80
+//B81
+//B82
+//B83
+//B84
+               B8DCE042056DAC3500C390B0 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = wrapper.nib;
+                       path = MenuBar.nib;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               B8DCE045056DAC3500C390B0 = {
+                       fileRef = B8DCE042056DAC3500C390B0;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               B8DCE048056DAC5000C390B0 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text.script.sh;
+                       path = script;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               B8DCE049056DAC5000C390B0 = {
+                       fileRef = B8DCE048056DAC5000C390B0;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               B8DCE04E056DACAE00C390B0 = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = wrapper.framework;
+                       name = Security.framework;
+                       path = /System/Library/Frameworks/Security.framework;
+                       refType = 0;
+                       sourceTree = "<absolute>";
+               };
+               B8DCE04F056DACAE00C390B0 = {
+                       fileRef = B8DCE04E056DACAE00C390B0;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+       };
+       rootObject = 20286C28FDCF999611CA2CEA;
+}
diff --git a/packaging/macosx/ScriptExec/ScriptExec.xcodeproj/project.pbxproj b/packaging/macosx/ScriptExec/ScriptExec.xcodeproj/project.pbxproj
new file mode 100644 (file)
index 0000000..3d0fe01
--- /dev/null
@@ -0,0 +1,351 @@
+// !$*UTF8*$!
+{
+       archiveVersion = 1;
+       classes = {
+       };
+       objectVersion = 42;
+       objects = {
+
+/* Begin PBXBuildFile section */
+               664C29F1060ECDC4006EC560 /* openDoc in Resources */ = {isa = PBXBuildFile; fileRef = 664C29F0060ECDC4006EC560 /* openDoc */; };
+               8D0C4E8B0486CD37000505A6 /* ScriptExec_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32DBCF6D0370B57F00C91783 /* ScriptExec_Prefix.pch */; };
+               8D0C4E8D0486CD37000505A6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */; };
+               8D0C4E900486CD37000505A6 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 20286C2BFDCF999611CA2CEA /* main.c */; settings = {ATTRIBUTES = (); }; };
+               8D0C4E920486CD37000505A6 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20286C33FDCF999611CA2CEA /* Carbon.framework */; };
+               8D0C4E930486CD37000505A6 /* libstdc++.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0249A66BFF388E3F11CA2CEA /* libstdc++.a */; };
+               B8DCE045056DAC3500C390B0 /* MenuBar.nib in Resources */ = {isa = PBXBuildFile; fileRef = B8DCE042056DAC3500C390B0 /* MenuBar.nib */; };
+               B8DCE049056DAC5000C390B0 /* script in Resources */ = {isa = PBXBuildFile; fileRef = B8DCE048056DAC5000C390B0 /* script */; };
+               B8DCE04F056DACAE00C390B0 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8DCE04E056DACAE00C390B0 /* Security.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+               0249A66BFF388E3F11CA2CEA /* libstdc++.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libstdc++.a"; path = "/usr/lib/libstdc++.a"; sourceTree = "<absolute>"; };
+               0867D6ABFE840B52C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+               20286C2BFDCF999611CA2CEA /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
+               20286C33FDCF999611CA2CEA /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
+               32DBCF6D0370B57F00C91783 /* ScriptExec_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptExec_Prefix.pch; sourceTree = "<group>"; };
+               4A9504C8FFE6A3BC11CA0CBA /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; };
+               4A9504CAFFE6A41611CA0CBA /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; };
+               664C29F0060ECDC4006EC560 /* openDoc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = openDoc; sourceTree = "<group>"; };
+               8D0C4E960486CD37000505A6 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
+               8D0C4E970486CD37000505A6 /* ScriptExec.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ScriptExec.app; sourceTree = BUILT_PRODUCTS_DIR; };
+               B8DCE042056DAC3500C390B0 /* MenuBar.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = MenuBar.nib; sourceTree = "<group>"; };
+               B8DCE048056DAC5000C390B0 /* script */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = script; sourceTree = "<group>"; };
+               B8DCE04E056DACAE00C390B0 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+               8D0C4E910486CD37000505A6 /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               8D0C4E920486CD37000505A6 /* Carbon.framework in Frameworks */,
+                               8D0C4E930486CD37000505A6 /* libstdc++.a in Frameworks */,
+                               B8DCE04F056DACAE00C390B0 /* Security.framework in Frameworks */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+               195DF8CFFE9D517E11CA2CBB /* Products */ = {
+                       isa = PBXGroup;
+                       children = (
+                               8D0C4E970486CD37000505A6 /* ScriptExec.app */,
+                       );
+                       name = Products;
+                       sourceTree = "<group>";
+               };
+               20286C29FDCF999611CA2CEA /* ScriptExec */ = {
+                       isa = PBXGroup;
+                       children = (
+                               20286C2AFDCF999611CA2CEA /* Sources */,
+                               20286C2CFDCF999611CA2CEA /* Resources */,
+                               20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */,
+                               195DF8CFFE9D517E11CA2CBB /* Products */,
+                       );
+                       name = ScriptExec;
+                       sourceTree = "<group>";
+               };
+               20286C2AFDCF999611CA2CEA /* Sources */ = {
+                       isa = PBXGroup;
+                       children = (
+                               32DBCF6D0370B57F00C91783 /* ScriptExec_Prefix.pch */,
+                               20286C2BFDCF999611CA2CEA /* main.c */,
+                       );
+                       name = Sources;
+                       sourceTree = "<group>";
+               };
+               20286C2CFDCF999611CA2CEA /* Resources */ = {
+                       isa = PBXGroup;
+                       children = (
+                               664C29F0060ECDC4006EC560 /* openDoc */,
+                               B8DCE042056DAC3500C390B0 /* MenuBar.nib */,
+                               8D0C4E960486CD37000505A6 /* Info.plist */,
+                               B8DCE048056DAC5000C390B0 /* script */,
+                               0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */,
+                       );
+                       name = Resources;
+                       sourceTree = "<group>";
+               };
+               20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */ = {
+                       isa = PBXGroup;
+                       children = (
+                               20286C33FDCF999611CA2CEA /* Carbon.framework */,
+                               4A9504CAFFE6A41611CA0CBA /* CoreServices.framework */,
+                               4A9504C8FFE6A3BC11CA0CBA /* ApplicationServices.framework */,
+                               0249A66BFF388E3F11CA2CEA /* libstdc++.a */,
+                               B8DCE04E056DACAE00C390B0 /* Security.framework */,
+                       );
+                       name = "External Frameworks and Libraries";
+                       sourceTree = "<group>";
+               };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+               8D0C4E8A0486CD37000505A6 /* Headers */ = {
+                       isa = PBXHeadersBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               8D0C4E8B0486CD37000505A6 /* ScriptExec_Prefix.pch in Headers */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+               8D0C4E890486CD37000505A6 /* ScriptExec */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = 78E9AE160A36A8E3000D76A8 /* Build configuration list for PBXNativeTarget "ScriptExec" */;
+                       buildPhases = (
+                               8D0C4E8A0486CD37000505A6 /* Headers */,
+                               8D0C4E8C0486CD37000505A6 /* Resources */,
+                               8D0C4E8F0486CD37000505A6 /* Sources */,
+                               8D0C4E910486CD37000505A6 /* Frameworks */,
+                               8D0C4E940486CD37000505A6 /* Rez */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                       );
+                       name = ScriptExec;
+                       productInstallPath = "$(HOME)/Applications";
+                       productName = ScriptExec;
+                       productReference = 8D0C4E970486CD37000505A6 /* ScriptExec.app */;
+                       productType = "com.apple.product-type.application";
+               };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+               20286C28FDCF999611CA2CEA /* Project object */ = {
+                       isa = PBXProject;
+                       buildConfigurationList = 78E9AE1A0A36A8E3000D76A8 /* Build configuration list for PBXProject "ScriptExec" */;
+                       hasScannedForEncodings = 1;
+                       mainGroup = 20286C29FDCF999611CA2CEA /* ScriptExec */;
+                       projectDirPath = "";
+                       targets = (
+                               8D0C4E890486CD37000505A6 /* ScriptExec */,
+                       );
+               };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+               8D0C4E8C0486CD37000505A6 /* Resources */ = {
+                       isa = PBXResourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               8D0C4E8D0486CD37000505A6 /* InfoPlist.strings in Resources */,
+                               B8DCE045056DAC3500C390B0 /* MenuBar.nib in Resources */,
+                               B8DCE049056DAC5000C390B0 /* script in Resources */,
+                               664C29F1060ECDC4006EC560 /* openDoc in Resources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXRezBuildPhase section */
+               8D0C4E940486CD37000505A6 /* Rez */ = {
+                       isa = PBXRezBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXRezBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+               8D0C4E8F0486CD37000505A6 /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               8D0C4E900486CD37000505A6 /* main.c in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+               0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */ = {
+                       isa = PBXVariantGroup;
+                       children = (
+                               0867D6ABFE840B52C02AAC07 /* English */,
+                       );
+                       name = InfoPlist.strings;
+                       sourceTree = "<group>";
+               };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+               78E9AE170A36A8E3000D76A8 /* Development */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               COPY_PHASE_STRIP = NO;
+                               DEBUGGING_SYMBOLS = YES;
+                               FRAMEWORK_SEARCH_PATHS = "";
+                               GCC_DYNAMIC_NO_PIC = NO;
+                               GCC_ENABLE_FIX_AND_CONTINUE = YES;
+                               GCC_ENABLE_TRIGRAPHS = NO;
+                               GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+                               GCC_OPTIMIZATION_LEVEL = 0;
+                               GCC_PRECOMPILE_PREFIX_HEADER = YES;
+                               GCC_PREFIX_HEADER = ScriptExec_Prefix.pch;
+                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
+                               GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
+                               GCC_WARN_UNKNOWN_PRAGMAS = NO;
+                               HEADER_SEARCH_PATHS = "";
+                               INFOPLIST_FILE = Info.plist;
+                               INSTALL_PATH = "$(HOME)/Applications";
+                               LIBRARY_SEARCH_PATHS = "";
+                               LIBRARY_STYLE = Static;
+                               OPTIMIZATION_CFLAGS = "-O0";
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_REZFLAGS = "";
+                               PRODUCT_NAME = ScriptExec;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = (
+                                       "-Wmost",
+                                       "-Wno-four-char-constants",
+                                       "-Wno-unknown-pragmas",
+                               );
+                               WRAPPER_EXTENSION = app;
+                               ZERO_LINK = YES;
+                       };
+                       name = Development;
+               };
+               78E9AE180A36A8E3000D76A8 /* Deployment */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               COPY_PHASE_STRIP = YES;
+                               FRAMEWORK_SEARCH_PATHS = "";
+                               GCC_ENABLE_FIX_AND_CONTINUE = NO;
+                               GCC_ENABLE_TRIGRAPHS = NO;
+                               GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+                               GCC_OPTIMIZATION_LEVEL = s;
+                               GCC_PRECOMPILE_PREFIX_HEADER = YES;
+                               GCC_PREFIX_HEADER = ScriptExec_Prefix.pch;
+                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
+                               GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
+                               GCC_WARN_UNKNOWN_PRAGMAS = NO;
+                               HEADER_SEARCH_PATHS = "";
+                               INFOPLIST_FILE = Info.plist;
+                               INSTALL_PATH = "$(HOME)/Applications";
+                               LIBRARY_SEARCH_PATHS = "";
+                               LIBRARY_STYLE = Static;
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_REZFLAGS = "";
+                               PRODUCT_NAME = ScriptExec;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = (
+                                       "-Wmost",
+                                       "-Wno-four-char-constants",
+                                       "-Wno-unknown-pragmas",
+                               );
+                               WRAPPER_EXTENSION = app;
+                               ZERO_LINK = NO;
+                       };
+                       name = Deployment;
+               };
+               78E9AE190A36A8E3000D76A8 /* Default */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               FRAMEWORK_SEARCH_PATHS = "";
+                               GCC_ENABLE_TRIGRAPHS = NO;
+                               GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+                               GCC_PRECOMPILE_PREFIX_HEADER = YES;
+                               GCC_PREFIX_HEADER = ScriptExec_Prefix.pch;
+                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
+                               GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
+                               GCC_WARN_UNKNOWN_PRAGMAS = NO;
+                               HEADER_SEARCH_PATHS = "";
+                               INFOPLIST_FILE = Info.plist;
+                               INSTALL_PATH = "$(HOME)/Applications";
+                               LIBRARY_SEARCH_PATHS = "";
+                               LIBRARY_STYLE = Static;
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               OTHER_REZFLAGS = "";
+                               PRODUCT_NAME = ScriptExec;
+                               SECTORDER_FLAGS = "";
+                               WARNING_CFLAGS = (
+                                       "-Wmost",
+                                       "-Wno-four-char-constants",
+                                       "-Wno-unknown-pragmas",
+                               );
+                               WRAPPER_EXTENSION = app;
+                       };
+                       name = Default;
+               };
+               78E9AE1B0A36A8E3000D76A8 /* Development */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+                       };
+                       name = Development;
+               };
+               78E9AE1C0A36A8E3000D76A8 /* Deployment */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ARCHS = (
+                                       ppc,
+                                       i386,
+                               );
+                               SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+                       };
+                       name = Deployment;
+               };
+               78E9AE1D0A36A8E3000D76A8 /* Default */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+                       };
+                       name = Default;
+               };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+               78E9AE160A36A8E3000D76A8 /* Build configuration list for PBXNativeTarget "ScriptExec" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               78E9AE170A36A8E3000D76A8 /* Development */,
+                               78E9AE180A36A8E3000D76A8 /* Deployment */,
+                               78E9AE190A36A8E3000D76A8 /* Default */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Default;
+               };
+               78E9AE1A0A36A8E3000D76A8 /* Build configuration list for PBXProject "ScriptExec" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               78E9AE1B0A36A8E3000D76A8 /* Development */,
+                               78E9AE1C0A36A8E3000D76A8 /* Deployment */,
+                               78E9AE1D0A36A8E3000D76A8 /* Default */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Default;
+               };
+/* End XCConfigurationList section */
+       };
+       rootObject = 20286C28FDCF999611CA2CEA /* Project object */;
+}
diff --git a/packaging/macosx/ScriptExec/ScriptExec_Prefix.pch b/packaging/macosx/ScriptExec/ScriptExec_Prefix.pch
new file mode 100644 (file)
index 0000000..16d7ede
--- /dev/null
@@ -0,0 +1,5 @@
+//
+// Prefix header for all source files of the 'ScriptExec' target in the 'ScriptExec' project.
+//
+
+#include <Carbon/Carbon.h>
diff --git a/packaging/macosx/ScriptExec/main.c b/packaging/macosx/ScriptExec/main.c
new file mode 100644 (file)
index 0000000..138b526
--- /dev/null
@@ -0,0 +1,790 @@
+/*
+    Platypus - create MacOS X application bundles that execute scripts
+        This is the executable that goes into Platypus apps
+    Copyright (C) 2003 Sveinbjorn Thordarson <sveinbt@hi.is>
+
+    $Id$
+
+    With modifications by Aaron Voisine for gimp.app
+    With modifications by Marianne gagnon for Wilber-loves-apple
+    With modifications by Michael Wybrow for Inkscape.app
+    With modifications by Gerald Combs for Wireshark.app
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+    main.c - main program file
+
+*/
+
+/*
+ * This app laucher basically takes care of:
+ * - launching Wireshark and X11 when double-clicked
+ * - bringing X11 to the top when its icon is clicked in the dock (via a small applescript)
+ * - catch file dropped on icon events (and double-clicked gimp documents) and notify gimp.
+ * - catch quit events performed outside gimp, e.g. on the dock icon.
+ */
+
+///////////////////////////////////////
+// Includes
+///////////////////////////////////////
+#pragma mark Includes
+
+// Apple stuff
+#include <Carbon/Carbon.h>
+#include <CoreFoundation/CoreFoundation.h>
+#include <Security/Authorization.h>
+#include <Security/AuthorizationTags.h>
+
+// Unix stuff
+#include <string.h>
+#include <unistd.h>
+#include <sys/wait.h>
+#include <pthread.h>
+#include <stdio.h>
+
+///////////////////////////////////////
+// Definitions
+///////////////////////////////////////
+#pragma mark Definitions
+
+// name length limits
+#define        kMaxPathLength 1024
+
+// names of files bundled with app
+#define        kScriptFileName "script"
+#define kOpenDocFileName "openDoc"
+
+// custom carbon events
+#define kEventClassRedFatalAlert 911
+#define kEventKindX11Failed 911
+#define kEventKindFCCacheFailed 912
+
+//maximum arguments the script accepts
+#define        kMaxArgumentsToScript 252
+
+///////////////////////////////////////
+// Prototypes
+///////////////////////////////////////
+#pragma mark Prototypes
+
+static void *Execute(void *arg);
+static void *OpenDoc(void *arg);
+static OSErr ExecuteScript(char *script, pid_t *pid);
+
+static void  GetParameters(void);
+static char* GetScript(void);
+static char* GetOpenDoc(void);
+
+OSErr LoadMenuBar(char *appName);
+
+static OSStatus FSMakePath(FSSpec file, char *path, long maxPathSize);
+static void RedFatalAlert(Str255 errorString, Str255 expStr);
+static short DoesFileExist(char *path);
+static OSStatus FixFCCache(void);
+
+static OSErr AppQuitAEHandler(const AppleEvent *theAppleEvent,
+                              AppleEvent *reply, long refCon);
+static OSErr AppOpenDocAEHandler(const AppleEvent *theAppleEvent,
+                                 AppleEvent *reply, long refCon);
+static OSErr AppOpenAppAEHandler(const AppleEvent *theAppleEvent,
+                                 AppleEvent *reply, long refCon);
+static OSStatus X11FailedHandler(EventHandlerCallRef theHandlerCall,
+                                 EventRef theEvent, void *userData);
+static OSStatus FCCacheFailedHandler(EventHandlerCallRef theHandlerCall,
+                                 EventRef theEvent, void *userData);
+static OSErr AppReopenAppAEHandler(const AppleEvent *theAppleEvent,
+                                   AppleEvent *reply, long refCon);
+
+static OSStatus CompileAppleScript(const void* text, long textLength,
+                                  AEDesc *resultData);
+static OSStatus SimpleCompileAppleScript(const char* theScript);
+static void runScript();
+
+///////////////////////////////////////
+// Globals
+///////////////////////////////////////
+#pragma mark Globals
+
+// process id of forked process
+pid_t pid = 0;
+
+// thread id of threads that start scripts
+pthread_t odtid = 0, tid = 0;
+
+// indicator of whether the script has completed executing
+short taskDone = true;
+
+// execution parameters
+char scriptPath[kMaxPathLength];
+char openDocPath[kMaxPathLength];
+
+//arguments to the script
+char *arguments[kMaxArgumentsToScript+3];
+char *fileArgs[kMaxArgumentsToScript];
+short numArgs = 0;
+
+extern char **environ;
+
+#pragma mark -
+
+///////////////////////////////////////
+// Program entrance point
+///////////////////////////////////////
+int main(int argc, char* argv[])
+{
+    OSErr err = noErr;
+    EventTypeSpec X11events = { kEventClassRedFatalAlert, kEventKindX11Failed };
+    EventTypeSpec FCCacheEvents = { kEventClassRedFatalAlert, kEventKindFCCacheFailed };
+
+    InitCursor();
+
+    //install Apple Event handlers
+    err += AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,
+                                 NewAEEventHandlerUPP(AppQuitAEHandler),
+                                 0, false);
+    err += AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,
+                                 NewAEEventHandlerUPP(AppOpenDocAEHandler),
+                                 0, false);
+    err += AEInstallEventHandler(kCoreEventClass, kAEOpenApplication,
+                                 NewAEEventHandlerUPP(AppOpenAppAEHandler),
+                                 0, false);
+
+    err += AEInstallEventHandler(kCoreEventClass, kAEReopenApplication,
+                                 NewAEEventHandlerUPP(AppReopenAppAEHandler),
+                                 0, false);
+
+    err += InstallEventHandler(GetApplicationEventTarget(),
+                               NewEventHandlerUPP(X11FailedHandler), 1,
+                               &X11events, NULL, NULL);
+    err += InstallEventHandler(GetApplicationEventTarget(),
+                               NewEventHandlerUPP(FCCacheFailedHandler), 1,
+                               &FCCacheEvents, NULL, NULL);
+
+    if (err) RedFatalAlert("\pInitialization Error",
+                           "\pError initing Apple Event handlers.");
+
+    //create the menu bar
+    if (err = LoadMenuBar(NULL)) RedFatalAlert("\pInitialization Error",
+                                               "\pError loading MenuBar.nib.");
+
+    GetParameters(); //load data from files containing exec settings
+
+    // compile "icon clicked" script so it's ready to execute
+    SimpleCompileAppleScript("tell application \"X11\" to activate");
+
+    RunApplicationEventLoop(); //Run the event loop
+    return 0;
+}
+
+#pragma mark -
+
+
+static void RequestUserAttention(void)
+{
+    NMRecPtr notificationRequest = (NMRecPtr) NewPtr(sizeof(NMRec));
+
+    memset(notificationRequest, 0, sizeof(*notificationRequest));
+    notificationRequest->qType = nmType;
+    notificationRequest->nmMark = 1;
+    notificationRequest->nmIcon = 0;
+    notificationRequest->nmSound = 0;
+    notificationRequest->nmStr = NULL;
+    notificationRequest->nmResp = NULL;
+
+    verify_noerr(NMInstall(notificationRequest));
+}
+
+
+static void ShowFirstStartWarningDialog(void)
+{
+    SInt16 itemHit;
+
+    AlertStdAlertParamRec params;
+    params.movable = true;
+    params.helpButton = false;
+    params.filterProc = NULL;
+    params.defaultText = (void *) kAlertDefaultOKText;
+    params.cancelText = NULL;
+    params.otherText = NULL;
+    params.defaultButton = kAlertStdAlertOKButton;
+    params.cancelButton = kAlertStdAlertCancelButton;
+    params.position = kWindowDefaultPosition;
+
+    StandardAlert(kAlertNoteAlert, "\pWireshark on Mac OS X",
+            "\pWhile Wireshark is open, its windows can be displayed or hidden by displaying or hiding the X11 application.\n\nThe first time this version of Wireshark is run it may take several minutes before the main window is displayed while font caches are built.",
+            &params, &itemHit);
+}
+
+
+//////////////////////////////////
+// Handler for when fontconfig caches need to be generated
+//////////////////////////////////
+static OSStatus FCCacheFailedHandler(EventHandlerCallRef theHandlerCall,
+                                 EventRef theEvent, void *userData)
+{
+
+    pthread_join(tid, NULL);
+    if (odtid) pthread_join(odtid, NULL);
+
+    // Bounce Wireshark Dock icon
+    RequestUserAttention();
+    // Need to show warning to the user, then carry on.
+    ShowFirstStartWarningDialog();
+
+    // Note that we've seen the warning.
+    system("test -d \"$HOME/.wireshark\" || mkdir \"$HOME/.wireshark\"; "
+           "touch \"$HOME/.wireshark/.fccache-new\"");
+    // Rerun now.
+    OSErr err = ExecuteScript(scriptPath, &pid);
+    ExitToShell();
+
+    return noErr;
+}
+
+
+static size_t safeRead(int d, void *buf, size_t nbytes)
+{
+       ssize_t bytesToRead = nbytes;
+       ssize_t bytesRead = 0;
+       char *offset = (char *) buf;
+
+       while ((bytesToRead > 0))
+       {
+               bytesRead = read(d, offset, bytesToRead);
+               if (bytesRead > 0)
+               {
+                       offset += bytesRead;
+                       bytesToRead -= bytesRead;
+               }
+               else if (bytesRead == 0)
+               {
+                       // Reached EOF.
+                       break;
+               }
+               else if (bytesRead == -1)
+               {
+                       if ((errno == EINTR) || (errno == EAGAIN))
+                       {
+                               // Try again.
+                               continue;
+                       }
+                       return 0;
+               }
+       }
+       return bytesRead;
+}
+
+
+/////////////////////////////////////
+// Code to run fc-cache on first run
+/////////////////////////////////////
+static OSStatus FixFCCache (void)
+{
+       FILE *fileConnToChild = NULL;
+       int fdConnToChild = 0;
+       pid_t childPID = WAIT_ANY;
+       size_t bytesChildPID;
+       size_t bytesRead;
+       int status;
+
+       char commandStr[] = "/usr/X11R6/bin/fc-cache";
+       char *commandArgs[] = { "-f", NULL };
+
+       // Run fc-cache
+       AuthorizationItem authItems[] =
+       {
+       {
+               kAuthorizationRightExecute,
+               strlen(commandStr),
+               commandStr,
+               0
+       }
+       };
+       AuthorizationItemSet authItemSet =
+       {
+               1,
+               authItems
+       };
+       AuthorizationRef authRef = NULL;
+       OSStatus err = AuthorizationCreate (NULL, &authItemSet,
+                       kAuthorizationFlagInteractionAllowed |
+                       kAuthorizationFlagExtendRights, &authRef);
+
+       if (err == errAuthorizationSuccess)
+       {
+               err = AuthorizationExecuteWithPrivileges(authRef, commandStr,
+                               kAuthorizationFlagDefaults, commandArgs,
+                               &fileConnToChild);
+
+               if (err == errAuthorizationSuccess)
+               {
+                       // Unfortunately, AuthorizationExecuteWithPrivileges
+                       // does not return the process ID associated with the
+                       // process it runs.  The best solution we have it to
+                       // try and get the process ID from the file descriptor.
+                       // This is based on example code from Apple's
+                       // MoreAuthSample.
+
+                       fdConnToChild = fileno(fileConnToChild);
+
+                       // Try an get the process ID of the fc-cache command
+                       bytesChildPID = sizeof(childPID);
+                       bytesRead = safeRead(fdConnToChild, &childPID,
+                                       bytesChildPID);
+                       if (bytesRead != bytesChildPID)
+                       {
+                               // If we can't get it the best alternative
+                               // is to wait for any child to finish.
+                               childPID = WAIT_ANY;
+                       }
+
+                       if (fileConnToChild != NULL) {
+                               fclose(fileConnToChild);
+                       }
+
+                       // Wait for child process to finish.
+                       waitpid(childPID, &status, 0);
+               }
+       }
+       AuthorizationFree(authRef, kAuthorizationFlagDestroyRights);
+
+       return err;
+}
+
+
+///////////////////////////////////
+// Execution thread starts here
+///////////////////////////////////
+static void *Execute (void *arg)
+{
+    EventRef event;
+
+    taskDone = false;
+
+    OSErr err = ExecuteScript(scriptPath, &pid);
+    if (err == (OSErr)11) {
+        CreateEvent(NULL, kEventClassRedFatalAlert, kEventKindX11Failed, 0,
+                    kEventAttributeNone, &event);
+        PostEventToQueue(GetMainEventQueue(), event, kEventPriorityStandard);
+    }
+    else if (err == (OSErr)12) {
+        CreateEvent(NULL, kEventClassRedFatalAlert, kEventKindFCCacheFailed, 0,
+                    kEventAttributeNone, &event);
+        PostEventToQueue(GetMainEventQueue(), event, kEventPriorityHigh);
+    }
+    else ExitToShell();
+    return 0;
+}
+
+///////////////////////////////////
+// Open additional documents thread starts here
+///////////////////////////////////
+static void *OpenDoc (void *arg)
+{
+    ExecuteScript(openDocPath, NULL);
+    return 0;
+}
+
+///////////////////////////////////////
+// Run a script via the system command
+///////////////////////////////////////
+static OSErr ExecuteScript (char *script, pid_t *pid)
+{
+    pid_t wpid = 0, p = 0;
+    int status, i;
+
+    if (! pid) pid = &p;
+
+    // Generate the array of argument strings before we do any executing
+    arguments[0] = script;
+    for (i = 0; i < numArgs; i++) arguments[i + 1] = fileArgs[i];
+    arguments[i + 1] = NULL;
+
+    *pid = fork(); //open fork
+
+    if (*pid == (pid_t)-1) exit(13); //error
+    else if (*pid == 0) { //child process started
+        execve(arguments[0], arguments, environ);
+        exit(13); //if we reach this point, there's an error
+    }
+
+    wpid = waitpid(*pid, &status, 0); //wait while child process finishes
+
+    if (wpid == (pid_t)-1) return wpid;
+    return (OSErr)WEXITSTATUS(status);
+}
+
+#pragma mark -
+
+///////////////////////////////////////
+// This function loads all the neccesary settings
+// from config files in the Resources folder
+///////////////////////////////////////
+static void GetParameters (void)
+{
+    char *str;
+    if (! (str = (char *)GetScript())) //get path to script to be executed
+        RedFatalAlert("\pInitialization Error",
+                      "\pError getting script from application bundle.");
+    strcpy((char *)&scriptPath, str);
+
+    if (! (str = (char *)GetOpenDoc())) //get path to openDoc
+        RedFatalAlert("\pInitialization Error",
+                      "\pError getting openDoc from application bundle.");
+    strcpy((char *)&openDocPath, str);
+}
+
+///////////////////////////////////////
+// Get path to the script in Resources folder
+///////////////////////////////////////
+static char* GetScript (void)
+{
+    CFStringRef fileName;
+    CFBundleRef appBundle;
+    CFURLRef scriptFileURL;
+    FSRef fileRef;
+    FSSpec fileSpec;
+    char *path;
+
+    //get CF URL for script
+    if (! (appBundle = CFBundleGetMainBundle())) return NULL;
+    if (! (fileName = CFStringCreateWithCString(NULL, kScriptFileName,
+                                                kCFStringEncodingASCII)))
+        return NULL;
+    if (! (scriptFileURL = CFBundleCopyResourceURL(appBundle, fileName, NULL,
+                                                   NULL))) return NULL;
+
+    //Get file reference from Core Foundation URL
+    if (! CFURLGetFSRef(scriptFileURL, &fileRef)) return NULL;
+
+    //dispose of the CF variables
+    CFRelease(scriptFileURL);
+    CFRelease(fileName);
+
+    //convert FSRef to FSSpec
+    if (FSGetCatalogInfo(&fileRef, kFSCatInfoNone, NULL, NULL, &fileSpec,
+                         NULL)) return NULL;
+
+    //create path string
+    if (! (path = malloc(kMaxPathLength))) return NULL;
+    if (FSMakePath(fileSpec, path, kMaxPathLength)) return NULL;
+    if (! DoesFileExist(path)) return NULL;
+
+    return path;
+}
+
+///////////////////////////////////////
+// Gets the path to openDoc in Resources folder
+///////////////////////////////////////
+static char* GetOpenDoc (void)
+{
+    CFStringRef fileName;
+    CFBundleRef appBundle;
+    CFURLRef openDocFileURL;
+    FSRef fileRef;
+    FSSpec fileSpec;
+    char *path;
+
+    //get CF URL for openDoc
+    if (! (appBundle = CFBundleGetMainBundle())) return NULL;
+    if (! (fileName = CFStringCreateWithCString(NULL, kOpenDocFileName,
+                                                kCFStringEncodingASCII)))
+        return NULL;
+    if (! (openDocFileURL = CFBundleCopyResourceURL(appBundle, fileName, NULL,
+                                                    NULL))) return NULL;
+
+    //Get file reference from Core Foundation URL
+    if (! CFURLGetFSRef( openDocFileURL, &fileRef )) return NULL;
+
+    //dispose of the CF variables
+    CFRelease(openDocFileURL);
+    CFRelease(fileName);
+
+    //convert FSRef to FSSpec
+    if (FSGetCatalogInfo(&fileRef, kFSCatInfoNone, NULL, NULL, &fileSpec,
+                         NULL)) return NULL;
+
+    //create path string
+    if (! (path = malloc(kMaxPathLength))) return NULL;
+    if (FSMakePath(fileSpec, path, kMaxPathLength)) return NULL;
+    if (! DoesFileExist(path)) return NULL;
+
+    return path;
+}
+
+#pragma mark -
+
+/////////////////////////////////////
+// Load menu bar from nib
+/////////////////////////////////////
+OSErr LoadMenuBar (char *appName)
+{
+    OSErr err;
+    IBNibRef nibRef;
+
+    if (err = CreateNibReference(CFSTR("MenuBar"), &nibRef)) return err;
+    if (err = SetMenuBarFromNib(nibRef, CFSTR("MenuBar"))) return err;
+    DisposeNibReference(nibRef);
+
+    return noErr;
+}
+
+#pragma mark -
+
+///////////////////////////////////////
+// Generate path string from FSSpec record
+///////////////////////////////////////
+static OSStatus FSMakePath(FSSpec file, char *path, long maxPathSize)
+{
+    OSErr err = noErr;
+    FSRef fileRef;
+
+    //create file reference from file spec
+    if (err = FSpMakeFSRef(&file, &fileRef)) return err;
+
+    // and then convert the FSRef to a path
+    return FSRefMakePath(&fileRef, path, maxPathSize);
+}
+
+////////////////////////////////////////
+// Standard red error alert, then exit application
+////////////////////////////////////////
+static void RedFatalAlert (Str255 errorString, Str255 expStr)
+{
+    StandardAlert(kAlertStopAlert, errorString,  expStr, NULL, NULL);
+    ExitToShell();
+}
+
+///////////////////////////////////////
+// Determines whether file exists at path or not
+///////////////////////////////////////
+static short DoesFileExist (char *path)
+{
+    if (access(path, F_OK) == -1) return false;
+    return true;
+}
+
+#pragma mark -
+
+///////////////////////////////////////
+// Apple Event handler for Quit i.e. from
+// the dock or Application menu item
+///////////////////////////////////////
+static OSErr AppQuitAEHandler(const AppleEvent *theAppleEvent,
+                              AppleEvent *reply, long refCon)
+{
+    #pragma unused (reply, refCon, theAppleEvent)
+
+    while (numArgs > 0) free(fileArgs[numArgs--]);
+
+    if (! taskDone && pid) { //kill the script process brutally
+        kill(pid, 9);
+        printf("Platypus App: PID %d killed brutally\n", pid);
+    }
+
+    pthread_cancel(tid);
+    if (odtid) pthread_cancel(odtid);
+
+    ExitToShell();
+
+    return noErr;
+}
+
+/////////////////////////////////////
+// Handler for docs dragged on app icon
+/////////////////////////////////////
+static OSErr AppOpenDocAEHandler(const AppleEvent *theAppleEvent,
+                                 AppleEvent *reply, long refCon)
+{
+    #pragma unused (reply, refCon)
+
+    OSErr err = noErr;
+    AEDescList fileSpecList;
+    AEKeyword keyword;
+    DescType type;
+
+    short i;
+    long count, actualSize;
+
+    FSSpec fileSpec;
+    char path[kMaxPathLength];
+
+    while (numArgs > 0) free(fileArgs[numArgs--]);
+
+    //Read the AppleEvent
+    err = AEGetParamDesc(theAppleEvent, keyDirectObject, typeAEList,
+                         &fileSpecList);
+
+    err = AECountItems(&fileSpecList, &count); //Count number of files
+
+    for (i = 1; i <= count; i++) { //iteratively process each file
+        //get fsspec from apple event
+        if (! (err = AEGetNthPtr(&fileSpecList, i, typeFSS, &keyword, &type,
+                                 (Ptr)&fileSpec, sizeof(FSSpec), &actualSize)))
+        {
+            //get path from file spec
+            if ((err = FSMakePath(fileSpec, (unsigned char *)&path,
+                                  kMaxPathLength))) return err;
+
+            if (numArgs == kMaxArgumentsToScript) break;
+
+            if (! (fileArgs[numArgs] = malloc(kMaxPathLength))) return true;
+
+            strcpy(fileArgs[numArgs++], (char *)&path);
+        }
+        else return err;
+    }
+
+    if (! taskDone) pthread_create(&odtid, NULL, OpenDoc, NULL);
+    else pthread_create(&tid, NULL, Execute, NULL);
+
+    return err;
+}
+
+///////////////////////////////
+// Handler for clicking on app icon
+///////////////////////////////
+// if app is already open
+static OSErr AppReopenAppAEHandler(const AppleEvent *theAppleEvent,
+                                 AppleEvent *reply, long refCon)
+{
+    runScript();
+}
+
+// if app is being opened
+static OSErr AppOpenAppAEHandler(const AppleEvent *theAppleEvent,
+                                 AppleEvent *reply, long refCon)
+{
+    #pragma unused (reply, refCon, theAppleEvent)
+
+    // the app has been opened without any items dragged on to it
+    pthread_create(&tid, NULL, Execute, NULL);
+
+    return noErr;
+}
+
+
+static void OpenURL(Str255 url)
+{
+       // Use Internet Config to hand the URL to the appropriate application, as
+       // set by the user in the Internet Preferences pane.
+       ICInstance icInstance;
+       // Applications creator code:
+       OSType signature = 'Inks';
+       OSStatus error = ICStart( &icInstance, signature );
+       if ( error == noErr )
+       {
+               ConstStr255Param hint = 0x0;
+               const char* data = url;
+               long length = strlen(url);
+               long start =  0;
+               long end = length;
+               // Don't bother testing return value (error); launched application will
+               // report problems.
+               ICLaunchURL( icInstance, hint, data, length, &start, &end );
+               ICStop( icInstance );
+       }
+}
+
+
+//////////////////////////////////
+// Handler for when X11 fails to start
+//////////////////////////////////
+static OSStatus X11FailedHandler(EventHandlerCallRef theHandlerCall,
+                                 EventRef theEvent, void *userData)
+{
+    #pragma unused(theHanderCall, theEvent, userData)
+
+    pthread_join(tid, NULL);
+    if (odtid) pthread_join(odtid, NULL);
+
+       SInt16 itemHit;
+       const char *getX11 = "\pGet X11 for Panther";
+
+       AlertStdAlertParamRec params;
+       params.movable = true;
+       params.helpButton = false;
+       params.filterProc = NULL;
+       params.defaultText = (StringPtr) kAlertDefaultOKText;
+       params.cancelText = getX11;
+       params.otherText = NULL;
+       params.defaultButton = kAlertStdAlertOKButton;
+       params.cancelButton = kAlertStdAlertCancelButton;
+       params.position = kWindowDefaultPosition;
+
+       StandardAlert(kAlertStopAlert, "\pFailed to start X11",
+                       "\pWireshark.app requires Apple's X11, which is freely downloadable from Apple's website for Panther (10.3.x) users and available as an optional install from the installation DVD for Tiger (10.4.x) users.\n\nPlease install X11 and restart Wireshark.",
+                       &params, &itemHit);
+
+       if (itemHit == kAlertStdAlertCancelButton)
+       {
+               OpenURL("http://www.apple.com/downloads/macosx/apple/macosx_updates/x11formacosx.html");
+       }
+
+    ExitToShell();
+
+
+    return noErr;
+}
+
+
+// Compile and run a small AppleScript. The code below does no cleanup and no proper error checks
+// but since it's there until the app is shut down, and since we know the script is okay,
+// there should not be any problems.
+ComponentInstance theComponent;
+AEDesc scriptTextDesc;
+OSStatus err;
+OSAID scriptID, resultID;
+
+static OSStatus CompileAppleScript(const void* text, long textLength,
+                                  AEDesc *resultData) {
+
+    resultData = NULL;
+    /* set up locals to a known state */
+    theComponent = NULL;
+    AECreateDesc(typeNull, NULL, 0, &scriptTextDesc);
+    scriptID = kOSANullScript;
+    resultID = kOSANullScript;
+
+    /* open the scripting component */
+    theComponent = OpenDefaultComponent(kOSAComponentType,
+                                        typeAppleScript);
+    if (theComponent == NULL) { err = paramErr; return err; }
+
+    /* put the script text into an aedesc */
+    err = AECreateDesc(typeChar, text, textLength, &scriptTextDesc);
+    if (err != noErr) return err;
+
+    /* compile the script */
+    err = OSACompile(theComponent, &scriptTextDesc,
+                     kOSAModeNull, &scriptID);
+
+    return err;
+}
+
+/* runs the compiled applescript */
+static void runScript()
+{
+    /* run the script */
+    err = OSAExecute(theComponent, scriptID, kOSANullScript,
+                     kOSAModeNull, &resultID);
+    return err;
+}
+
+
+/* Simple shortcut to the function that actually compiles the applescript. */
+static OSStatus SimpleCompileAppleScript(const char* theScript) {
+    return CompileAppleScript(theScript, strlen(theScript), NULL);
+}
diff --git a/packaging/macosx/ScriptExec/openDoc b/packaging/macosx/ScriptExec/openDoc
new file mode 100755 (executable)
index 0000000..faf016d
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+#
+# $Id$
+
+
+echo $1;
diff --git a/packaging/macosx/ScriptExec/script b/packaging/macosx/ScriptExec/script
new file mode 100755 (executable)
index 0000000..faf016d
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+#
+# $Id$
+
+
+echo $1;
diff --git a/packaging/macosx/ScriptExec/version.plist b/packaging/macosx/ScriptExec/version.plist
new file mode 100644 (file)
index 0000000..56aa97f
--- /dev/null
@@ -0,0 +1,17 @@
+<?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">
+<!-- $Id$ -->
+<plist version="1.0">
+<dict>
+       <key>BuildVersion</key>
+       <string>17</string>
+       <key>CFBundleShortVersionString</key>
+       <string>0.1</string>
+       <key>CFBundleVersion</key>
+       <string>0.1</string>
+       <key>ProjectName</key>
+       <string>NibPBTemplates</string>
+       <key>SourceVersion</key>
+       <string>1150000</string>
+</dict>
+</plist>
diff --git a/packaging/macosx/dmg_background.png b/packaging/macosx/dmg_background.png
new file mode 100644 (file)
index 0000000..bdf84d8
Binary files /dev/null and b/packaging/macosx/dmg_background.png differ
diff --git a/packaging/macosx/dmg_background.svg b/packaging/macosx/dmg_background.svg
new file mode 100644 (file)
index 0000000..cf50c49
--- /dev/null
@@ -0,0 +1,232 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="625"
+   height="350"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   version="1.0"
+   sodipodi:docbase="/Users/gerald/devel/wireshark/packaging/macosx"
+   sodipodi:docname="dmg_background.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-filename="/Users/gerald/devel/wireshark/packaging/macosx/dmg_background.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient4260">
+      <stop
+         style="stop-color:#d3d3d3;stop-opacity:1;"
+         offset="0"
+         id="stop4262" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop4264" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient10020">
+      <stop
+         id="stop10022"
+         offset="0"
+         style="stop-color:#ffffff;stop-opacity:0.85567009;" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0.49411765;"
+         offset="0.09"
+         id="stop3157" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0.35051546;"
+         offset="0.28999999"
+         id="stop4129" />
+      <stop
+         id="stop10024"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:0.05882353;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3152">
+      <stop
+         style="stop-color:#1ba0df;stop-opacity:1;"
+         offset="0"
+         id="stop3154" />
+      <stop
+         style="stop-color:#1373a1;stop-opacity:1;"
+         offset="1"
+         id="stop3156" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3978">
+      <stop
+         style="stop-color:#50e740;stop-opacity:1;"
+         offset="0"
+         id="stop3980" />
+      <stop
+         style="stop-color:#45a615;stop-opacity:0.94117647;"
+         offset="1"
+         id="stop3982" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3978"
+       id="linearGradient2189"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0,1.9530488,-1.9530488,0,1101.0845,-256.94846)"
+       x1="168.57776"
+       y1="375.28375"
+       x2="177.39995"
+       y2="430.01227" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4260"
+       id="linearGradient4266"
+       x1="289.91379"
+       y1="4.5278296"
+       x2="289.91379"
+       y2="108.51223"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(10.101525,393.9595)" />
+    <filter
+       inkscape:collect="always"
+       x="-0.55671174"
+       width="2.1134235"
+       y="-0.55558707"
+       height="2.1111741"
+       id="filter4219">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="2.3402816"
+         id="feGaussianBlur4221" />
+    </filter>
+    <filter
+       inkscape:collect="always"
+       x="-0.01353314"
+       width="1.0270663"
+       y="-0.11603204"
+       height="1.2320641"
+       id="filter4223">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="2.3402817"
+         id="feGaussianBlur4225" />
+    </filter>
+    <filter
+       inkscape:collect="always"
+       x="-0.013595353"
+       width="1.0271907"
+       y="-0.10226213"
+       height="1.2045243"
+       id="filter5200">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="2.2503457"
+         id="feGaussianBlur5202" />
+    </filter>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.98994949"
+     inkscape:cx="312.5"
+     inkscape:cy="177.14286"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     width="625px"
+     height="350px"
+     inkscape:window-width="1172"
+     inkscape:window-height="811"
+     inkscape:window-x="79"
+     inkscape:window-y="35" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <g
+       id="g5204"
+       transform="matrix(1.6084727,-0.5362259,0.5362259,1.6084727,-324.34165,-144.66511)">
+      <text
+         inkscape:export-ydpi="90.000000"
+         inkscape:export-xdpi="90.000000"
+         inkscape:export-filename="/home/gerald/devel/wsweb/image/wslogo.png"
+         sodipodi:linespacing="125%"
+         transform="scale(0.9479031,1.0549601)"
+         id="text555"
+         y="296.20258"
+         x="111.0079"
+         style="font-size:96.08612823px;font-style:normal;font-weight:bold;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#d7d7d7;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4223);font-family:Luxi Sans">
+        <tspan
+           style="font-size:64px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00002384%;writing-mode:lr-tb;text-anchor:start;fill:#d7d7d7;fill-opacity:1;font-family:Bitstream Vera Sans"
+           id="tspan563"
+           sodipodi:role="line"
+           y="296.20258"
+           x="111.0079">WIRE<tspan
+   id="tspan1330"
+   style="font-size:64px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#d7d7d7;fill-opacity:1;font-family:Bitstream Vera Sans">SHARK</tspan>
+<tspan
+   style="font-size:40px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00002384%;writing-mode:lr-tb;text-anchor:start;fill:#d7d7d7;fill-opacity:1;font-family:Bitstream Vera Sans"
+   id="tspan1334" />
+</tspan>
+      </text>
+      <path
+         inkscape:export-ydpi="90.000000"
+         inkscape:export-xdpi="90.000000"
+         inkscape:export-filename="/home/gerald/devel/wsweb/image/wslogo.png"
+         sodipodi:nodetypes="ccccc"
+         id="path1328"
+         d="M 106.5666,255.33213 L 263.50037,255.33213 C 263.50037,255.33213 267.57147,207.5469 309.63965,206.88321 C 296.06928,228.12109 308.84175,255.39956 308.84175,255.39956 L 499.52492,255.39956"
+         style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#d7d7d7;stroke-width:4.29723692;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter5200)" />
+      <text
+         xml:space="preserve"
+         style="font-size:13.94218159px;font-style:normal;font-weight:normal;fill:#d7d7d7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4219);font-family:Bitstream Vera Sans"
+         x="485.69824"
+         y="248.90048"
+         id="text4138"><tspan
+           sodipodi:role="line"
+           id="tspan4140"
+           x="485.69824"
+           y="248.90048">®</tspan></text>
+    </g>
+    <rect
+       style="opacity:1;fill:url(#linearGradient4266);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.17716534;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect3289"
+       width="637.40625"
+       height="267.69043"
+       x="5.0507655"
+       y="389.39594" />
+    <path
+       sodipodi:nodetypes="cccccccc"
+       id="path2187"
+       d="M 278.14395,51.63308 C 239.083,78.05441 239.083,78.05441 239.083,78.05441 L 278.14395,105.39709 L 278.14395,89.77271 L 384.69618,89.95653 L 384.69618,66.33614 L 278.14395,66.33614 L 278.14395,51.63308 z "
+       style="fill:url(#linearGradient2189);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.95304787px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
+       inkscape:export-filename="/home/gerald/devel/wsweb/image/dlarrow.png"
+       inkscape:export-xdpi="33.887455"
+       inkscape:export-ydpi="33.887455" />
+  </g>
+</svg>
diff --git a/packaging/macosx/dmg_set_style.scpt b/packaging/macosx/dmg_set_style.scpt
new file mode 100755 (executable)
index 0000000..7521a78
Binary files /dev/null and b/packaging/macosx/dmg_set_style.scpt differ
diff --git a/packaging/macosx/native-gtk/build-gtk.sh b/packaging/macosx/native-gtk/build-gtk.sh
new file mode 100755 (executable)
index 0000000..c4373cb
--- /dev/null
@@ -0,0 +1,660 @@
+#!/bin/sh
+#
+# $Id$
+#
+# Based on the Imendio 'build-gtk.sh' script.
+#
+# Inkscape (Wireshark) build additions by Michael Wybrow <mjwybrow@users.sf.net>
+#
+# See the following page for build instructions:
+# http://developer.imendio.com/projects/gtk-macosx/build-instructions
+#
+# Usage:
+# export PREFIX=/your/install/prefix
+# ./build-gtk bootstrap
+# ./build-gtk build wireshark
+#
+
+# XXX: Check for xargs with -i
+#
+# In lib/pkgconfig/freetpe2.pc
+#
+# -  Libs: -L${libdir} -lfreetype -lz
+# +  Libs: -L${libdir} -lfreetype -lz -Wl,-framework,CoreServices,-framework,ApplicationServices
+#
+# bin/freetype-config
+#
+# -  libs="-lfreetype -lz"
+# +  libs="-lfreetype -lz -Wl,-framework,CoreServices,-framework,ApplicationServices"
+#
+# In lib/pkgconfig/fontconfig.pc
+#      Add -lexpat
+#
+
+version=1.3.1-wireshark
+
+
+SCRIPTDIR=`dirname $0`
+
+export PREFIX=${PREFIX-/opt/gtk}
+export PATH=$PREFIX/bin:/usr/bin:$PATH
+#export PATH=$PREFIX/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:
+export LIBTOOLIZE=$PREFIX/bin/libtoolize
+
+# FIXME: We might need some more intelligent way to get the path here.
+export PYTHONPATH=$PREFIX/lib/python2.3/site-packages
+
+# Needed for glib etc to pick up gettext
+export LDFLAGS=-L$PREFIX/lib
+export CPPFLAGS=-I$PREFIX/include
+
+export XDG_DATA_DIRS=$PREFIX/share
+
+COMMON_OPTIONS="--prefix=$PREFIX --disable-static --enable-shared \
+--disable-gtk-doc --disable-scrollkeeper"
+
+#export MAKEFLAGS=-j2
+
+if [ "x$PANTHER_BUILD" = "xYes" ]; then
+    # XXX: Check the machine is PPC
+    #      or rework to have things like pkg-config built natively.
+
+    # Overwrite some build settings.
+    export SDK="/Developer/SDKs/MacOSX10.3.9.sdk"
+    export MACOSX_DEPLOYMENT_TARGET=10.3
+    export CFLAGS="-isysroot ${SDK} -arch ppc"
+    export CXXFLAGS="-isysroot ${SDK} -arch ppc"
+
+    export STABLE_BUILD=Yes
+fi
+
+if [ "x$UNIVERSAL_BUILD" = "xYes" ]; then
+    COMMON_OPTIONS="$COMMON_OPTIONS --disable-dependency-tracking"
+
+    export SDK="/Developer/SDKs/MacOSX10.4u.sdk"
+    export MACOSX_DEPLOYMENT_TARGET=10.4
+    #export MACOSX_DEPLOYMENT_TARGET_i386=10.4
+    #export MACOSX_DEPLOYMENT_TARGET_ppc=10.3
+    export CFLAGS="-isysroot ${SDK} -arch ppc -arch i386"
+    export CXXFLAGS="-isysroot ${SDK} -arch ppc -arch i386"
+
+    CONFIGURE_pkg_config="--with-pc-path=$PREFIX/lib/pkgconfig:/usr/X11R6/lib/pkgconfig --enable-indirect-deps --disable-dependency-tracking"
+
+    CONFIGURE_libpng="--disable-dependency-tracking"
+    PRECONFIGURE_libpng="eval CPPFLAGS='$CPPFLAGS -DPNG_NO_ASSEMBLER_CODE'"
+
+    CONFIGURE_tiff="--disable-dependency-tracking"
+
+    POSTCONFIGURE_jpeg_6b="patch_libtool_dylib"
+
+    CONFIGURE_gc="--disable-dependency-tracking"
+    POSTCONFIGURE_gc="patch_libtool_dylib"
+    PRECONFIGURE_gc="eval CFLAGS='$CFLAGS -DUSE_GENERIC_PUSH_REGS'"
+
+    POSTCONFIGURE_freetype="eval cd builds/unix/ && pwd && patch_libtool_dylib && cd ../.."
+
+    CONFIGURE_fontconfig="--disable-dependency-tracking --disable-docs"
+    POSTCONFIGURE_fontconfig="eval cd fc-arch && make all && cd .. && perl -pi~ -e 's|#define FC_ARCHITECTURE \"x86\"|#ifdef __ppc__\n#define FC_ARCHITECTURE \"ppc\"\n#else\n#define FC_ARCHITECTURE \"x86\"\n#endif|g' fc-arch/fcarch.h"
+
+    PRECONFIGURE_cairo="export ax_cv_c_float_words_bigendian=no"
+    CONFIGURE_cairo="--disable-dependency-tracking --enable-shared --disable-quartz --disable-atsui --enable-glitz"
+    POSTCONFIGURE_cairo="eval patch_libtool_dylib && export ax_cv_c_float_words_bigendian='' && perl -pi~ -e 's|/\* #undef FLOAT_WORDS_BIGENDIAN \*/|#ifdef __ppc__\n#define FLOAT_WORDS_BIGENDIAN 1\n#endif|g;s|/\* #undef WORDS_BIGENDIAN \*/|#ifdef __ppc__\n#define WORDS_BIGENDIAN 1\n#endif|g' config.h && perl -pi~ -e 's|DIST_SUBDIRS = pixman src boilerplate test perf doc|DIST_SUBDIRS = pixman src test perf doc|g;s|am__append_1 = boilerplate test|am__append_1 = test|g' Makefile"
+
+    CONFIGURE_glitz="--disable-dependency-tracking"
+
+    CONFIGURE_lcms="--disable-dependency-tracking"
+
+    CONFIGURE_glib="$COMMON_OPTIONS"
+    POSTCONFIGURE_glib="eval make glibconfig.h config.h && cp $DIRNAME/{glib,}config.h ."
+    #POSTCONFIGURE_glib="eval make glibconfig.h && perl -pi~ -e 's|#define G_BYTE_ORDER G_LITTLE_ENDIAN|#include <machine/endian.h>\n#define G_BYTE_ORDER __DARWIN_BYTE_ORDER|g' glibconfig.h"
+
+    CONFIGURE_pango="$COMMON_OPTIONS"
+    POSTCONFIGURE_pango="eval perl -pi~ -e 's|SUBDIRS = pango modules examples docs tools tests|SUBDIRS = pango modules docs tools tests|g' Makefile && perl -pi~ -e 's|harfbuzz_dump_LDADD = |harfbuzz_dump_LDADD = -Xlinker -framework -Xlinker CoreServices -Xlinker -framework -Xlinker ApplicationServices|g' pango/opentype/Makefile"
+
+    CONFIGURE_gtk="$COMMON_OPTIONS"
+
+    CONFIGURE_atk="$COMMON_OPTIONS"
+
+    CONFIGURE_libxml2="$COMMON_OPTIONS"
+
+    CONFIGURE_libsigc="$COMMON_OPTIONS"
+    POSTCONFIGURE_libsigc="patch_libtool_dylib"
+
+    CONFIGURE_glibmm="$COMMON_OPTIONS"
+
+    CONFIGURE_cairomm="$COMMON_OPTIONS"
+
+    CONFIGURE_gtkmm="$COMMON_OPTIONS --disable-examples --disable-demos"
+    POSTCONFIGURE_gtkmm="patch_libtool_dylib"
+
+    CONFIGURE_libxslt="$COMMON_OPTIONS"
+
+    CONFIGURE_popt="$COMMON_OPTIONS"
+    POSTCONFIGURE_popt="patch_libtool_dylib"
+elif [ "x$STABLE_BUILD" = "xYes" ]; then
+    COMMON_OPTIONS="$COMMON_OPTIONS --disable-dependency-tracking"
+
+    CONFIGURE_pkg_config="--with-pc-path=$PREFIX/lib/pkgconfig:/usr/X11R6/lib/pkgconfig --enable-indirect-deps --disable-dependency-tracking"
+
+    CONFIGURE_libpng="--disable-dependency-tracking"
+
+    CONFIGURE_tiff="--disable-dependency-tracking"
+
+    CONFIGURE_gc="--disable-dependency-tracking"
+
+    CONFIGURE_fontconfig="--disable-dependency-tracking --disable-docs"
+
+    CONFIGURE_cairo="--disable-dependency-tracking --enable-shared --disable-quartz --disable-atsui --enable-glitz"
+
+    CONFIGURE_glitz="--disable-dependency-tracking"
+
+    CONFIGURE_lcms="--disable-dependency-tracking"
+
+    CONFIGURE_glib="$COMMON_OPTIONS"
+
+    CONFIGURE_pango="$COMMON_OPTIONS"
+    POSTCONFIGURE_pango="eval perl -pi~ -e 's|SUBDIRS = pango modules examples docs tools tests|SUBDIRS = pango modules docs tools tests|g' Makefile && perl -pi~ -e 's|harfbuzz_dump_LDADD = |harfbuzz_dump_LDADD = -Xlinker -framework -Xlinker CoreServices -Xlinker -framework -Xlinker ApplicationServices|g' pango/opentype/Makefile"
+
+    CONFIGURE_gtk="$COMMON_OPTIONS"
+
+    CONFIGURE_atk="$COMMON_OPTIONS"
+
+    CONFIGURE_libxml2="$COMMON_OPTIONS"
+
+    CONFIGURE_libsigc="$COMMON_OPTIONS"
+
+    CONFIGURE_glibmm="$COMMON_OPTIONS"
+
+    CONFIGURE_cairomm="$COMMON_OPTIONS"
+
+    CONFIGURE_gtkmm="$COMMON_OPTIONS --disable-examples --disable-demos"
+
+    CONFIGURE_libxslt="$COMMON_OPTIONS"
+
+    CONFIGURE_popt="$COMMON_OPTIONS"
+fi
+
+
+# Support install-check from jhbuild to speed up compilation
+if [ -x $PREFIX/bin/install-check ]; then
+    export INSTALL=$PREFIX/bin/install-check
+fi
+
+
+SOURCE=${SOURCE-$HOME/Source/gtk}
+CAIROCVSROOT=${CAIROCVSROOT-:pserver:anoncvs@cvs.freedesktop.org:/cvs/cairo}
+WIRESHARKSVNURL="http://anonsvn.wireshark.org/wireshark/trunk
+GNOMESVNURL=${GNOMESVNURL-https://svn.gnome.org/svn}
+
+if [ x$1 = xrun ]; then
+    cmd="$2"
+    shift 2
+    exec $cmd $*
+fi
+
+if [ $# -eq 0 -o "x`echo "$*" | grep shell`" = xshell ]; then
+    # Can be used in .bashrc to set a fancy prompt...
+    export INSIDE_GTK_BUILD=1
+    bash
+    exit 0
+fi
+
+CORE_MODULES="glitz cairo gnome-common glib pango atk gtk+"
+EXTRA_MODULES="libxml2 libxslt loudmouth libglade gossip gtk-engines"
+PYGTK_MODULES=" pycairo pygobject pygtk"
+WIRESHARK_MODULES="$CORE_MODULES libxml2 libxslt gc lcms libsigc++ doxygen glibmm cairomm gtkmm popt wireshark"
+
+# Could add those (orbit requires popt though)
+MORE_MODULES="libIDL ORBit2 gconf"
+
+function print_usage
+{
+    echo
+    echo "GTK+ on Mac OS X build script version $version."
+    echo
+    echo "Usage:"
+    echo "`basename $0` [bootstrap|[shell]|run <cmd>|build [<modules>]], modules are:"
+    echo " Core: $CORE_MODULES"
+    echo " Extra: $EXTRA_MODULES"
+    echo " Python: $PYGTK_MODULES"
+    echo " Wireshark: $WIRESHARK_MODULES"
+    echo
+    echo "Setup: This script defaults to downloading source to ~/Source/gtk and"
+    echo "installing in /opt/gtk. Make sure your user has write access to the"
+    echo "latter directory. You can override those directories by setting the"
+    echo "SOURCE and PREFIX environment variables. Anoncvs is used by default"
+    echo "for access to GNOME SVN, if you wish to override, set the environment"
+    echo "variable GNOMESVNURL to your own account."
+    echo
+    echo "While in the shell that this script provides, the environment variable"
+    echo "INSIDE_GTK_BUILD is set, which makes it possible to put something like"
+    echo "the following in ~/.bashrc:"
+    echo
+    echo " if [ x\$INSIDE_GTK_BUILD != x ]; then"
+    echo "     PS1=\"[GTK] \u@\h \W $ \""
+    echo " fi"
+    echo
+    echo "Start by bootstrapping. This will install the necessary build tools."
+    echo "Then build GTK+ & co by using the \"build\" command. If no modules are"
+    echo "specified, only the ones needed for GTK+ will be built. The special"
+    echo "modules \"core\" and \"all\" can be used to build just the core or all"
+    echo "modules."
+    echo
+    echo "If you want to build something manually or run something, use the "
+    echo "\"shell\" command (or no command) to get a shell with the environment"
+    echo "properly setup."
+    echo
+    echo "Tip: if you build and install \"install-check\" from jhbuild into your"
+    echo "PREFIX, recompiling when hacking on GTK+ & co will be a lot faster."
+    echo
+}
+
+function download
+{
+    BASENAME=`basename $1`
+
+    if [ -s $BASENAME ]; then
+       echo "Already downloaded"
+       return 0
+    fi
+
+    curl $1 > $BASENAME || return 1
+
+    return 0
+}
+
+function should_build
+{
+    if [ -f $1/BUILT ]; then
+       echo "Already built"
+       return 1
+    fi
+
+    return 0
+}
+
+function tarball_get_and_build
+{
+    BASENAME=`basename $1`
+    DIRNAME=`echo $BASENAME | sed -e s,.src.,., | sed -e s,.tar.*,,`
+    INSTCMD="make install"
+    PREFIXARG="--prefix=$PREFIX"
+    COMMONOPTS="$COMMON_OPTIONS"
+
+    SHORTNAME=`echo $DIRNAME | sed -e s,-*[0-9\.]*$,,`
+    if !(echo "$MODULES" | grep -w $SHORTNAME) >/dev/null; then
+       return 0
+    fi
+
+    echo
+    echo "Building $DIRNAME"
+    echo -ne "\033]0;Building $DIRNAME\007"
+
+    # Special case jpeg... :/
+    if [ x`echo $DIRNAME | grep jpeg` != x ]; then
+       INSTCMD="make install-lib"
+    fi
+
+    if [ x`echo $BASENAME | grep bz2` != x ]; then
+       COMP="j"
+    else
+       COMP="z"
+    fi
+
+    # Doxygen doesn't have a standard configure script.
+    if [ x`echo $BASENAME | grep doxygen` != x ]; then
+       PREFIXARG="--prefix $PREFIX"
+       COMMONOPTS="--shared"
+    fi
+
+    # Modify specific configure options
+    UNDERSCORENAME=`echo $SHORTNAME | sed -e s,-,_, | tr -d '+'`
+    CONFIGURE_EXTRA=`eval echo '\$'{CONFIGURE_$UNDERSCORENAME}`
+    if [ "x$CONFIGURE_EXTRA" != "x" ]; then
+        COMMONOPTS="$COMMONOPTS $CONFIGURE_EXTRA"
+    fi
+    PRECONFIGURE=`eval echo '\$'{PRECONFIGURE_$UNDERSCORENAME}`
+    if [ "x$PRECONFIGURE" == "x" ]; then
+        PRECONFIGURE="true"
+    fi
+    POSTCONFIGURE=`eval echo '\$'{POSTCONFIGURE_$UNDERSCORENAME}`
+    if [ "x$POSTCONFIGURE" == "x" ]; then
+        POSTCONFIGURE="true"
+    fi
+
+    cd $SOURCE || return 1
+    download $1 || return 1
+    should_build $DIRNAME || return 0
+    tar ${COMP}xf $BASENAME && \
+       cd $DIRNAME && \
+       $PRECONFIGURE && \
+       echo "./configure $PREFIXARG $COMMONOPTS $2" && \
+       ./configure $PREFIXARG $COMMONOPTS $2 && \
+       $POSTCONFIGURE && \
+       make && $INSTCMD && touch BUILT
+}
+
+
+function cpan_get_and_build
+{
+    BASENAME=`basename $1`
+    DIRNAME=`echo $BASENAME | sed -e s,.tar.*,,`
+
+    SHORTNAME=`echo $DIRNAME | sed -e s,-*[0-9\.]*$,,`
+    if !(echo "$MODULES" | grep -w $SHORTNAME) >/dev/null; then
+       return 0
+    fi
+
+    echo
+    echo "Building $DIRNAME"
+    echo -ne "\033]0;Building $DIRNAME\007"
+
+    if [ x`echo $BASENAME | grep bz2` != x ]; then
+       COMP="j"
+    else
+       COMP="z"
+    fi
+
+    cd $SOURCE || return 1
+    download $1 || return 1
+    should_build $DIRNAME || return 0
+    tar ${COMP}xf $BASENAME && \
+       cd $DIRNAME && \
+       perl Makefile.PL $2 && \
+       make && \
+       (echo "Enter your password to istall $BASENAME"; make install) && \
+       touch BUILT
+}
+
+function git_get_and_build
+{
+    if !(echo "$MODULES" | grep -w $2) >/dev/null; then
+       return 0
+    fi
+
+    echo
+    echo "Building $2"
+    echo -ne "\033]0;Building $2\007"
+
+    cd $SOURCE
+    if [ -d $2 ]; then
+       cd $2
+       cg-update || return
+    else
+       cg-clone $1/$2 || return
+       cd $2
+    fi
+
+    echo "./autogen.sh $COMMON_OPTIONS $3"
+    (./autogen.sh $COMMON_OPTIONS $3 && make && make install)
+}
+
+function cvs_get_and_build
+{
+    if !(echo "$MODULES" | grep -w $2) >/dev/null; then
+       return 0
+    fi
+
+    echo
+    echo "Building $2"
+    echo -ne "\033]0;Building $2\007"
+
+    cd $SOURCE
+    if [ -d $2 ]; then
+       cd $2
+       cvs up -dP || return
+    else
+       cvs -d $1 co -P $2 || return
+       cd $2
+    fi
+
+    echo "./autogen.sh $COMMON_OPTIONS $3"
+    (./autogen.sh $COMMON_OPTIONS $3 && make && make install)
+}
+
+function svn_get_and_build
+{
+    if !(echo "$MODULES" | grep -w $2) >/dev/null; then
+       return 0
+    fi
+
+    echo
+    echo "Building $2"
+    echo -ne "\033]0;Building $2\007"
+
+    cd $SOURCE
+    if [ -d $2 ]; then
+       cd $2
+       svn up || return
+    else
+       svn co $1/$2/trunk $2 || return
+       cd $2
+    fi
+
+    echo "./autogen.sh $COMMON_OPTIONS $3"
+    #(./autogen.sh $COMMON_OPTIONS $3 && ./configure --prefix=$PREFIX $COMMON_OPTIONS $3 && make && make install)
+    (./autogen.sh $COMMON_OPTIONS $3 && make && make install)
+}
+
+function set_automake
+{
+    old_AUTOMAKE=$AUTOMAKE
+    old_ACLOCAL=$ACLOCAL
+
+    export AUTOMAKE=automake-$1
+    export ACLOCAL=aclocal-$1
+}
+
+function restore_automake
+{
+    if [ x$old_AUTOMAKE != x ]; then
+       export AUTOMAKE=$old_AUTOMAKE
+    else
+       unset AUTOMAKE
+    fi
+
+    if [ x$old_ACLOCAL != x ]; then
+       export ACLOCAL=$old_ACLOCAL
+    else
+       unset ACLOCAL
+    fi
+}
+
+function do_exit
+{
+    echo -ne "\033]0;\007"
+    exit
+}
+
+# Make sure to restore the title when done.
+trap do_exit EXIT SIGINT SIGTERM
+
+
+# configure doesn't pass CFLAGS through to generated libtool
+function patch_libtool_dylib()
+{
+    # Only do this for universal builds.
+    if [ "x$UNIVERSAL_BUILD" != "xYes" ]; then
+        return 0
+    fi
+
+    cp libtool libtool.old
+    perl -pi -e "s@-dynamiclib@$CFLAGS \$&@" libtool
+    if test "x$1" = "xwithbundle"; then
+        perl -pi -e "s@-bundle@$CFLAGS \$&@" libtool
+    fi
+}
+
+
+function process_modules()
+{
+    # Bootstrap packages.
+    PACKAGES=" \
+       http://pkgconfig.freedesktop.org/releases/pkg-config-0.21.tar.gz \
+       http://ftp.gnu.org/gnu/libtool/libtool-1.5.22.tar.gz \
+       http://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.bz2 \
+       http://ftp.gnu.org/pub/gnu/automake/automake-1.7.9.tar.bz2 \
+       http://ftp.gnu.org/gnu/automake/automake-1.9.6.tar.bz2 \
+       http://heanet.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.15.tar.bz2 \
+       ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.8.2.tar.gz \
+       http://people.imendio.com/richard/gtk-osx/files/jpeg-6b.tar.gz \
+       http://ftp.gnu.org/gnu/gettext/gettext-0.16.tar.gz \
+       http://heanet.dl.sourceforge.net/sourceforge/expat/expat-2.0.0.tar.gz \
+       http://heanet.dl.sourceforge.net/sourceforge/freetype/freetype-2.3.0.tar.bz2 \
+       http://fontconfig.org/release/fontconfig-2.4.2.tar.gz \
+       http://people.imendio.com/richard/gtk-osx/files/docbook-files-1.tar.gz \
+       http://www.cs.mu.oz.au/~mjwybrow/gtk-osx/gnome-doc-utils-fake-1.tar.gz \
+       "
+
+       #http://people.imendio.com/richard/gtk-osx/files/popt-1.7.tar.gz
+
+    for PACKAGE in $PACKAGES; do
+       tarball_get_and_build $PACKAGE || exit 1
+    done
+
+    PACKAGE=http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/1.6/gtk-doc-1.6.tar.bz2
+    tarball_get_and_build $PACKAGE "--with-xml-catalog=$PREFIX/etc/xml/catalog" || exit 1
+
+    PACKAGE=ftp://ftp4.freebsd.org/pub/FreeBSD/ports/distfiles/XML-Parser-2.34.tar.gz
+    cpan_get_and_build $PACKAGE "PREFIX=$PREFIX INSTALLDIRS=perl EXPATLIBPATH=$PREFIX/lib EXPATINCPATH=$PREFIX/include" || exit 1
+
+    PACKAGES=" \
+       http://ftp.gnome.org/pub/GNOME/sources/intltool/0.35/intltool-0.35.0.tar.bz2 \
+       http://icon-theme.freedesktop.org/releases/hicolor-icon-theme-0.9.tar.gz \
+       http://ftp.gnome.org/pub/GNOME/sources/gnome-icon-theme/2.14/gnome-icon-theme-2.14.2.tar.bz2 \
+       "
+
+    for PACKAGE in $PACKAGES; do
+       tarball_get_and_build $PACKAGE || exit 1
+    done
+
+
+    # Other packages:
+    if [ "x$UNIVERSAL_BUILD" == "xYes" -o "x$STABLE_BUILD" = "xYes"  ];
+    then
+       tarball_get_and_build http://cairographics.org/snapshots/glitz-0.5.6.tar.gz || exit 1
+       tarball_get_and_build http://cairographics.org/releases/cairo-1.4.0.tar.gz || exit 1
+        tarball_get_and_build http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc6.8.tar.gz || exit 1
+        tarball_get_and_build http://www.littlecms.com/lcms-1.16.tar.gz || exit 1
+        tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/glib/2.12/glib-2.12.11.tar.bz2 || exit 1
+        tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/pango/1.14/pango-1.14.10.tar.bz2 || exit 1
+        tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/atk/1.12/atk-1.12.4.tar.bz2 || exit 1
+        tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/gtk+/2.10/gtk+-2.10.11.tar.bz2 || exit 1
+        tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/libxml2/2.6/libxml2-2.6.27.tar.bz2 || exit 1
+        tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/libsigc++/2.0/libsigc++-2.0.17.tar.bz2 || exit 1
+        tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/glibmm/2.12/glibmm-2.12.7.tar.bz2 || exit 1
+        tarball_get_and_build http://cairographics.org/releases/cairomm-1.2.4.tar.gz || exit 1
+        tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/gtkmm/2.10/gtkmm-2.10.8.tar.bz2 || exit 1
+        tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/libxslt/1.1/libxslt-1.1.20.tar.bz2 || exit 1
+       tarball_get_and_build ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.1.x/popt-1.7.tar.gz || exit 1
+
+        svn_get_and_build $WIRESHARKSVNURL wireshark || exit 1
+
+       exit 0
+    else
+           git_get_and_build git://git.cairographics.org/git cairo "--enable-pdf --enable-atsui --enable-quartz --disable-xlib" || exit 1
+
+           tarball_get_and_build http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc6.7.tar.gz || exit 1
+           tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/libsigc++/2.0/libsigc++-2.0.17.tar.gz || exit 1
+           tarball_get_and_build http://ftp.stack.nl/pub/users/dimitri/doxygen-1.5.1.src.tar.gz || exit 1
+           tarball_get_and_build ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.1.x/popt-1.7.tar.gz || exit 1
+    fi
+
+    svn_get_and_build $GNOMESVNURL libxml2 || exit 1
+    svn_get_and_build $GNOMESVNURL libxslt || exit 1
+    svn_get_and_build $GNOMESVNURL gnome-common || exit 1
+    svn_get_and_build $GNOMESVNURL glib || exit 1
+    svn_get_and_build $GNOMESVNURL atk || exit 1
+    svn_get_and_build $GNOMESVNURL pango "--without-x" || exit 1
+    svn_get_and_build $GNOMESVNURL gtk+ "--with-gdktarget=quartz" || exit 1
+    svn_get_and_build $GNOMESVNURL gtk-engines || exit 1
+    svn_get_and_build $GNOMESVNURL loudmouth "--with-ssl=openssl" || exit 1
+    svn_get_and_build $GNOMESVNURL libglade || exit 1
+    # gossip needs xml2po from gnome-doc-utils.
+    svn_get_and_build $GNOMESVNURL gossip "--with-backend=cocoa" || exit 1
+    svn_get_and_build $CAIROCVSROOT pycairo || exit 1
+    svn_get_and_build $GNOMESVNURL pygobject "--disable-docs" || exit 1
+    svn_get_and_build $GNOMESVNURL pygtk "--disable-docs" || exit 1
+
+    svn_get_and_build $GNOMESVNURL glibmm "--disable-docs --disable-fulldocs" || exit 1
+    cvs_get_and_build $CAIROCVSROOT cairomm || exit 1
+    svn_get_and_build $GNOMESVNURL gtkmm "--disable-docs --disable-examples --disable-demos" || exit 1
+
+    svn_get_and_build $WIRESHARKSVNURL wireshark || exit 1
+
+
+    #svn_get_and_build $GNOMESVNURL gimp || exit 1
+    # For gimp:
+    # libart_lgpl, needs automake 1.4 and doesn't run libtoolize
+    # gtkhtml2 (optional)
+    # libpoppler (optional)
+    # ./autogen.sh --prefix=/opt/gimp --disable-gtk-doc
+}
+
+if (echo "$*" | grep bootstrap) >/dev/null; then
+    if [ "x`cg-version 2>/dev/null`" == "x" ]; then
+       echo "You need the cogito to get cairo from git. It's available e.g. in Darwin ports."
+       exit 1
+    fi
+    if [ "x`which svn 2>/dev/null`" == "x" ]; then
+       echo "You need the svn client to get wireshark"
+       exit 1
+    fi
+
+    mkdir -p $SOURCE 2>/dev/null || \
+        (echo "Error: Couldn't create source checkout dir $SOURCE"; exit 1)
+    mkdir -p $PREFIX/bin 2>/dev/null || \
+        (echo "Error: Couldn't create bin dir $PREFIX/bin"; exit 1)
+
+    echo "Building bootstrap packages."
+
+    MODULES="pkg-config libtool autoconf automake libpng tiff jpeg-6b gettext \
+             expat fontconfig docbook-files intltool \
+            "
+            # freetype
+            # XML-Parser hicolor-icon-theme gnome-icon-theme"
+            # gnome-doc-utils-fake gtk-doc \
+    process_modules
+
+    # Setup glibtool* links since some stuff expects them to be named like
+    # that on OSX
+    if [ -z $PREFIX/bin/glibtoolize ]; then
+       ln -s $PREFIX/bin/libtoolize $PREFIX/bin/glibtoolize
+       ln -s $PREFIX/bin/libtool $PREFIX/bin/glibtool
+    fi
+
+    echo
+    echo "Done bootstrapping. Continue with \"build\" or \"shell\"."
+    exit 0
+fi
+
+if [ "x$1" != xbuild ]; then
+    print_usage
+    exit 1
+fi
+
+shift
+
+MODULES=$*
+if [ $# -eq 0 ]; then
+    echo "Building core modules."
+    MODULES="$CORE_MODULES"
+elif [ "x$1" = xcore ]; then
+    echo "Building core modules."
+    MODULES="$CORE_MODULES"
+elif [ "x$1" = xpython ]; then
+    echo "Building python modules."
+    MODULES="$PYGTK_MODULES"
+elif [ "x$1" = xall ]; then
+    echo "Building core+extra+python modules."
+    MODULES="$CORE_MODULES $EXTRA_MODULES $PYGTK_MODULES"
+elif [ "x$1" = xwireshark ]; then
+    echo "Building wireshark modules."
+    MODULES="$WIRESHARK_MODULES"
+fi
+
+process_modules
+echo "Done."
+
+
+
diff --git a/packaging/macosx/native-gtk/config.h b/packaging/macosx/native-gtk/config.h
new file mode 100644 (file)
index 0000000..49d05c8
--- /dev/null
@@ -0,0 +1,497 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.in by autoheader.  */
+
+/* $Id$ */
+
+/* poll doesn't work on devices */
+#define BROKEN_POLL 1
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+   systems. This function is required for `alloca.c' support on those systems.
+   */
+/* #undef CRAY_STACKSEG_END */
+
+/* Define to 1 if using `alloca.c'. */
+/* #undef C_ALLOCA */
+
+/* Whether to disable memory pools */
+/* #undef DISABLE_MEM_POOLS */
+
+/* Whether to enable GC friendliness by default */
+/* #undef ENABLE_GC_FRIENDLY_DEFAULT */
+
+/* always defined to indicate that i18n is enabled */
+#define ENABLE_NLS 1
+
+/* Define the gettext package to be used */
+#define GETTEXT_PACKAGE "glib20"
+
+/* Define to the GLIB binary age */
+#define GLIB_BINARY_AGE 1209
+
+/* Byte contents of gmutex */
+#ifdef __ppc__
+#define GLIB_BYTE_CONTENTS_GMUTEX 50,-86,-85,-89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+#else
+#define GLIB_BYTE_CONTENTS_GMUTEX -89,-85,-86,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+#endif
+
+/* Define to the GLIB interface age */
+#define GLIB_INTERFACE_AGE 9
+
+/* Define the location where the catalogs will be installed */
+#define GLIB_LOCALE_DIR "/usr/local/share/locale"
+
+/* Define to the GLIB major version */
+#define GLIB_MAJOR_VERSION 2
+
+/* Define to the GLIB micro version */
+#define GLIB_MICRO_VERSION 9
+
+/* Define to the GLIB minor version */
+#define GLIB_MINOR_VERSION 12
+
+/* The size of gmutex, as computed by sizeof. */
+#define GLIB_SIZEOF_GMUTEX 44
+
+/* The size of system_thread, as computed by sizeof. */
+#define GLIB_SIZEOF_SYSTEM_THREAD 4
+
+/* alpha atomic implementation */
+/* #undef G_ATOMIC_ALPHA */
+
+/* i486 atomic implementation */
+/* #undef G_ATOMIC_I486 */
+
+/* ia64 atomic implementation */
+/* #undef G_ATOMIC_IA64 */
+
+/* powerpc atomic implementation */
+#ifdef __ppc__
+#define G_ATOMIC_POWERPC 1
+#endif
+
+/* s390 atomic implementation */
+/* #undef G_ATOMIC_S390 */
+
+/* sparcv9 atomic implementation */
+/* #undef G_ATOMIC_SPARCV9 */
+
+/* x86_64 atomic implementation */
+/* #undef G_ATOMIC_X86_64 */
+
+/* Whether glib was compiled with debugging enabled */
+#define G_COMPILED_WITH_DEBUGGING "minimum"
+
+/* Have inline keyword */
+#define G_HAVE_INLINE 1
+
+/* Have __inline keyword */
+#define G_HAVE___INLINE 1
+
+/* Have __inline__ keyword */
+#define G_HAVE___INLINE__ 1
+
+/* Source file containing theread implementation */
+#define G_THREAD_SOURCE "gthread-posix.c"
+
+/* A 'va_copy' style function */
+#define G_VA_COPY va_copy
+
+/* 'va_lists' cannot be copies as values */
+/* #undef G_VA_COPY_AS_ARRAY */
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+#define HAVE_ALLOCA 1
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+   */
+#define HAVE_ALLOCA_H 1
+
+/* Define to 1 if you have the `atexit' function. */
+#define HAVE_ATEXIT 1
+
+/* Define to 1 if you have the `bind_textdomain_codeset' function. */
+#define HAVE_BIND_TEXTDOMAIN_CODESET 1
+
+/* Define if you have a version of the snprintf function with semantics as
+   specified by the ISO C99 standard. */
+#define HAVE_C99_SNPRINTF 1
+
+/* Define if you have a version of the vsnprintf function with semantics as
+   specified by the ISO C99 standard. */
+#define HAVE_C99_VSNPRINTF 1
+
+/* Define to 1 if you have the `clock_gettime' function. */
+/* #undef HAVE_CLOCK_GETTIME */
+
+/* Have nl_langinfo (CODESET) */
+#define HAVE_CODESET 1
+
+/* Define to 1 if you have the <crt_externs.h> header file. */
+#define HAVE_CRT_EXTERNS_H 1
+
+/* Define to 1 if you have the `dcgettext' function. */
+#define HAVE_DCGETTEXT 1
+
+/* Define to 1 if you have the <dirent.h> header file. */
+#define HAVE_DIRENT_H 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+/* #undef HAVE_DOPRNT */
+
+/* define for working do while(0) macros */
+/* #undef HAVE_DOWHILE_MACROS */
+
+/* Define to 1 if you have the `fdwalk' function. */
+/* #undef HAVE_FDWALK */
+
+/* Define to 1 if you have the <float.h> header file. */
+#define HAVE_FLOAT_H 1
+
+/* Define to 1 if you have the `getcwd' function. */
+#define HAVE_GETCWD 1
+
+/* Define to 1 if you have the `getc_unlocked' function. */
+#define HAVE_GETC_UNLOCKED 1
+
+/* Define to 1 if you have the `getpagesize' function. */
+#define HAVE_GETPAGESIZE 1
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#define HAVE_GETTEXT 1
+
+/* define to use system printf */
+#define HAVE_GOOD_PRINTF 1
+
+/* define to support printing 64-bit integers with format I64 */
+/* #undef HAVE_INT64_AND_I64 */
+
+/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */
+#define HAVE_INTMAX_T 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and
+   declares uintmax_t. */
+#define HAVE_INTTYPES_H_WITH_UINTMAX 1
+
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#define HAVE_LANGINFO_CODESET 1
+
+/* Define to 1 if you have the <langinfo.h> header file. */
+#define HAVE_LANGINFO_H 1
+
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+#define HAVE_LC_MESSAGES 1
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
+
+/* Define to 1 if you have the `localtime_r' function. */
+#define HAVE_LOCALTIME_R 1
+
+/* Define if you have the 'long double' type. */
+#define HAVE_LONG_DOUBLE 1
+
+/* Define if you have the 'long long' type. */
+#define HAVE_LONG_LONG 1
+
+/* define if system printf can print long long */
+#define HAVE_LONG_LONG_FORMAT 1
+
+/* Define to 1 if you have the `lstat' function. */
+#define HAVE_LSTAT 1
+
+/* Define to 1 if you have the <malloc.h> header file. */
+/* #undef HAVE_MALLOC_H */
+
+/* Define to 1 if you have the `memalign' function. */
+/* #undef HAVE_MEMALIGN */
+
+/* Define to 1 if you have the `memmove' function. */
+#define HAVE_MEMMOVE 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have a working `mmap' system call. */
+#define HAVE_MMAP 1
+
+/* Have a monotonic clock */
+/* #undef HAVE_MONOTONIC_CLOCK */
+
+/* Define to 1 if you have the `nanosleep' function. */
+#define HAVE_NANOSLEEP 1
+
+/* Define to 1 if you have the `nl_langinfo' function. */
+#define HAVE_NL_LANGINFO 1
+
+/* Have non-POSIX function getpwuid_r */
+/* #undef HAVE_NONPOSIX_GETPWUID_R */
+
+/* Define to 1 if you have the `nsleep' function. */
+/* #undef HAVE_NSLEEP */
+
+/* Define to 1 if you have the `on_exit' function. */
+/* #undef HAVE_ON_EXIT */
+
+/* Define to 1 if you have the `poll' function. */
+#define HAVE_POLL 1
+
+/* Have POSIX function getpwuid_r */
+#define HAVE_POSIX_GETPWUID_R 1
+
+/* Define to 1 if you have the `posix_memalign' function. */
+/* #undef HAVE_POSIX_MEMALIGN */
+
+/* Have function pthread_attr_setstacksize */
+#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
+
+/* Define to 1 if the system has the type `ptrdiff_t'. */
+#define HAVE_PTRDIFF_T 1
+
+/* Define to 1 if you have the <pwd.h> header file. */
+#define HAVE_PWD_H 1
+
+/* Define to 1 if you have the `readlink' function. */
+#define HAVE_READLINK 1
+
+/* Define to 1 if you have the <sched.h> header file. */
+#define HAVE_SCHED_H 1
+
+/* Define to 1 if you have the `setenv' function. */
+#define HAVE_SETENV 1
+
+/* Define to 1 if you have the `setlocale' function. */
+#define HAVE_SETLOCALE 1
+
+/* Define to 1 if you have the `snprintf' function. */
+#define HAVE_SNPRINTF 1
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares
+   uintmax_t. */
+#define HAVE_STDINT_H_WITH_UINTMAX 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `stpcpy' function. */
+#define HAVE_STPCPY 1
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#define HAVE_STRCASECMP 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Have functions strlcpy and strlcat */
+#define HAVE_STRLCPY 1
+
+/* Define to 1 if you have the `strncasecmp' function. */
+#define HAVE_STRNCASECMP 1
+
+/* Define to 1 if you have the `strsignal' function. */
+#define HAVE_STRSIGNAL 1
+
+/* Define to 1 if you have the `symlink' function. */
+#define HAVE_SYMLINK 1
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#define HAVE_SYS_POLL_H 1
+
+/* found fd_set in sys/select.h */
+#define HAVE_SYS_SELECT_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/times.h> header file. */
+#define HAVE_SYS_TIMES_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#define HAVE_SYS_WAIT_H 1
+
+/* Define to 1 if you have the `timegm' function. */
+#define HAVE_TIMEGM 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define if your printf function family supports positional parameters as
+   specified by Unix98. */
+#define HAVE_UNIX98_PRINTF 1
+
+/* Define to 1 if you have the `unsetenv' function. */
+#define HAVE_UNSETENV 1
+
+/* Define to 1 if you have the `valloc' function. */
+#define HAVE_VALLOC 1
+
+/* Define to 1 if you have the <values.h> header file. */
+/* #undef HAVE_VALUES_H */
+
+/* Define to 1 if you have the `vasprintf' function. */
+#define HAVE_VASPRINTF 1
+
+/* Define to 1 if you have the `vprintf' function. */
+#define HAVE_VPRINTF 1
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Define if you have the 'wchar_t' type. */
+#define HAVE_WCHAR_T 1
+
+/* Define to 1 if you have the `wcslen' function. */
+#define HAVE_WCSLEN 1
+
+/* Define if you have the 'wint_t' type. */
+#define HAVE_WINT_T 1
+
+/* Have a working bcopy */
+/* #undef HAVE_WORKING_BCOPY */
+
+/* Define to 1 if you have the `_NSGetEnviron' function. */
+#define HAVE__NSGETENVIRON 1
+
+/* Do we cache iconv descriptors */
+#define NEED_ICONV_CACHE 1
+
+/* didn't find fd_set */
+/* #undef NO_FD_SET */
+
+/* global 'sys_errlist' not found */
+/* #undef NO_SYS_ERRLIST */
+
+/* global 'sys_siglist' not found */
+/* #undef NO_SYS_SIGLIST */
+
+/* global 'sys_siglist' not declared */
+/* #undef NO_SYS_SIGLIST_DECL */
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=glib"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "glib"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "glib 2.12.9"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "glib"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "2.12.9"
+
+/* Maximum POSIX RT priority */
+#define POSIX_MAX_PRIORITY sched_get_priority_max(SCHED_OTHER)
+
+/* define if posix_memalign() can allocate any size */
+/* #undef POSIX_MEMALIGN_WITH_COMPLIANT_ALLOCS */
+
+/* Minimum POSIX RT priority */
+#define POSIX_MIN_PRIORITY sched_get_priority_min(SCHED_OTHER)
+
+/* The POSIX RT yield function */
+#define POSIX_YIELD_FUNC sched_yield()
+
+/* whether realloc (NULL,) works */
+#define REALLOC_0_WORKS 1
+
+/* Define if you have correct malloc prototypes */
+#define SANE_MALLOC_PROTOS 1
+
+/* The size of `char', as computed by sizeof. */
+#define SIZEOF_CHAR 1
+
+/* The size of `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of `long', as computed by sizeof. */
+#define SIZEOF_LONG 4
+
+/* The size of `long long', as computed by sizeof. */
+#define SIZEOF_LONG_LONG 8
+
+/* The size of `short', as computed by sizeof. */
+#define SIZEOF_SHORT 2
+
+/* The size of `size_t', as computed by sizeof. */
+#define SIZEOF_SIZE_T 4
+
+/* The size of `void *', as computed by sizeof. */
+#define SIZEOF_VOID_P 4
+
+/* The size of `__int64', as computed by sizeof. */
+#define SIZEOF___INT64 0
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at runtime.
+       STACK_DIRECTION > 0 => grows toward higher addresses
+       STACK_DIRECTION < 0 => grows toward lower addresses
+       STACK_DIRECTION = 0 => direction of growth unknown */
+/* #undef STACK_DIRECTION */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Using GNU libiconv */
+#define USE_LIBICONV_GNU 1
+
+/* Using a native implementation of iconv in a separate library */
+/* #undef USE_LIBICONV_NATIVE */
+
+/* Define to 1 if your processor stores words with the most significant byte
+   first (like Motorola and SPARC, unlike Intel and VAX). */
+#ifdef __ppc__
+#define WORDS_BIGENDIAN 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to long or long long if <inttypes.h> and <stdint.h> don't define. */
+/* #undef intmax_t */
+
+/* Define to empty if the C compiler doesn't support this keyword. */
+/* #undef signed */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
diff --git a/packaging/macosx/native-gtk/glibconfig.h b/packaging/macosx/native-gtk/glibconfig.h
new file mode 100644 (file)
index 0000000..e0a9589
--- /dev/null
@@ -0,0 +1,224 @@
+/* glibconfig.h
+ *
+ * This is a generated file.  Please modify 'configure.in'
+ */
+
+ /* $Id$ */
+
+#ifndef __G_LIBCONFIG_H__
+#define __G_LIBCONFIG_H__
+
+#include <glib/gmacros.h>
+
+#include <limits.h>
+#include <float.h>
+#define GLIB_HAVE_ALLOCA_H
+#define GLIB_HAVE_SYS_POLL_H
+
+G_BEGIN_DECLS
+
+#define G_MINFLOAT     FLT_MIN
+#define G_MAXFLOAT     FLT_MAX
+#define G_MINDOUBLE    DBL_MIN
+#define G_MAXDOUBLE    DBL_MAX
+#define G_MINSHORT     SHRT_MIN
+#define G_MAXSHORT     SHRT_MAX
+#define G_MAXUSHORT    USHRT_MAX
+#define G_MININT       INT_MIN
+#define G_MAXINT       INT_MAX
+#define G_MAXUINT      UINT_MAX
+#define G_MINLONG      LONG_MIN
+#define G_MAXLONG      LONG_MAX
+#define G_MAXULONG     ULONG_MAX
+
+typedef signed char gint8;
+typedef unsigned char guint8;
+typedef signed short gint16;
+typedef unsigned short guint16;
+#define G_GINT16_MODIFIER "h"
+#define G_GINT16_FORMAT "hi"
+#define G_GUINT16_FORMAT "hu"
+typedef signed int gint32;
+typedef unsigned int guint32;
+#define G_GINT32_MODIFIER ""
+#define G_GINT32_FORMAT "i"
+#define G_GUINT32_FORMAT "u"
+#define G_HAVE_GINT64 1          /* deprecated, always true */
+
+G_GNUC_EXTENSION typedef signed long long gint64;
+G_GNUC_EXTENSION typedef unsigned long long guint64;
+
+#define G_GINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##LL))
+#define G_GUINT64_CONSTANT(val)        (G_GNUC_EXTENSION (val##ULL))
+#define G_GINT64_MODIFIER "ll"
+#define G_GINT64_FORMAT "lli"
+#define G_GUINT64_FORMAT "llu"
+
+#define GLIB_SIZEOF_VOID_P 4
+#define GLIB_SIZEOF_LONG   4
+#define GLIB_SIZEOF_SIZE_T 4
+
+typedef signed long gssize;
+typedef unsigned long gsize;
+#define G_GSIZE_MODIFIER "l"
+#define G_GSSIZE_FORMAT "li"
+#define G_GSIZE_FORMAT "lu"
+
+#define G_MAXSIZE      G_MAXULONG
+
+#define GPOINTER_TO_INT(p)     ((gint)   (p))
+#define GPOINTER_TO_UINT(p)    ((guint)  (p))
+
+#define GINT_TO_POINTER(i)     ((gpointer)  (i))
+#define GUINT_TO_POINTER(u)    ((gpointer)  (u))
+
+#ifdef NeXT /* @#%@! NeXTStep */
+# define g_ATEXIT(proc)        (!atexit (proc))
+#else
+# define g_ATEXIT(proc)        (atexit (proc))
+#endif
+
+#define g_memmove(dest,src,len) G_STMT_START { memmove ((dest), (src), (len)); } G_STMT_END
+
+#define GLIB_MAJOR_VERSION 2
+#define GLIB_MINOR_VERSION 12
+#define GLIB_MICRO_VERSION 9
+
+#define G_OS_UNIX
+
+#define G_VA_COPY      va_copy
+
+#ifdef __cplusplus
+#define        G_HAVE_INLINE   1
+#else  /* !__cplusplus */
+#define G_HAVE_INLINE 1
+#define G_HAVE___INLINE 1
+#define G_HAVE___INLINE__ 1
+#endif /* !__cplusplus */
+
+#ifdef __cplusplus
+#define G_CAN_INLINE   1
+#else  /* !__cplusplus */
+#define G_CAN_INLINE   1
+#endif
+
+#ifndef __cplusplus
+# define G_HAVE_ISO_VARARGS 1
+#endif
+#ifdef __cplusplus
+# define G_HAVE_ISO_VARARGS 1
+#endif
+
+/* gcc-2.95.x supports both gnu style and ISO varargs, but if -ansi
+ * is passed ISO vararg support is turned off, and there is no work
+ * around to turn it on, so we unconditionally turn it off.
+ */
+#if __GNUC__ == 2 && __GNUC_MINOR__ == 95
+#  undef G_HAVE_ISO_VARARGS
+#endif
+
+#define G_HAVE_GNUC_VARARGS 1
+#ifdef __ppc__
+#define G_HAVE_GROWING_STACK 1
+#else
+#define G_HAVE_GROWING_STACK 0
+#endif
+
+#define G_GNUC_INTERNAL
+
+#define G_THREADS_ENABLED
+#define G_THREADS_IMPL_POSIX
+typedef struct _GStaticMutex GStaticMutex;
+struct _GStaticMutex
+{
+  struct _GMutex *runtime_mutex;
+  union {
+    char   pad[44];
+    double dummy_double;
+    void  *dummy_pointer;
+    long   dummy_long;
+  } static_mutex;
+};
+#ifdef __ppc__
+#define        G_STATIC_MUTEX_INIT     { NULL, { { 50,-86,-85,-89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} } }
+#else
+#define        G_STATIC_MUTEX_INIT     { NULL, { { -89,-85,-86,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} } }
+#endif
+#define        g_static_mutex_get_mutex(mutex) \
+  (g_thread_use_default_impl ? ((GMutex*) ((mutex)->static_mutex.pad)) : \
+   g_static_mutex_get_mutex_impl_shortcut (&((mutex)->runtime_mutex)))
+/* This represents a system thread as used by the implementation. An
+ * alien implementaion, as loaded by g_thread_init can only count on
+ * "sizeof (gpointer)" bytes to store their info. We however need more
+ * for some of our native implementations. */
+typedef union _GSystemThread GSystemThread;
+union _GSystemThread
+{
+  char   data[4];
+  double dummy_double;
+  void  *dummy_pointer;
+  long   dummy_long;
+};
+
+#ifdef __ppc__
+#define G_ATOMIC_OP_MEMORY_BARRIER_NEEDED 1
+
+#define GINT16_TO_BE(val)      ((gint16) (val))
+#define GUINT16_TO_BE(val)     ((guint16) (val))
+#define GINT16_TO_LE(val)      ((gint16) GUINT16_SWAP_LE_BE (val))
+#define GUINT16_TO_LE(val)     (GUINT16_SWAP_LE_BE (val))
+#define GINT32_TO_BE(val)      ((gint32) (val))
+#define GUINT32_TO_BE(val)     ((guint32) (val))
+#define GINT32_TO_LE(val)      ((gint32) GUINT32_SWAP_LE_BE (val))
+#define GUINT32_TO_LE(val)     (GUINT32_SWAP_LE_BE (val))
+#define GINT64_TO_BE(val)      ((gint64) (val))
+#define GUINT64_TO_BE(val)     ((guint64) (val))
+#define GINT64_TO_LE(val)      ((gint64) GUINT64_SWAP_LE_BE (val))
+#define GUINT64_TO_LE(val)     (GUINT64_SWAP_LE_BE (val))
+
+#else
+
+#define GINT16_TO_LE(val)      ((gint16) (val))
+#define GUINT16_TO_LE(val)     ((guint16) (val))
+#define GINT16_TO_BE(val)      ((gint16) GUINT16_SWAP_LE_BE (val))
+#define GUINT16_TO_BE(val)     (GUINT16_SWAP_LE_BE (val))
+#define GINT32_TO_LE(val)      ((gint32) (val))
+#define GUINT32_TO_LE(val)     ((guint32) (val))
+#define GINT32_TO_BE(val)      ((gint32) GUINT32_SWAP_LE_BE (val))
+#define GUINT32_TO_BE(val)     (GUINT32_SWAP_LE_BE (val))
+#define GINT64_TO_LE(val)      ((gint64) (val))
+#define GUINT64_TO_LE(val)     ((guint64) (val))
+#define GINT64_TO_BE(val)      ((gint64) GUINT64_SWAP_LE_BE (val))
+#define GUINT64_TO_BE(val)     (GUINT64_SWAP_LE_BE (val))
+
+#endif
+
+#define GLONG_TO_LE(val)       ((glong) GINT32_TO_LE (val))
+#define GULONG_TO_LE(val)      ((gulong) GUINT32_TO_LE (val))
+#define GLONG_TO_BE(val)       ((glong) GINT32_TO_BE (val))
+#define GULONG_TO_BE(val)      ((gulong) GUINT32_TO_BE (val))
+#define GINT_TO_LE(val)                ((gint) GINT32_TO_LE (val))
+#define GUINT_TO_LE(val)       ((guint) GUINT32_TO_LE (val))
+#define GINT_TO_BE(val)                ((gint) GINT32_TO_BE (val))
+#define GUINT_TO_BE(val)       ((guint) GUINT32_TO_BE (val))
+
+#ifdef __ppc__
+#define G_BYTE_ORDER G_BIG_ENDIAN
+#else
+#define G_BYTE_ORDER G_LITTLE_ENDIAN
+#endif
+
+#define GLIB_SYSDEF_POLLIN =1
+#define GLIB_SYSDEF_POLLOUT =4
+#define GLIB_SYSDEF_POLLPRI =2
+#define GLIB_SYSDEF_POLLHUP =16
+#define GLIB_SYSDEF_POLLERR =8
+#define GLIB_SYSDEF_POLLNVAL =32
+
+#define G_MODULE_SUFFIX "so"
+
+typedef int GPid;
+
+G_END_DECLS
+
+#endif /* GLIBCONFIG_H */
diff --git a/packaging/macosx/osx-app.sh b/packaging/macosx/osx-app.sh
new file mode 100755 (executable)
index 0000000..e617aef
--- /dev/null
@@ -0,0 +1,372 @@
+#!/bin/bash
+#
+# $Id$
+#
+# USAGE
+# osx-app [-s] [-l /path/to/libraries] -bp /path/to/wireshark/bin -p /path/to/Info.plist
+#
+# This script attempts to build an Wireshark.app package for OS X, resolving
+# dynamic libraries, etc.
+# It strips the executable and libraries if '-s' is given.
+# It adds python modules if the '-py option' is given
+# The Info.plist file can be found in the base wireshark directory once
+# configure has been run.
+#
+# AUTHORS
+#               Kees Cook <kees@outflux.net>
+#               Michael Wybrow <mjwybrow@users.sourceforge.net>
+#               Jean-Olivier Irisson <jo.irisson@gmail.com>
+#
+# Copyright (C) 2005 Kees Cook
+# Copyright (C) 2005-2007 Michael Wybrow
+# Copyright (C) 2007 Jean-Olivier Irisson
+#
+# Released under GNU GPL, read the file 'COPYING' for more information
+#
+# Thanks to GNUnet's "build_app" script for help with library dep resolution.
+#              https://gnunet.org/svn/GNUnet/contrib/OSX/build_app
+#
+# NB:
+# When packaging Wireshark for OS X, configure should be run with the
+# "--enable-osxapp" option which sets the correct paths for support
+# files inside the app bundle.
+#
+
+# Defaults
+strip=false
+binary_path="/tmp/inst/bin"
+plist="./Info.plist"
+util_dir="./Utilities"
+cli_dir="$util_dir/Command Line"
+startup_dir="$util_dir/Startup"
+
+binary_list="
+       capinfos
+       dftest
+       dumpcap
+       editcap
+       idl2wrs
+       mergecap
+       randpkt
+       rawshark
+       text2pcap
+       tshark
+       wireshark
+"
+
+# Location for libraries (MacPorts defaults to /opt/local)
+if [ -z $LIBPREFIX ]; then
+       LIBPREFIX="/opt/local"
+fi
+
+
+# Help message
+#----------------------------------------------------------
+help()
+{
+echo -e "
+Create an app bundle for OS X
+
+\033[1mUSAGE\033[0m
+       $0 [-s] [-l /path/to/libraries] -bp /path/to/wireshark/binaries -p /path/to/Info.plist
+
+\033[1mOPTIONS\033[0m
+       \033[1m-h,--help\033[0m
+               display this help message
+       \033[1m-s\033[0m
+               strip the libraries and executables from debugging symbols
+       \033[1m-l,--libraries\033[0m
+               specify the path to the librairies Wireshark depends on
+               (typically /sw or /opt/local)
+       \033[1m-bp,--binary-path\033[0m
+               specify the path to the Wireshark binaries. By default it
+               is in $binary_path
+       \033[1m-p,--plist\033[0m
+               specify the path to Info.plist. Info.plist can be found
+               in the base directory of the source code once configure
+               has been run
+
+\033[1mEXAMPLE\033[0m
+       $0 -s -l /opt/local -bp ../../Build/bin -p Info.plist
+"
+}
+
+
+# Parse command line arguments
+#----------------------------------------------------------
+while [ "$1" != "" ]
+do
+       case $1 in
+               -s)
+                       strip=true ;;
+               -l|--libraries)
+                       LIBPREFIX="$2"
+                       shift 1 ;;
+               -bp|--binary-path)
+                       binary_path="$2"
+                       shift 1 ;;
+               -p|--plist)
+                       plist="$2"
+                       shift 1 ;;
+               -h|--help)
+                       help
+                       exit 0 ;;
+               *)
+                       echo "Invalid command line option: $1"
+                       exit 2 ;;
+       esac
+       shift 1
+done
+
+echo -e "\n\033[1mCREATE WIRESHARK APP BUNDLE\033[0m\n"
+
+# Safety tests
+if [ ! -e "$LIBPREFIX" ]; then
+       echo "Cannot find the directory containing the libraires: $LIBPREFIX" >&2
+       exit 1
+fi
+
+for binary in wireshark $binary_list ; do
+       if [ ! -x "$binary_path/$binary" ]; then
+               echo "Couldn't find $binary (or it's not executable)" >&2
+               exit 1
+       fi
+done
+
+if [ ! -f "$plist" ]; then
+       echo "Need plist file" >&2
+       exit 1
+fi
+
+
+# Handle some version specific details.
+VERSION=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 -d'.'`
+if [ "$VERSION" -ge "4" ]; then
+       # We're on Tiger (10.4) or later.
+       # XCode behaves a little differently in Tiger and later.
+       XCODEFLAGS="-configuration Deployment"
+       SCRIPTEXECDIR="ScriptExec/build/Deployment/ScriptExec.app/Contents/MacOS"
+       EXTRALIBS=""
+else
+       # Panther (10.3) or earlier.
+       XCODEFLAGS="-buildstyle Deployment"
+       SCRIPTEXECDIR="ScriptExec/build/ScriptExec.app/Contents/MacOS"
+       EXTRALIBS=""
+fi
+
+
+# Package always has the same name. Version information is stored in
+# the Info.plist file which is filled in by the configure script.
+package="Wireshark.app"
+
+# Remove a previously existing package if necessary
+if [ -d $package ]; then
+       echo "Removing previous Wireshark.app"
+       rm -Rf $package
+fi
+
+# Remove a previously existing utility directory if necessary
+if [ -d "$util_dir" ]; then
+       echo "Removing $util_dir directory"
+       rm -Rf "$util_dir"
+fi
+
+# Set the 'macosx' directory, usually the current directory.
+resdir=`pwd`
+
+
+# Prepare Package
+#----------------------------------------------------------
+pkgexec="$package/Contents/MacOS"
+pkgres="$package/Contents/Resources"
+pkgbin="$pkgres/bin"
+pkglib="$pkgres/lib"
+pkgplugin="$pkglib/wireshark/plugins"
+
+mkdir -p "$pkgexec"
+mkdir -p "$pkgbin"
+mkdir -p "$pkgplugin"
+
+mkdir -p "$cli_dir"
+mkdir -p "$startup_dir"
+
+# Build and add the launcher
+#----------------------------------------------------------
+(
+       # Build fails if CC happens to be set (to anything other than CompileC)
+       unset CC
+
+       cd "$resdir/ScriptExec"
+       echo -e "\033[1mBuilding launcher...\033[0m\n"
+       xcodebuild $XCODEFLAGS clean build
+)
+cp "$resdir/$SCRIPTEXECDIR/ScriptExec" "$pkgexec/Wireshark"
+
+
+# Copy all files into the bundle
+#----------------------------------------------------------
+echo -e "\n\033[1mFilling app bundle and utility directory...\033[0m\n"
+
+# Wireshark executables
+for binary in $binary_list ; do
+       # Copy the binary to its destination
+       dest_path="$pkgbin/$binary-bin"
+       cp -v "$binary_path/$binary" "$dest_path"
+       # TODO Add a "$verbose" variable and command line switch, which sets wether these commands are verbose or not
+
+       case $binary in
+       wireshark)
+               cp -v utility-launcher "$cli_dir/$binary"
+               ;;
+       *)
+               ln -sv ./wireshark "$pkgbin/$binary"
+               ln -sv ./wireshark "$cli_dir/$binary"
+               ;;
+       esac
+done
+
+# ChmodBPF
+cp -v ChmodBPF/* "$startup_dir"
+
+# The rest of the Wireshark installation (we handled bin above)
+rsync -av \
+       --exclude bin/ \
+       --exclude lib/wireshark/plugins/ \
+       "$binary_path/.."/* "$pkgres"
+
+# Remove the version number from the plugin path
+find "$binary_path/../lib/wireshark/plugins" -type f \
+       -exec cp -fv "{}" "$pkgplugin/" \;
+
+cp "$plist" "$package/Contents/Info.plist"
+
+# Icons and the rest of the script framework
+rsync -av --exclude ".svn" "$resdir"/Resources/* "$package"/Contents/Resources/
+
+# PkgInfo must match bundle type and creator code from Info.plist
+echo "APPLWshk" > $package/Contents/PkgInfo
+
+# Pull in extra requirements for Pango and GTK
+pkgetc="$package/Contents/Resources/etc"
+mkdir -p $pkgetc/pango
+cp $LIBPREFIX/etc/pango/pangox.aliases $pkgetc/pango/
+# Need to adjust path and quote in case of spaces in path.
+sed -e "s,$LIBPREFIX,\"\${CWD},g" -e 's,\.so ,.so" ,g' $LIBPREFIX/etc/pango/pango.modules > $pkgetc/pango/pango.modules
+cat > $pkgetc/pango/pangorc <<END_PANGO
+[Pango]
+ModuleFiles=\${HOME}/.wireshark-etc/pango.modules
+[PangoX]
+AliasFiles=\${HOME}/.wireshark-etc/pangox.aliases
+END_PANGO
+
+# We use a modified fonts.conf file so only need the dtd
+mkdir -p $pkgetc/fonts
+cp $LIBPREFIX/etc/fonts/fonts.dtd $pkgetc/fonts/
+cp -r $LIBPREFIX/etc/fonts/conf.avail $pkgetc/fonts/
+cp -r $LIBPREFIX/etc/fonts/conf.d $pkgetc/fonts/
+
+mkdir -p $pkgetc/gtk-2.0
+sed -e "s,$LIBPREFIX,\${CWD},g" $LIBPREFIX/etc/gtk-2.0/gdk-pixbuf.loaders > $pkgetc/gtk-2.0/gdk-pixbuf.loaders
+sed -e "s,$LIBPREFIX,\${CWD},g" $LIBPREFIX/etc/gtk-2.0/gtk.immodules > $pkgetc/gtk-2.0/gtk.immodules
+
+for item in gnome-vfs-mime-magic gnome-vfs-2.0
+do
+       cp -r $LIBPREFIX/etc/$item $pkgetc/
+done
+
+pango_version=`pkg-config --variable=pango_module_version pango`
+mkdir -p $pkglib/pango/$pango_version/modules
+cp $LIBPREFIX/lib/pango/$pango_version/modules/*.so $pkglib/pango/$pango_version/modules/
+
+gtk_version=`pkg-config --variable=gtk_binary_version gtk+-2.0`
+mkdir -p $pkglib/gtk-2.0/$gtk_version/{engines,immodules,loaders}
+cp -r $LIBPREFIX/lib/gtk-2.0/$gtk_version/* $pkglib/gtk-2.0/$gtk_version/
+
+mkdir -p $pkglib/gnome-vfs-2.0/modules
+cp $LIBPREFIX/lib/gnome-vfs-2.0/modules/*.so $pkglib/gnome-vfs-2.0/modules/
+
+# Find out libs we need from fink, darwinports, or from a custom install
+# (i.e. $LIBPREFIX), then loop until no changes.
+a=1
+nfiles=0
+endl=true
+lib_dep_search_list="
+       $pkglib/gtk-2.0/$gtk_version/loaders/*
+       $pkglib/gtk-2.0/$gtk_version/immodules/*
+       $pkglib/gtk-2.0/$gtk_version/engines/*.so
+       $pkglib/pango/$pango_version/modules/*
+       $pkglib/gnome-vfs-2.0/modules/*
+       $package/Contents/Resources/lib/*
+       $pkgbin/*-bin
+       "
+while $endl; do
+       echo -e "\033[1mLooking for dependencies.\033[0m Round" $a
+       libs="`otool -L $lib_dep_search_list 2>/dev/null | fgrep compatibility | cut -d\( -f1 | grep $LIBPREFIX | sort | uniq`"
+       cp -f $libs "$pkglib"
+       let "a+=1"
+       nnfiles=`ls "$pkglib" | wc -l`
+       if [ $nnfiles = $nfiles ]; then
+               endl=false
+       else
+               nfiles=$nnfiles
+       fi
+done
+
+# Add extra libraries of necessary
+for libfile in $EXTRALIBS
+do
+       cp -f $libfile "$pkglib"
+done
+
+# Strip libraries and executables if requested
+#----------------------------------------------------------
+if [ "$strip" = "true" ]; then
+       echo -e "\n\033[1mStripping debugging symbols...\033[0m\n"
+       chmod +w "$pkglib"/*.dylib
+       strip -x "$pkglib"/*.dylib
+       strip -ur "$binpath"
+fi
+
+# NOTE: This works for all the dylibs but causes GTK to crash at startup.
+#                              Instead we leave them with their original install_names and set
+#                              DYLD_LIBRARY_PATH within the app bundle before running Wireshark.
+#
+# fixlib () {
+#              # Fix a given executable or library to be relocatable
+#              if [ ! -d "$1" ]; then
+#                      echo $1
+#                      libs="`otool -L $1 | fgrep compatibility | cut -d\( -f1`"
+#                      for lib in $libs; do
+#                              echo "  $lib"
+#                              base=`echo $lib | awk -F/ '{print $NF}'`
+#                              first=`echo $lib | cut -d/ -f1-3`
+#                              to=@executable_path/../lib/$base
+#                              if [ $first != /usr/lib -a $first != /usr/X11R6 ]; then
+#                                      /usr/bin/install_name_tool -change $lib $to $1
+#                                      if [ "`echo $lib | fgrep libcrypto`" = "" ]; then
+#                                              /usr/bin/install_name_tool -id $to ../lib/$base
+#                                              for ll in $libs; do
+#                                                      base=`echo $ll | awk -F/ '{print $NF}'`
+#                                                      first=`echo $ll | cut -d/ -f1-3`
+#                                                      to=@executable_path/../lib/$base
+#                                                      if [ $first != /usr/lib -a $first != /usr/X11R6 -a "`echo $ll | fgrep libcrypto`" = "" ]; then
+#                                                              /usr/bin/install_name_tool -change $ll $to ../lib/$base
+#                                                      fi
+#                                              done
+#                                      fi
+#                              fi
+#                      done
+#              fi
+# }
+#
+# Fix package deps
+#(cd "$package/Contents/MacOS/bin"
+# for file in *; do
+#               fixlib "$file"
+# done
+# cd ../lib
+# for file in *; do
+#               fixlib "$file"
+# done)
+
+exit 0
diff --git a/packaging/macosx/osx-build.sh b/packaging/macosx/osx-build.sh
new file mode 100755 (executable)
index 0000000..63410d5
--- /dev/null
@@ -0,0 +1,335 @@
+#!/bin/bash
+#
+# $Id$
+#
+#  Wireshark compilation and packaging script for Mac OS X
+#
+# Copied from the Inkscape distribution. Please see
+#  http://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX
+# for more complete information
+#
+# XXX - This script hasn't yet been ported to the Wireshark build
+# environment and should NOT BE USED.
+#
+# Author:
+#      Jean-Olivier Irisson <jo.irisson@gmail.com>
+# with information from
+#      Kees Cook
+#      Michael Wybrow
+#
+# Copyright (C) 2006-2007
+# Released under GNU GPL, read the file 'COPYING' for more information
+#
+
+############################################################
+
+# User modifiable parameters
+#----------------------------------------------------------
+# Configure flags
+CONFFLAGS="--disable-static --enable-shared --enable-osxapp"
+# Libraries prefix (Warning: NO trailing slash)
+LIBPREFIX="/opt/local"
+# User name on Modevia
+MODEVIA_NAME=""
+
+############################################################
+
+# Help message
+#----------------------------------------------------------
+help()
+{
+
+echo -e "
+Compilation script for Wireshark on Mac OS X.
+
+\033[1mUSAGE\033[0m
+  $0 [options] action[s]
+
+\033[1mACTIONS & OPTIONS\033[0m
+  \033[1mh,help\033[0m
+    display this help message
+  \033[1mu,up,update\033[0m
+    update an existing checkout from svn (run svn up)
+  \033[1ma,auto,autogen\033[0m
+    prepare configure script (run autogen.sh). This is only necessary
+    for a fresh svn checkout or after make distclean.
+  \033[1mc,conf,configure\033[0m
+    configure the build (run configure). Edit your configuration
+    options in $0
+    \033[1m-p,--prefix\033[0m  specify install prefix (configure step only)
+  \033[1mb,build\033[0m
+    build Wireshark (run make)
+  \033[1mi,install\033[0m
+    install the build products locally, inside the source
+    directory (run make install)
+  \033[1mp,pack,package\033[0m
+    package Wireshark in a double clickable .app bundle
+    \033[1m-s,--strip\033[0m   remove debugging information in Wireshark package
+    \033[1m-py,--with-python\033[0m    specify python modules path for inclusion into the app bundle
+  \033[1md,dist,distrib\033[0m
+    store Wireshark.app in a disk image (dmg) for distribution
+  \033[1mput,upload\033[0m
+    upload the dmg and the associate info file on Modevia server
+  \033[1mall\033[0m
+    do everything (update, configure, build, install, package, distribute)
+
+\033[1mEXAMPLES\033[0m
+  \033[1m$0 conf build install\033[0m
+    configure, build and install a dowloaded version of Wireshark in the default
+    directory, keeping debugging information.
+  \033[1m$0 u a c b -p ~ i -s -py ~/site-packages/ p d\033[0m
+    update an svn checkout, prepare configure script, configure,
+    build and install Wireshark in the user home directory (~).
+    Then package Wireshark without debugging information,
+    with python packages from ~/site-packages/ and prepare
+    a dmg for distribution."
+}
+
+# Parameters
+#----------------------------------------------------------
+# Paths
+HERE=`pwd`
+SRCROOT=$HERE/../..            # we are currently in packaging/macosx
+
+# Defaults
+if [ "$INSTALLPREFIX" = "" ]
+then
+       INSTALLPREFIX=/tmp/inst
+fi
+SVNUPDATE="f"
+AUTOGEN="f"
+CONFIGURE="f"
+BUILD="f"
+INSTALL="f"
+PACKAGE="f"
+DISTRIB="f"
+UPLOAD="f"
+
+STRIP=""
+PYTHON_MODULES=""
+
+# Parse command line options
+#----------------------------------------------------------
+while [ "$1" != "" ]
+do
+       case $1 in
+       h|help)
+               help
+               exit 1 ;;
+       all)
+               SVNUPDATE="t"
+               CONFIGURE="t"
+               BUILD="t"
+               INSTALL="t"
+               PACKAGE="t"
+               DISTRIB="t" ;;
+   u|up|update)
+               SVNUPDATE="t" ;;
+   a|auto|autogen)
+               AUTOGEN="t" ;;
+       c|conf|configure)
+               CONFIGURE="t" ;;
+       b|build)
+               BUILD="t" ;;
+       i|install)
+               INSTALL="t" ;;
+       p|pack|package)
+               PACKAGE="t" ;;
+       d|dist|distrib)
+               DISTRIB="t" ;;
+       put|upload)
+               UPLOAD="t" ;;
+       -p|--prefix)
+               INSTALLPREFIX=$2
+               shift 1 ;;
+       -s|--strip)
+               STRIP="-s" ;;
+       -py|--with-python)
+               PYTHON_MODULES="$2"
+               shift 1 ;;
+       *)
+               echo "Invalid command line option: $1"
+               exit 2 ;;
+       esac
+       shift 1
+done
+
+
+# Set environment variables
+# ----------------------------------------------------------
+export LIBPREFIX
+
+# Specific environment variables
+#  automake seach path
+export CPATH="$LIBPREFIX/include"
+#  configure search path
+export CPPFLAGS="-I$LIBPREFIX/include"
+# export CPPFLAGS="-I$LIBPREFIX/include -I /System/Library/Frameworks/Carbon.framework/Versions/Current/Headers"
+export LDFLAGS="-L$LIBPREFIX/lib"
+#  compiler arguments
+export CFLAGS="-O3 -Wall"
+export CXXFLAGS="$CFLAGS"
+
+
+# Actions
+# ----------------------------------------------------------
+if [[ "$SVNUPDATE" == "t" ]]
+then
+       cd $SRCROOT
+       svn up
+       status=$?
+       if [[ $status -ne 0 ]]; then
+               echo -e "\nSVN update failed"
+               exit $status
+       fi
+       cd $HERE
+fi
+
+if [[ "$AUTOGEN" == "t" ]]
+then
+       cd $SRCROOT
+       ./autogen.sh
+       status=$?
+       if [[ $status -ne 0 ]]; then
+               echo -e "\nautogen failed"
+               exit $status
+       fi
+       cd $HERE
+fi
+
+if [[ "$CONFIGURE" == "t" ]]
+then
+       ALLCONFFLAGS=`echo "$CONFFLAGS --prefix=$INSTALLPREFIX"`
+       cd $SRCROOT
+       if [ ! -f configure ]
+       then
+               echo "Configure script not found in $SRCROOT. Run '$0 autogen' first"
+               exit 1
+       fi
+       ./configure $ALLCONFFLAGS
+       status=$?
+       if [[ $status -ne 0 ]]; then
+               echo -e "\nConfigure failed"
+               exit $status
+       fi
+       cd $HERE
+fi
+
+if [[ "$BUILD" == "t" ]]
+then
+       cd $SRCROOT
+       make
+       status=$?
+       if [[ $status -ne 0 ]]; then
+               echo -e "\nBuild failed"
+               exit $status
+       fi
+       cd $HERE
+fi
+
+if [[ "$INSTALL" == "t" ]]
+then
+       cd $SRCROOT
+       make install
+       status=$?
+       if [[ $status -ne 0 ]]; then
+               echo -e "\nInstall failed"
+               exit $status
+       fi
+       cd $HERE
+fi
+
+if [[ "$PACKAGE" == "t" ]]
+then
+
+       # Test the existence of required files
+       if [ ! -e $INSTALLPREFIX/bin/wireshark ]
+       then
+               echo "The wireshark executable \"$INSTALLPREFIX/bin/wireshark\" cound not be found."
+               exit 1
+       fi
+       if [ ! -e ./Info.plist ]
+       then
+               echo "The file \"Info.plist\" could not be found, please re-run configure."
+               exit 1
+       fi
+
+       # Set python command line option (if PYTHON_MODULES location is not empty, then add the python call to the command line, otherwise, stay empty)
+       if [[ "$PYTHON_MODULES" != "" ]]; then
+               PYTHON_MODULES="-py $PYTHON_MODULES"
+               # TODO: fix this: it does not allow for spaces in the PATH under this form and cannot be quoted
+       fi
+
+       # Create app bundle
+       ./osx-app.sh $STRIP -b $INSTALLPREFIX/bin/wireshark -p ./Info.plist $PYTHON_MODULES
+       status=$?
+       if [[ $status -ne 0 ]]; then
+               echo -e "\nApplication bundle creation failed"
+               exit $status
+       fi
+fi
+
+# Fetch some information
+REVISION=`head -n 4 ../../.svn/entries | tail -n 1`
+ARCH=`arch | tr [p,c] [P,C]`
+MINORVERSION=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 -d \.`
+NEWNAME="Wireshark-$REVISION-10.$MINORVERSION-$ARCH"
+DMGFILE="$NEWNAME.dmg"
+INFOFILE="$NEWNAME-info.txt"
+
+if [[ "$DISTRIB" == "t" ]]
+then
+       # Create dmg bundle
+       ./osx-dmg.sh -p "Wireshark.app"
+       status=$?
+       if [[ $status -ne 0 ]]; then
+               echo -e "\nDisk image creation failed"
+               exit $status
+       fi
+
+       mv Wireshark.dmg $DMGFILE
+
+       # Prepare information file
+       echo "Version information on $DATE for `whoami`:
+       OS X       `/usr/bin/sw_vers | grep ProductVersion | cut -f2 -d \:`
+       Architecture $ARCH
+       DarwinPorts  `port version | cut -f2 -d \ `
+       GCC          `gcc --version | grep GCC`
+       GTK          `pkg-config --modversion gtk+-2.0`
+       GTKmm        `pkg-config --modversion gtkmm-2.4`
+       Cairo        `pkg-config --modversion cairo`
+       Cairomm      `pkg-config --modversion cairomm-1.0`
+       CairoPDF     `pkg-config --modversion cairo-pdf`
+       Pango        `pkg-config --modversion pango`
+Configure options:
+       $CONFFLAGS" > $INFOFILE
+       if [[ "$STRIP" == "t" ]]; then
+               echo "Debug info
+       no" >> $INFOFILE
+       else
+               echo "Debug info
+       yes" >> $INFOFILE
+       fi
+fi
+
+if [[ "$UPLOAD" == "t" ]]
+then
+       # Provide default for user name on modevia
+       if [[ "$MODEVIA_NAME" == "" ]]; then
+               MODEVIA_NAME=$USER
+       fi
+       # Uploasd file
+       scp $DMGFILE $INFOFILE "$MODEVIA_NAME"@wireshark.modevia.com:wireshark/docs/macosx-snap/
+       status=$?
+       if [[ $status -ne 0 ]]; then
+               echo -e "\nUpload failed"
+               exit $status
+       fi
+fi
+
+if [[ "$PACKAGE" == "t" || "$DISTRIB" == "t" ]]; then
+       # open a Finder window here to admire what we just produced
+       open .
+fi
+
+exit 0
diff --git a/packaging/macosx/osx-dmg.sh b/packaging/macosx/osx-dmg.sh
new file mode 100755 (executable)
index 0000000..d5fe01b
--- /dev/null
@@ -0,0 +1,216 @@
+#!/bin/bash
+#
+# $Id$
+#
+# USAGE
+# osx-dmg [-s] -p /path/to/Wireshark.app
+#
+# The script creates a read-write disk image,
+# copies Wireshark into it, customizes its appearance using a
+# previously created .DS_Store file (wireshark.ds_store),
+# and then compresses the disk image for distribution.
+#
+# Copied from Inkscape.
+#
+# AUTHORS
+#      Jean-Olivier Irisson <jo.irisson@gmail.com>
+#      Michael Wybrow <mjwybrow@users.sourceforge.net>
+#
+# Copyright (C) 2006-2007
+# Released under GNU GPL, read the file 'COPYING' for more information
+#
+#
+# How to update the disk image layout:
+# ------------------------------------
+#
+# Modify the 'dmg_background.svg' file and generate a new
+# 'dmg_background.png' file.
+#
+# Update the AppleScript file 'dmg_set_style.scpt'.
+#
+# Run this script with the '-s' option.  It will apply the
+# 'dmg_set_style.scpt' AppleScript file, and then prompt the
+# user to check the window size and position before writing
+# a new 'wireshark.ds_store' file to work around a bug in Finder
+# and AppleScript.  The updated 'wireshark.ds_store' will need
+# to be commited to the repository when this is done.
+#
+
+# Defaults
+set_ds_store=false
+ds_store_file="wireshark.ds_store"
+package="Wireshark.app"
+rw_name="RWwireshark.dmg"
+volume_name="Wireshark"
+tmp_dir="/tmp/dmg-$$"
+auto_open_opt=
+utilities="Utilities"
+
+PATH=$PATH:/Developer/Tools
+
+# Help message
+#----------------------------------------------------------
+help()
+{
+echo -e "
+Create a custom dmg file to distribute Wireshark
+
+\033[1mUSAGE\033[0m
+       $0 [-s] -p /path/to/Wireshark.app
+
+\033[1mOPTIONS\033[0m
+       \033[1m-h,--help\033[0m
+               display this help message
+       \033[1m-s\033[0m
+               set a new apperance (do not actually creates a bundle)
+       \033[1m-p,--package\033[0m
+               set the path to the Wireshark.app that should be copie
+               in the dmg
+"
+}
+
+# Parse command line arguments
+while [ "$1" != "" ]
+do
+       case $1 in
+               -h|--help)
+                       help
+                       exit 0 ;;
+               -s)
+                       set_ds_store=true ;;
+               -p|--package)
+                       package="$2"
+                       shift 1 ;;
+               *)
+                       echo "Invalid command line option"
+                       exit 2 ;;
+       esac
+       shift 1
+done
+
+# Safety checks
+if [ ! -e "$package" ]; then
+       echo "Cannot find package: $package"
+       exit 1
+fi
+
+# Safety checks
+if [ ! -e "$utilities" ]; then
+       echo "Cannot find utilities: $utilities"
+       exit 1
+fi
+echo -e "\n\033[1mCREATE WIRESHARK DISK IMAGE\033[0m\n"
+
+# Get the architecture
+case `uname -p` in
+       'powerpc')
+               architecture="PPC"
+               ;;
+       'i386')
+               architecture="Intel"
+               ;;
+       *)
+               echo "Cannot determine architecture"
+               exit 1
+               ;;
+esac
+
+# Set the version
+version=`grep '^AM_INIT_AUTOMAKE' ../../configure.in | sed -e 's/.*, //' -e 's/)//'`
+if [ -z "$version" ] ; then
+       echo "Cannot find VERSION in ../../configure.in"
+       exit 1
+fi
+img_name="$volume_name $version $architecture.dmg"
+
+# Create temp directory with desired contents of the release volume.
+rm -rf "$tmp_dir"
+mkdir "$tmp_dir"
+
+echo -e "\033[1mCopying files to temp directory\033[0m"
+# Wireshark itself
+# Copy Wireshark.app
+cp -rf "$package" "$tmp_dir"/
+# Link to Applications in order to drag and drop wireshark onto it
+ln -sf /Applications "$tmp_dir"/
+# Copy the utilites
+cp -rf "$utilities" "$tmp_dir"/
+# Copy the readme
+cp -rf "Read me first.rtf" "$tmp_dir"/
+
+# Copy a background image inside a hidden directory so the image file itself won't be shown.
+mkdir "$tmp_dir/.background"
+cp dmg_background.png "$tmp_dir/.background/background.png"
+
+# If the appearance settings are not to be modified we just copy them
+if [ ${set_ds_store} = "false" ]; then
+       # Copy the .DS_Store file which contains information about
+       # window size, appearance, etc.  Most of this can be set
+       # with Apple script but involves user intervention so we
+       # just keep a copy of the correct settings and use that instead.
+       cp $ds_store_file "$tmp_dir/.DS_Store"
+       auto_open_opt=-noautoopen
+fi
+
+# Create a new RW image from the temp directory.
+echo -e "\033[1mCreating a temporary disk image\033[0m"
+rm -f "$rw_name"
+/usr/bin/hdiutil create -srcfolder "$tmp_dir" -volname "$volume_name" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW "$rw_name"
+
+# We're finished with the temp directory, remove it.
+rm -rf "$tmp_dir"
+
+# Mount the created image.
+MOUNT_DIR="/Volumes/$volume_name"
+DEV_NAME=`/usr/bin/hdiutil attach -readwrite -noverify $auto_open_opt  "$rw_name" | egrep '^/dev/' | sed 1q | awk '{print $1}'`
+
+# Have the disk image window open automatically when mounted.
+bless -openfolder /Volumes/$volume_name
+
+# In case the apperance has to be modified, mount the image and apply the base settings to it via Applescript
+if [ ${set_ds_store} = "true" ]; then
+       /usr/bin/osascript dmg_set_style.scpt
+
+       open "/Volumes/$volume_name"
+       # BUG: one needs to move and close the window manually for the
+       # changes in appearance to be retained...
+        echo "
+        **************************************
+        *  Please move the disk image window *
+        *    to the center of the screen     *
+        *   then close it and press enter    *
+        **************************************
+        "
+        read -e DUMB
+
+       # .DS_Store files aren't written till the disk is unmounted, or finder is restarted.
+       hdiutil detach "$DEV_NAME"
+       auto_open_opt=-noautoopen
+       DEV_NAME=`/usr/bin/hdiutil attach -readwrite -noverify $auto_open_opt  "$rw_name" | egrep '^/dev/' | sed 1q | awk '{print $1}'`
+       echo
+       echo "New $ds_store_file file written. Re-run $0 without the -s option to use it"
+       cp /Volumes/$volume_name/.DS_Store ./$ds_store_file
+       SetFile -a v ./$ds_store_file
+
+       # Unmount the disk image.
+       hdiutil detach "$DEV_NAME"
+       rm -f "$rw_name"
+
+       exit 0
+fi
+
+# Unmount the disk image.
+hdiutil detach "$DEV_NAME"
+
+# Create the offical release image by compressing the RW one.
+echo -e "\033[1mCompressing the final disk image\033[0m"
+
+# TODO make this a command line option
+if [ -e "$img_name" ]; then
+       echo "$img_name already exists."
+       rm -i "$img_name"
+fi
+/usr/bin/hdiutil convert "$rw_name" -format UDZO -imagekey zlib-level=9 -o "$img_name"
+rm -f "$rw_name"
+
+exit 0
diff --git a/packaging/macosx/utility-launcher b/packaging/macosx/utility-launcher
new file mode 100755 (executable)
index 0000000..bff75b2
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# $Id$
+#
+# Wireshark CLI utility launcher
+
+if [ -z "$WIRESHARK_APP_DIR" ] ; then
+       WIRESHARK_APP_DIR="/Applications/Wireshark.app"
+fi
+
+if [ ! -d "$WIRESHARK_APP_DIR" ] ; then
+       echo "Wireshark doesn't appear to be located at $WIRESHARK_APP_DIR."
+       echo "Please set WIRESHARK_APP_DIR to its proper location and try again."
+       exit 1
+fi
+
+APPNAME=`basename $0`
+exec "$WIRESHARK_APP_DIR/Contents/Resources/bin/$APPNAME" "$@"
+
diff --git a/packaging/macosx/wireshark.ds_store b/packaging/macosx/wireshark.ds_store
new file mode 100644 (file)
index 0000000..cd3bf1e
Binary files /dev/null and b/packaging/macosx/wireshark.ds_store differ