Apple2GSBuildPipeline/pkg/createPackage

45 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
TMPDIR=/tmp/pkg.$$
mkdir $TMPDIR
cp -R pkg/Templates $TMPDIR
cp -R pkg/Specifications $TMPDIR
cp -R pkg/Plug-ins $TMPDIR
PROJECTS=/tmp/projects.$$
cat > $PROJECTS << EOF
cda:orca:ORCAC Classic Desk Accessory
cda:orca:ORCAM Classic Desk Accessory
cdev:orca:ORCAC Control Panel
cdev:orca:ORCAM Control Panel
desktop:orca:ORCAC Desktop Application
desktop:orca:ORCAM Desktop Application
shell:gno:ORCAC GNO Shell Command
nda:orca:ORCAC New Desk Accessory
nda:orca:ORCAM New Desk Accessory
shell:orca:ORCAC Shell Command
shell:orca:ORCAM Shell Command
EOF
while read PROJECT
do
PROJECTTYPE=`echo $PROJECT | awk -F: '{print $1}'`
SHELLTYPE=`echo $PROJECT | awk -F: '{print $2}'`
PROJECTNAME=`echo $PROJECT | awk -F: '{print $3}'`
sed "
/^# TARGETTYPE=${PROJECTTYPE}/s/^# //
/^# export ORCA=.*\/${SHELLTYPE}$/s/^# //" Makefile > "${TMPDIR}/Templates/Apple IIgs/${PROJECTNAME}.xctemplate/Makefile"
cp -R make "${TMPDIR}/Templates/Apple IIgs/${PROJECTNAME}.xctemplate/"
done < $PROJECTS
rm -f $PROJECTS
pkgbuild --root $TMPDIR --version 1.1 --identifier com.halcyontouch.Apple2gsTemplate.pkg --install-location /Library/Developer/Xcode/ --scripts pkg/scripts/ Apple2GSXcodeTemplate.pkg
productbuild --distribution pkg/Distribution.xml --resource ./pkg temp.pkg
rm Apple2GSXcodeTemplate.pkg
productsign --sign "Developer ID Installer" temp.pkg Apple2GSXcodeTemplate.pkg
rm temp.pkg
rm -rf $TMPDIR