diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-05-24 14:35:04 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-05-24 21:36:57 +0000 |
commit | 449a90a012f0c2cadc842989cb4f59549243f211 (patch) | |
tree | 043fb363609bb8da31d96740ff198cc5b16ea8e5 /packaging | |
parent | 0ff68f06cf6fb8dbf070c426ed0cca02d33c4a15 (diff) | |
download | wireshark-449a90a012f0c2cadc842989cb4f59549243f211.tar.gz |
Put the XQuartz fixer into a separate launchd daemon.
That's a bit cleaner, and also allows it to run if we are updating an
existing Wireshark installation - the ChmodBPF job won't be rerun if it
was already there, as launchd will say "hey, that's already running" and
won't re-run it.
Change-Id: Ib453ccaa5ad4405f4e8687e05c4a6cbd084b3458
Reviewed-on: https://code.wireshark.org/review/8613
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'packaging')
-rwxr-xr-x | packaging/macosx/ChmodBPF/ChmodBPF | 34 | ||||
-rw-r--r-- | packaging/macosx/Makefile.am | 4 | ||||
-rwxr-xr-x | packaging/macosx/Scripts/wireshark-postinstall.sh | 18 | ||||
-rwxr-xr-x | packaging/macosx/XQuartzFixer/XQuartzFixer | 26 | ||||
-rw-r--r-- | packaging/macosx/XQuartzFixer/org.wireshark.XQuartzFixer.plist | 12 | ||||
-rwxr-xr-x | packaging/macosx/osx-app.sh | 6 |
6 files changed, 65 insertions, 35 deletions
diff --git a/packaging/macosx/ChmodBPF/ChmodBPF b/packaging/macosx/ChmodBPF/ChmodBPF index e4da76d8fa..7f16d328b7 100755 --- a/packaging/macosx/ChmodBPF/ChmodBPF +++ b/packaging/macosx/ChmodBPF/ChmodBPF @@ -38,37 +38,3 @@ done chgrp access_bpf /dev/bpf* chmod g+rw /dev/bpf* - -# -# As long as we're here with root privileges, see whether we have -# /opt/X11 but not /usr/X11 and, if so, create /usr/X11 as a symbolic -# link to /opt/X11. -# -# With XQuartz installed, the X11 directory is under /opt, with /usr/X11 -# being a symbolic link to /opt/X11, for compatibility with X programs -# expecting X11 to be there. (With Mountain Lion and later, without -# XQuartz installed, /usr/X11 is a directory tree containing enough of -# X11 to allow X11 programs to start but to pop up a "do you want to -# install XQuartz?" dialog, so that's where X programs *should* look -# for X11.) -# -# Unfortunately, if you have XQuartz installed on a pre-Yosemite -# release, and you upgrade to Yosemite, the Yosemite installer removes -# the /usr/X11 symlink, breaking X11 programs, so we should put it back. -# -# This will be run on system startup, so if a version of ChmodBPF with -# this code is already installed on the pre-Yosemite system, the -# Yosemite upgrade will cause a reboot, and this code will be run. -# -# This will also be run when installing a new version of Wireshark, -# so if you have a system with a broken XQuartz, and install a version -# of Wireshark with this code in it, this code will be run. -# -if [ -d /opt/X11 -a ! -e /usr/X11 ] -then - # - # We have a /opt/X11 directory and don't have /usr/X11. - # Make the symlink. - # - ln -s /opt/X11 /usr/X11 -fi diff --git a/packaging/macosx/Makefile.am b/packaging/macosx/Makefile.am index 8291b85114..f291f8446e 100644 --- a/packaging/macosx/Makefile.am +++ b/packaging/macosx/Makefile.am @@ -87,7 +87,9 @@ EXTRA_DIST = \ Wireshark_package.pmdoc/02chmodbpf.xml \ Wireshark_package.pmdoc/03utility-contents.xml \ Wireshark_package.pmdoc/03utility.xml \ - Wireshark_package.pmdoc/index.xml.in + Wireshark_package.pmdoc/index.xml.in \ + XQuartzFixer/XQuartzFixer \ + XQuartzFixer/org.wireshark.XQuartzFixer.plist COPYING.txt: ../../COPYING diff --git a/packaging/macosx/Scripts/wireshark-postinstall.sh b/packaging/macosx/Scripts/wireshark-postinstall.sh index 619806e6fe..198b1f6206 100755 --- a/packaging/macosx/Scripts/wireshark-postinstall.sh +++ b/packaging/macosx/Scripts/wireshark-postinstall.sh @@ -18,3 +18,21 @@ for plugin in $PLUGINS do rm -f "$PLUGINS_PATH"/$plugin.so "$PLUGINS_PATH"/$plugin.la done + +# +# Install the XQuartz fixer job, and run it, so that if the system +# currently has an XQuartz installation missing its /usr/X11 -> /opt/X11 +# symlink, courtesy of the Yosemite installer removing it on an upgrade, +# we put it back. (It has to run as root, so it can write to /usr.) +# +XQUARTZFIXER="/Library/LaunchDaemons/org.wireshark.XQuartzFixer.plist" + +cp "/Library/Application Support/Wireshark/XQuartzFixer/org.wireshark.XQuartzFixer.plist" \ + "$XQUARTZFIXER" +chmod 755 "$XQUARTZFIXER" +chown root:wheel "$XQUARTZFIXER" + +rm -rf /Library/StartupItems/XQuartzFixer + +launchctl load "$XQUARTZFIXER" + diff --git a/packaging/macosx/XQuartzFixer/XQuartzFixer b/packaging/macosx/XQuartzFixer/XQuartzFixer new file mode 100755 index 0000000000..e87c81234c --- /dev/null +++ b/packaging/macosx/XQuartzFixer/XQuartzFixer @@ -0,0 +1,26 @@ +#! /bin/bash + +# +# See whether we have /opt/X11 but not /usr/X11 and, if so, create +# /usr/X11 as a symbolic link to /opt/X11. +# +# With XQuartz installed, the X11 directory is under /opt, with /usr/X11 +# being a symbolic link to /opt/X11, for compatibility with X programs +# expecting X11 to be there. (With Mountain Lion and later, without +# XQuartz installed, /usr/X11 is a directory tree containing enough of +# X11 to allow X11 programs to start but to pop up a "do you want to +# install XQuartz?" dialog, so that's where X programs *should* look +# for X11.) +# +# Unfortunately, if you have XQuartz installed on a pre-Yosemite +# release, and you upgrade to Yosemite, the Yosemite installer removes +# the /usr/X11 symlink, breaking X11 programs, so we should put it back. +# +if [ -d /opt/X11 -a ! -e /usr/X11 ] +then + # + # We have a /opt/X11 directory and don't have /usr/X11. + # Make the symlink. + # + ln -s /opt/X11 /usr/X11 +fi diff --git a/packaging/macosx/XQuartzFixer/org.wireshark.XQuartzFixer.plist b/packaging/macosx/XQuartzFixer/org.wireshark.XQuartzFixer.plist new file mode 100644 index 0000000000..f782ca8d5e --- /dev/null +++ b/packaging/macosx/XQuartzFixer/org.wireshark.XQuartzFixer.plist @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>Label</key> + <string>org.wireshark.XQuartzFixer</string> + <key>RunAtLoad</key> + <true/> + <key>Program</key> + <string>/Library/Application Support/Wireshark/XQuartzFixer/XQuartzFixer</string> +</dict> +</plist> diff --git a/packaging/macosx/osx-app.sh b/packaging/macosx/osx-app.sh index 3475d1628b..8eb0aadde8 100755 --- a/packaging/macosx/osx-app.sh +++ b/packaging/macosx/osx-app.sh @@ -41,6 +41,7 @@ plist="./Info.plist" util_dir="./Utilities" cli_dir="$util_dir/Command Line" chmodbpf_dir="$util_dir/ChmodBPF" +xquartzfixer_dir="$util_dir/XQuartzFixer" exclude_prefixes="/System/|/Library/|/usr/lib/|/usr/X11/|/opt/X11/|@rpath|@executable_path" @@ -283,6 +284,11 @@ mkdir -p "$chmodbpf_dir" cp -v ChmodBPF/* "$chmodbpf_dir" chmod -R g-w "$chmodbpf_dir" +# XQuartzFixer +mkdir -p "$xquartzfixer_dir" +cp -v XQuartzFixer/* "$xquartzfixer_dir" +chmod -R g-w "$xquartzfixer_dir" + # The rest of the Wireshark installation (we handled bin above) rsync -av \ --exclude bin/ \ |