diff --git a/osx/make-PKG.sh b/osx/make-PKG.sh index b593f00623..2f6871cc14 100755 --- a/osx/make-PKG.sh +++ b/osx/make-PKG.sh @@ -16,6 +16,7 @@ if [ -z "${REVISION}" ]; then fi PKG_FILENAME="Xpra-$VERSION-r$REVISION.pkg" rm -f ./image/$PKG_FILENAME >& /dev/null +echo "Making $PKG_FILENAME" #create directory structure: rm -fr ./image/flat ./image/root @@ -23,6 +24,15 @@ mkdir -p ./image/flat/base.pkg ./image/flat/Resources/en.lproj mkdir -p ./image/root/Applications mv ./image/Xpra.app ./image/root/Applications/ +#man page: +mkdir -p ./image/root/usr/share/man/man1 +for x in xpra xpra_launcher; do + gzip -c ../src/man/$x.1 > ./image/root/usr/share/man/man1/$x.1.gz +done +#add cups backend: +mkdir -p ./image/root/usr/libexec/cups/backend/ +cp ../src/cups/xpraforwarder ./image/root/usr/libexec/cups/backend/ +chmod 700 ./image/root/usr/libexec/cups/backend pushd ./image/root >& /dev/null find . | cpio -o --format odc --owner 0:80 | gzip -c > ../flat/base.pkg/Payload @@ -31,11 +41,22 @@ popd >& /dev/null FILECOUNT=`find ./image/root | wc -l` DISKUSAGE=`du -sk ./image/root` +#add the postinstall fix script (cups backend and shortcuts) +mkdir ./image/scripts +cp postinstall ./image/scripts/ +chmod +x ./image/scripts/postinstall +pushd ./image/scripts >& /dev/null +find . | cpio -o --format odc --owner 0:80 | gzip -c > ../flat/base.pkg/Scripts +popd >& /dev/null + mkbom -u 0 -g 80 ./image/root ./image/flat/base.pkg/Bom cat > ./image/flat/base.pkg/PackageInfo << EOF + + + @@ -73,8 +94,9 @@ pushd ./image/flat >& /dev/null xar --compression none -cf "../$PKG_FILENAME" * popd >& /dev/null -#clean temporary directories -rm -fr ./image/flat ./image/root +#clean temporary build directories +rm -fr ./image/flat ./image/root ./image/scripts -#show resulting file +#show resulting file and copy it to the desktop du -sm ./image/$PKG_FILENAME +cp ./image/$PKG_FILENAME ~/Desktop/ diff --git a/osx/postinstall b/osx/postinstall new file mode 100755 index 0000000000..ee5b6e3050 --- /dev/null +++ b/osx/postinstall @@ -0,0 +1,24 @@ +#!/bin/bash +# this script will: +# * fix cups backend permissions which are not preserved: +# * add scripts in /usr/bin to launch the xpra commands + +chown root:wheel /usr/libexec/cups/backend/xpraforwarder +chmod 700 /usr/libexec/cups/backend/xpraforwarder + +#FIXME: figure out where we were installed if using a custom location.. +APP_ROOT="/Applications/Xpra.app" +if [ -d "$APP_ROOT" ]; then + for x in Xpra Xpra_Launcher; do + echo '#!/bin/sh' > /usr/bin/$x + echo exec $APP_ROOT/Contents/MacOS/$x \"\$@\" >> /usr/bin/$x + chown root:wheel /usr/bin/$x + chmod 755 /usr/bin/$x + done + for x in Bug_Report Config_info Encoding_info GStreamer_info GTK_info Keyboard_Tool Keymap_info Network_info OpenGL_check Path_info PowerMonitor Print Python Version_info Webcam_Test;do + echo '#!/bin/sh' > /usr/bin/Xpra_$x + echo exec $APP_ROOT/Contents/Helpers/$x \"\$@\" >> /usr/bin/Xpra_$x + chown root:wheel /usr/bin/Xpra_$x + chmod 755 /usr/bin/Xpra_$x + done +fi