Merge pull request #33509 from twangboy/fix_arch

Detect System Architecture for Mac Build
This commit is contained in:
Mike Place 2016-05-26 07:40:54 -07:00
commit 3a95f8a977
2 changed files with 12 additions and 6 deletions

View File

@ -52,6 +52,8 @@ else
PKGDIR=$2
fi
CPUARCH=`uname -m`
############################################################################
# Additional Parameters Required for the script to function properly
############################################################################
@ -140,7 +142,7 @@ cp $SRCDIR/conf/minion $PKGDIR/etc/salt/minion.dist
cp $SRCDIR/conf/master $PKGDIR/etc/salt/master.dist
############################################################################
# Add Version to distribution.xml
# Add Version and CPU Arch to distribution.xml
############################################################################
echo -n -e "\033]0;Build_Pkg: Add Version to .xml\007"
@ -150,6 +152,10 @@ SEDSTR="s/@VERSION@/$VERSION/"
echo $SEDSTR
sed -i '' $SEDSTR distribution.xml
SEDSTR="s/@CPUARCH@/$CPUARCH/"
echo $SEDSTR
sed -i '' $SEDSTR distribution.xml
############################################################################
# Build the Package
############################################################################
@ -159,10 +165,10 @@ pkgbuild --root $PKGDIR \
--scripts $PKGDIR/scripts \
--identifier=com.saltstack.salt \
--version=$VERSION \
--ownership=recommended salt-src-$VERSION.pkg
--ownership=recommended salt-src-$VERSION-$CPUARCH.pkg
productbuild --resources=$PKGDIR/resources \
--distribution=distribution.xml \
--package-path=salt-src-$VERSION.pkg \
--version=$VERSION salt-$VERSION.pkg
--package-path=salt-src-$VERSION-$CPUARCH.pkg \
--version=$VERSION salt-$VERSION-$CPUARCH.pkg

View File

@ -9,7 +9,7 @@
</allowed-os-versions>
</volume-check>
<options rootVolumeOnly="true"
hostArchitectures="x86_64" />
hostArchitectures="@CPUARCH@" />
<domains enable_localSystem="true" />
<!-- Define background image -->
<background file="saltstack.png"
@ -25,7 +25,7 @@
<!-- List all component packages -->
<pkg-ref id="com.saltstack.salt"
version="@VERSION@"
auth="root">salt-src-@VERSION@.pkg</pkg-ref>
auth="root">salt-src-@VERSION@-@CPUARCH@.pkg</pkg-ref>
<!-- List them again here. They can now be organized
as a hierarchy if you want. -->
<choices-outline>