2017-05-17 02:34:15 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
TMPDIR=/tmp/pkg.$$
|
|
|
|
|
2017-09-01 03:36:51 +00:00
|
|
|
mkdir $TMPDIR
|
2017-05-17 02:34:15 +00:00
|
|
|
cp -R pkg/Templates $TMPDIR
|
2017-09-01 03:36:51 +00:00
|
|
|
cp -R pkg/Specifications $TMPDIR
|
|
|
|
cp -R pkg/Plug-ins $TMPDIR
|
2017-05-17 02:34:15 +00:00
|
|
|
|
2017-05-17 05:04:32 +00:00
|
|
|
PROJECTS=/tmp/projects.$$
|
|
|
|
cat > $PROJECTS << EOF
|
2019-07-12 00:28:12 +00:00
|
|
|
cda:orca:ORCAC Classic Desk Accessory:0:0
|
|
|
|
cda:orca:ORCAM Classic Desk Accessory:0:0
|
2019-07-18 00:42:12 +00:00
|
|
|
cda:merlin:Merlin Classic Desk Accessory:0:0
|
2019-07-12 00:28:12 +00:00
|
|
|
cdev:orca:ORCAC Control Panel:0:0
|
|
|
|
cdev:orca:ORCAM Control Panel:0:0
|
2019-07-18 01:33:08 +00:00
|
|
|
cdev:merlin:Merlin Control Panel:0:0
|
2019-07-12 00:28:12 +00:00
|
|
|
desktop:orca:ORCAC Desktop Application:1:1
|
|
|
|
desktop:orca:ORCAM Desktop Application:1:0
|
2019-07-18 04:11:44 +00:00
|
|
|
desktop:merlin:Merlin Desktop Application:1:0
|
2019-07-12 00:28:12 +00:00
|
|
|
shell:gno:ORCAC GNO Shell Command:0:0
|
|
|
|
nda:orca:ORCAC New Desk Accessory:0:0
|
|
|
|
nda:orca:ORCAM New Desk Accessory:0:0
|
2019-07-18 04:11:44 +00:00
|
|
|
nda:merlin:Merlin New Desk Accessory:0:0
|
2019-07-12 00:28:12 +00:00
|
|
|
shell:orca:ORCAC Shell Command:0:0
|
|
|
|
shell:orca:ORCAM Shell Command:0:0
|
2017-05-17 05:04:32 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
while read PROJECT
|
2017-05-17 02:34:15 +00:00
|
|
|
do
|
2019-07-12 00:28:12 +00:00
|
|
|
PROJECT_TYPE=`echo $PROJECT | awk -F: '{print $1}'`
|
|
|
|
SHELL_TYPE=`echo $PROJECT | awk -F: '{print $2}'`
|
|
|
|
PROJECT_NAME=`echo $PROJECT | awk -F: '{print $3}'`
|
|
|
|
SUPPORTS_RES_MODE=`echo $PROJECT | awk -F: '{print $4}'`
|
|
|
|
SUPPORTS_MESSAGE_CENTER=`echo $PROJECT | awk -F: '{print $5}'`
|
|
|
|
|
2019-07-19 15:51:55 +00:00
|
|
|
cp -R make "${TMPDIR}/Templates/Apple IIgs/${PROJECT_NAME}.xctemplate/"
|
|
|
|
|
2019-07-18 00:42:12 +00:00
|
|
|
if [ $SHELL_TYPE = merlin ]
|
|
|
|
then
|
|
|
|
sed "
|
|
|
|
/^# TARGETTYPE=${PROJECT_TYPE}/s/^# //" Makefile.merlin > "${TMPDIR}/Templates/Apple IIgs/${PROJECT_NAME}.xctemplate/Makefile"
|
2019-07-19 15:51:55 +00:00
|
|
|
rm -f "${TMPDIR}/Templates/Apple IIgs/${PROJECT_NAME}.xctemplate/make/orca-asm"
|
|
|
|
rm -f "${TMPDIR}/Templates/Apple IIgs/${PROJECT_NAME}.xctemplate/make/orca-cc"
|
2019-07-18 00:42:12 +00:00
|
|
|
else
|
|
|
|
sed "
|
|
|
|
/^# TARGETTYPE=${PROJECT_TYPE}/s/^# //
|
|
|
|
/^# export ORCA=.*\/${SHELL_TYPE}$/s/^# //" Makefile > "${TMPDIR}/Templates/Apple IIgs/${PROJECT_NAME}.xctemplate/Makefile"
|
2019-07-19 15:51:55 +00:00
|
|
|
rm -f "${TMPDIR}/Templates/Apple IIgs/${PROJECT_NAME}.xctemplate/make/merlin-asm"
|
2019-07-18 00:42:12 +00:00
|
|
|
fi
|
2019-07-12 00:28:12 +00:00
|
|
|
|
|
|
|
if [ "$SUPPORTS_RES_MODE" -eq 1 ]
|
|
|
|
then
|
|
|
|
sed -i "" 's/^# DESKTOP_RES_MODE=.*$/DESKTOP_RES_MODE=___VARIABLE_RESOLUTIONMODE___/' "${TMPDIR}/Templates/Apple IIgs/${PROJECT_NAME}.xctemplate/Makefile"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$SUPPORTS_MESSAGE_CENTER" -eq 1 ]
|
|
|
|
then
|
|
|
|
sed -i "" 's/^# MESSAGE_CENTER=.*$/MESSAGE_CENTER=___VARIABLE_MESSAGECENTER___/' "${TMPDIR}/Templates/Apple IIgs/${PROJECT_NAME}.xctemplate/Makefile"
|
|
|
|
fi
|
|
|
|
|
2017-05-17 05:04:32 +00:00
|
|
|
done < $PROJECTS
|
|
|
|
|
|
|
|
rm -f $PROJECTS
|
2017-05-17 02:34:15 +00:00
|
|
|
|
2019-08-08 02:25:17 +00:00
|
|
|
pkgbuild --root $TMPDIR --version 2.0.3 --identifier com.halcyontouch.Apple2gsTemplate.pkg --install-location /Library/Developer/Xcode/ --scripts pkg/scripts/ Apple2GSXcodeTemplate.pkg
|
2017-05-17 02:34:15 +00:00
|
|
|
productbuild --distribution pkg/Distribution.xml --resource ./pkg temp.pkg
|
|
|
|
rm Apple2GSXcodeTemplate.pkg
|
2017-09-10 04:28:45 +00:00
|
|
|
productsign --sign "Developer ID Installer" temp.pkg Apple2GSXcodeTemplate.pkg
|
2017-05-17 02:34:15 +00:00
|
|
|
rm temp.pkg
|
|
|
|
|
2017-09-10 04:28:45 +00:00
|
|
|
rm -rf $TMPDIR
|