diff options
author | Gerald Combs <gerald@wireshark.org> | 2013-11-12 20:38:58 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2013-11-12 20:38:58 +0000 |
commit | 30bdf66b1f16ffbd0266083b8e770128aff8f759 (patch) | |
tree | 78569744ac0e19d1fc6d1638520fac7a1e14eb27 | |
parent | 4525c6479728e624bf756053fa39e02a470f0b59 (diff) |
Fix permissions for installed OS X files and directories.
Add a cli-preinstall script that creates missing parts of the
installation path and sets their permissions. Simply copy
"utility-launcher" to "wireshark" instead of renaming it at install
time. Explicitly set its ownership and permissions. Pretty-print some of
the PackageMaker XML files via `xmllint --format --recover`.
svn path=/trunk/; revision=53281
-rwxr-xr-x | packaging/macosx/Scripts/cli-postinstall.sh | 3 | ||||
-rwxr-xr-x | packaging/macosx/Scripts/cli-preinstall.sh | 22 | ||||
-rw-r--r-- | packaging/macosx/Wireshark_package.pmdoc/01wireshark.xml | 40 | ||||
-rw-r--r-- | packaging/macosx/Wireshark_package.pmdoc/03utility.xml | 38 | ||||
-rwxr-xr-x | packaging/macosx/osx-app.sh | 4 |
5 files changed, 102 insertions, 5 deletions
diff --git a/packaging/macosx/Scripts/cli-postinstall.sh b/packaging/macosx/Scripts/cli-postinstall.sh index ce85c03768..f83cf4faac 100755 --- a/packaging/macosx/Scripts/cli-postinstall.sh +++ b/packaging/macosx/Scripts/cli-postinstall.sh @@ -15,9 +15,8 @@ BINARIES=" cd "$CLI_PATH" -rm -f ./wireshark -mv utility-launcher wireshark chmod 755 wireshark +chown root:wheel wireshark for BIN in $BINARIES ; do rm -f ./"$BIN" diff --git a/packaging/macosx/Scripts/cli-preinstall.sh b/packaging/macosx/Scripts/cli-preinstall.sh new file mode 100755 index 0000000000..8a9c51a619 --- /dev/null +++ b/packaging/macosx/Scripts/cli-preinstall.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +CLI_PATH="$2" + +# Create any missing directories with mode 755, owned by root:wheel. +# Don't blindly clobber anything that's already there. +function build_path() +{ + echo "Checking $1" + if [ -d "$1" ] ; then + return "" + else + TRIMMED=`dirname "$1"` + if [ ! -d "$TRIMMED" ] ; then + build_path "$TRIMMED" + fi + install -v -o root -g wheel -m 0755 -d "$1" + fi + +} + +build_path "$2" diff --git a/packaging/macosx/Wireshark_package.pmdoc/01wireshark.xml b/packaging/macosx/Wireshark_package.pmdoc/01wireshark.xml index 1c7f2427b0..ee81d1e275 100644 --- a/packaging/macosx/Wireshark_package.pmdoc/01wireshark.xml +++ b/packaging/macosx/Wireshark_package.pmdoc/01wireshark.xml @@ -1 +1,39 @@ -<pkgref spec="1.12" uuid="0B0ABFF7-3A3D-4F37-B998-DC99734E0EFC"><config><identifier>org.wireshark.Wireshark.pkg</identifier><version>0.0.0.0</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true" mod="true" includeRoot="true">Wireshark.app</installFrom><installTo>/Applications</installTo><flags><followSymbolicLinks/><allowRevert/><mod>allowRevert</mod></flags><packageStore type="internal"></packageStore><mod>scripts.scriptsDirectoryPath.isAbsoluteType</mod><mod>scripts.scriptsDirectoryPath.isRelativeType</mod><mod>installTo</mod><mod>scripts.postinstall.path</mod><mod>installFrom.isRelativeType</mod><mod>includeRoot</mod><mod>scripts.postinstall.isRelativeType</mod><mod>version</mod><mod>parent</mod><mod>scripts.scriptsDirectoryPath.path</mod><mod>identifier</mod><mod>relocatable</mod><mod>requireAuthorization</mod><mod>extraFiles</mod><mod>postInstall</mod></config><scripts><postinstall relative="true" mod="true">Scripts/wireshark-postinstall.sh</postinstall><scripts-dir relative="true" mod="true">Scripts</scripts-dir><scripts-element/></scripts><extra-files/></pkgref>
\ No newline at end of file +<?xml version="1.0"?> +<pkgref spec="1.12" uuid="0B0ABFF7-3A3D-4F37-B998-DC99734E0EFC"> + <config> + <identifier>org.wireshark.Wireshark.app.pkg</identifier> + <version>0.0.0.0</version> + <description/> + <post-install type="none"/> + <requireAuthorization/> + <installFrom relative="true" mod="true" includeRoot="true">Wireshark.app</installFrom> + <installTo>/Applications</installTo> + <flags> + <followSymbolicLinks/> + <allowRevert/> + <mod>allowRevert</mod> + </flags> + <packageStore type="internal"/> + <mod>scripts.scriptsDirectoryPath.isAbsoluteType</mod> + <mod>scripts.scriptsDirectoryPath.isRelativeType</mod> + <mod>installTo</mod> + <mod>scripts.postinstall.path</mod> + <mod>installFrom.isRelativeType</mod> + <mod>includeRoot</mod> + <mod>scripts.postinstall.isRelativeType</mod> + <mod>version</mod> + <mod>parent</mod> + <mod>scripts.scriptsDirectoryPath.path</mod> + <mod>identifier</mod> + <mod>relocatable</mod> + <mod>requireAuthorization</mod> + <mod>extraFiles</mod> + <mod>postInstall</mod> + </config> + <scripts> + <postinstall relative="true" mod="true">Scripts/wireshark-postinstall.sh</postinstall> + <scripts-dir relative="true" mod="true">Scripts</scripts-dir> + <scripts-element/> + </scripts> + <extra-files/> +</pkgref> diff --git a/packaging/macosx/Wireshark_package.pmdoc/03utility.xml b/packaging/macosx/Wireshark_package.pmdoc/03utility.xml index 169a298bf8..0130e3ee5b 100644 --- a/packaging/macosx/Wireshark_package.pmdoc/03utility.xml +++ b/packaging/macosx/Wireshark_package.pmdoc/03utility.xml @@ -1 +1,37 @@ -<pkgref spec="1.12" uuid="F7F04C41-A94E-4CCA-A8F5-8B774B8D9151"><config><identifier>org.wireshark.cli.pkg</identifier><version>1.0</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true">utility-launcher</installFrom><installTo mod="true" relocatable="true">/usr/local/bin</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>installTo</mod><mod>relocatable</mod><mod>scripts.scriptsDirectoryPath.isRelativeType</mod><mod>identifier</mod><mod>parent</mod><mod>installTo.path</mod><mod>installFrom.isRelativeType</mod><mod>scripts.postinstall.isRelativeType</mod></config><scripts><postinstall relative="true" mod="true">Scripts/cli-postinstall.sh</postinstall><scripts-dir relative="true" mod="true">Scripts</scripts-dir></scripts><contents><file-list>03utility-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
\ No newline at end of file +<?xml version="1.0"?> +<pkgref spec="1.12" uuid="F7F04C41-A94E-4CCA-A8F5-8B774B8D9151"> + <config> + <identifier>org.wireshark.cli.pkg</identifier> + <version>1.0</version> + <description/> + <post-install type="none"/> + <requireAuthorization/> + <installFrom relative="true">utility-launcher</installFrom> + <installTo mod="true" relocatable="true">/usr/local/bin</installTo> + <flags> + <followSymbolicLinks/> + </flags> + <packageStore type="internal"/> + <mod>installTo</mod> + <mod>relocatable</mod> + <mod>scripts.scriptsDirectoryPath.isRelativeType</mod> + <mod>identifier</mod> + <mod>parent</mod> + <mod>installTo.path</mod> + <mod>installFrom.isRelativeType</mod> + <mod>scripts.postinstall.isRelativeType</mod> + </config> + <scripts> + <preinstall relative="true" mod="true">Scripts/cli-preinstall.sh</preinstall> + <postinstall relative="true" mod="true">Scripts/cli-postinstall.sh</postinstall> + <scripts-dir relative="true" mod="true">Scripts</scripts-dir> + </scripts> + <contents> + <file-list>03utility-contents.xml</file-list> + <filter>/CVS$</filter> + <filter>/\.svn$</filter> + <filter>/\.cvsignore$</filter> + <filter>/\.cvspass$</filter> + <filter>/\.DS_Store$</filter> + </contents> +</pkgref> diff --git a/packaging/macosx/osx-app.sh b/packaging/macosx/osx-app.sh index 4f0d63ba84..4356d848b5 100755 --- a/packaging/macosx/osx-app.sh +++ b/packaging/macosx/osx-app.sh @@ -250,9 +250,11 @@ fi #---------------------------------------------------------- echo -e "\nFilling app bundle and utility directory...\n" +# CLI wrapper +cp -v utility-launcher "$cli_dir/wireshark" + # Wireshark executables if [ "$ui_toolkit" = "gtk" ] ; then - cp -v utility-launcher "$cli_dir/$binary" for binary in $binary_list wireshark ; do # Copy the binary to its destination dest_path="$pkgbin/$binary-bin" |