PBProjects/pkg-support/mkpackage.sh
author Ryan C. Gordon <icculus@icculus.org>
Mon, 23 Mar 2009 01:43:05 -0400
branchstable-1.0
changeset 966 816a83f04a27
parent 518 678bd642c6b5
permissions -rwxr-xr-x
Updated version to 1.0.2 in configure.in ...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
518
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     1
#!/bin/sh
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     2
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     3
# Generic script to create a package with Project Builder in mind
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     4
# There should only be one version of this script for all projects!
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     5
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     6
FRAMEWORK="$1"
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     7
VARIANT="$2"
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     8
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     9
if test "$VARIANT" = "devel" ; then
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    10
  PACKAGE="$FRAMEWORK-devel"
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    11
  PACKAGE_RESOURCES="pkg-support/devel-resources"	
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    12
else
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    13
  PACKAGE="$FRAMEWORK"
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    14
  PACKAGE_RESOURCES="pkg-support/resources"
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    15
fi
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    16
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    17
echo "Building package for $FRAMEWORK.framework"
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    18
echo "Will fetch resources from $PACKAGE_RESOURCES"
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    19
echo "Will create the package $PACKAGE.pkg"
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    20
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    21
# create a copy of the framework
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    22
mkdir -p build/pkg-tmp
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    23
/Developer/Tools/CpMac -r "build/$FRAMEWORK.framework" build/pkg-tmp/
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    24
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    25
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    26
if test "$VARIANT" = "standard" ; then
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    27
  rm -rf "build/pkg-tmp/$FRAMEWORK.framework/Headers"
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    28
  rm -rf "build/pkg-tmp/$FRAMEWORK.framework/Versions/Current/Headers"
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    29
fi
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    30
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    31
rm -rf build/pkg-tmp/$FRAMEWORK.framework/Resources/pbdevelopment.plist
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    32
rm -rf $PACKAGE_RESOURCES/.DS_Store
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    33
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    34
# create the .pkg
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    35
package build/pkg-tmp "pkg-support/$PACKAGE.info" -d  build -r "$PACKAGE_RESOURCES"
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    36
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    37
if test "$VARIANT" = "devel" ; then
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    38
  # create install scripts
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    39
  DIR="build/$PACKAGE.pkg"
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    40
  cp "$DIR/install.sh" "$DIR/$PACKAGE.post_install"
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    41
  mv "$DIR/install.sh" "$DIR/$PACKAGE.post_upgrade"
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    42
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    43
  # add execute flag to scripts
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    44
  chmod 755 "$DIR/$PACKAGE.post_install" "$DIR/$PACKAGE.post_upgrade"
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    45
fi
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    46
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    47
# remove temporary files
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    48
rm -rf build/pkg-tmp
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    49
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    50
# compress
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    51
(cd build; tar -zcvf "$PACKAGE.pkg.tar.gz" "$PACKAGE.pkg")