Packaging script for Mac OS X .pkg.

This commit is contained in:
Peter Iannucci
2012-04-09 02:25:40 -04:00
committed by Keith Winstein
parent 4d9483bc83
commit 4012348ec7
7 changed files with 528 additions and 0 deletions
+57
View File
@@ -0,0 +1,57 @@
#!/bin/bash
echo "Building into prefix..."
mkdir -p prefix
pushd .. > /dev/null
if [ ! -f configure ];
then
echo "Running autogen."
./autogen.sh
fi
CONFIG_ARGS=--prefix=`pwd`/macosx/prefix
if [ -f config.log ];
then
grep -e "$CONFIG_ARGS" config.log > /dev/null || ./configure "$CONFIG_ARGS"
else
./configure "$CONFIG_ARGS"
fi
make install -j8
popd > /dev/null
echo "Preprocessing package description..."
PACKAGE_VERSION=`grep PACKAGE_VERSION ../config.h | sed -e 's/^.*"\(.*\)"$/\1/'`
INDIR=mosh-package.pmdoc.in
OUTDIR=mosh-package.pmdoc
OUTFILE="Mosh $PACKAGE_VERSION.pkg"
mkdir -p "$OUTDIR"
pushd "$INDIR" > /dev/null
for file in *
do
sed -e 's/$PACKAGE_VERSION/'"$PACKAGE_VERSION"'/g' "$file" > "../$OUTDIR/$file"
done
popd > /dev/null
echo "Running PackageMaker..."
/Applications/PackageMaker.app/Contents/MacOS/PackageMaker -d mosh-package.pmdoc -o "$OUTFILE"
echo "Cleaning up..."
rm -r "$OUTDIR"
if [ -f "$OUTFILE" ];
then
echo "Successfully built $OUTFILE."
else
echo "There was an error building $OUTFILE."
fi