if test ! -f tools/testosx; then
echo "Run this script from the top-level CUPS source directory, e.g.:"
echo ""
- echo " tools/testosx"
+ echo " tools/testosx [version]"
echo ""
exit 1
fi
# Get the current working copy version...
rev=`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[a-zA-Z]*//g'`
+if test $# = 0; then
+ version="1.2svn-r$rev"
+else
+ version=$1
+fi
+
# Setup an install directory...
user=`whoami`
topdir=`pwd`
# Install resource files into the Resources directory...
echo Installing resource files...
cp packaging/LICENSE.rtf $pkgdir/Resources/ReadMe.rtf
-cp packaging/WELCOME.rtf $pkgdir/Resources/Welcome.rtf
+sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \
+ <packaging/WELCOME.rtf >$pkgdir/Resources/Welcome.rtf
cp packaging/installer.tif $pkgdir/Resources/background.tif
cat >$pkgdir/Resources/preflight <<EOF
chmod 755 $pkgdir/Resources/postflight
# Tag the current revision in the plist and web interface files...
-sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
- -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
- <packaging/cups-desc.plist.in >packaging/cups-desc.plist
-sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
- -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
- <packaging/cups-info.plist.in >packaging/cups-info.plist
-sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
- <doc/index.html.in >doc/index.html
-sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
- <templates/header.tmpl.in >templates/header.tmpl
+for file in packaging/cups-desc.plist packaging/cups-info.plist \
+ doc/index.html doc/ja/index.html templates/header.tmpl; do
+ echo Updating $file...
+ sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \
+ -e '1,$s/@CUPS_REVISION@//g' \
+ -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
+ <$file.in >$file
+done
# Install CUPS into the Package directory...
#make INSTALL=$topdir/install-sh BUILDROOT=$pkgdir/Package install
# Create a disk image...
echo Creating MacOS X disk image...
-hdiutil create -ov -srcfolder cups.pkg cups-1.2svn-r$rev.dmg
+hdiutil create -ov -srcfolder cups.pkg cups-$version.dmg
# Cleanup temp files...
echo Removing temporary files...