Skip to content

Commit

Permalink
#641:
Browse files Browse the repository at this point in the history
* ship the man page
* ship the cups backend
* add postinstall script to fix cups backend permission and add shortcuts in /usr/bin
* copy PKG to the desktop when finished

git-svn-id: https://xpra.org/svn/Xpra/trunk@12376 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 12, 2016
1 parent 5df4157 commit 80774cd
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
28 changes: 25 additions & 3 deletions osx/make-PKG.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,23 @@ 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
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
Expand All @@ -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
<pkg-info format-version="2" identifier="org.xpra.pkg" version="$VERSION" install-location="/" auth="root">
<payload installKBytes="$DISKUSAGE" numberOfFiles="$FILECOUNT"/>
<scripts>
<postinstall file="./postinstall"/>
</scripts>
<bundle-version>
<bundle id="org.xpra.Xpra" CFBundleIdentifier="Xpra" path="./Applications/Xpra.app" CFBundleVersion="1.3.0"/>
</bundle-version>
Expand Down Expand Up @@ -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/
24 changes: 24 additions & 0 deletions osx/postinstall
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 80774cd

Please sign in to comment.