[vlc-commits] extras/macosx: add script to create a disk-image for distribution as well as an apple script to beautify the file icon layout

Felix Paul Kühne git at videolan.org
Fri Nov 22 22:06:29 CET 2013


npapi-vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Fri Nov 22 22:04:34 2013 +0100| [9b31a79175191d1d00dd8b9f154cdba61276569a] | committer: Felix Paul Kühne

extras/macosx: add script to create a disk-image for distribution as well as an apple script to beautify the file icon layout

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=9b31a79175191d1d00dd8b9f154cdba61276569a
---

 extras/macosx/create-dmg.sh              |   61 ++++++++++++++++++++++++++++++
 extras/macosx/create-universal-binary.sh |    2 +-
 extras/macosx/dmg_setup.scpt             |  Bin 0 -> 4802 bytes
 3 files changed, 62 insertions(+), 1 deletion(-)

diff --git a/extras/macosx/create-dmg.sh b/extras/macosx/create-dmg.sh
new file mode 100755
index 0000000..8e3e5fe
--- /dev/null
+++ b/extras/macosx/create-dmg.sh
@@ -0,0 +1,61 @@
+#!/bin/sh
+set -e
+
+info()
+{
+    local green="\033[1;32m"
+    local normal="\033[0m"
+    echo "[${green}build${normal}] $1"
+}
+
+spushd()
+{
+    pushd "$1" > /dev/null
+}
+
+spopd()
+{
+    popd > /dev/null
+}
+
+out="/dev/null"
+
+npapiroot=`dirname $0`/../..
+
+UBROOT="${npapiroot}/VLC Plugin.plugin"
+DMGFOLDERNAME="VLC Browser Plug-in for Mac"
+DMGITEMNAME="VLC-webplugin-REPLACEWITHVERSION"
+
+info "checking for distributable binary package"
+
+spushd ${npapiroot}
+if [ ! -e "${UBROOT}" ]; then
+    info "Universal Binary not found for distribution, creating..."
+    ./extras/macosx/create-universal-binary.sh
+fi
+
+info "Collecting items"
+mkdir -p "${DMGFOLDERNAME}"
+cp -R "${UBROOT}" "${DMGFOLDERNAME}"
+cp NEWS AUTHORS COPYING "${DMGFOLDERNAME}"
+ln -s "/Library/Internet Plug-Ins" "${DMGFOLDERNAME}/Internet Plug-Ins"
+rm -f ${DMGITEMNAME}-rw.dmg
+
+info "Creating disk-image"
+hdiutil create -srcfolder ${npapiroot}/"${DMGFOLDERNAME}" "${npapiroot}/${DMGITEMNAME}-rw.dmg" -scrub -format UDRW
+mkdir -p ./mount
+
+info "Moving file icons around"
+hdiutil attach -readwrite -noverify -noautoopen -mountRoot ./mount ${DMGITEMNAME}-rw.dmg
+osascript "${npapiroot}"/extras/macosx/dmg_setup.scpt "${DMGFOLDERNAME}"
+hdiutil detach ./mount/"${DMGFOLDERNAME}"
+
+info "Compressing disk-image"
+rm -f ${DMGITEMNAME}.dmg
+hdiutil convert "${npapiroot}/${DMGITEMNAME}-rw.dmg" -format UDBZ -o "${npapiroot}/${DMGITEMNAME}.dmg"
+rm -f ${DMGITEMNAME}-rw.dmg
+rm -rf "${DMGFOLDERNAME}"
+
+spopd
+
+info "Disk-image created"
diff --git a/extras/macosx/create-universal-binary.sh b/extras/macosx/create-universal-binary.sh
index 1a022cd..be9f303 100755
--- a/extras/macosx/create-universal-binary.sh
+++ b/extras/macosx/create-universal-binary.sh
@@ -18,7 +18,7 @@ spopd()
     popd > /dev/null
 }
 
-#out="/dev/null"
+out="/dev/null"
 
 npapiroot=`dirname $0`/../..
 INTEL32ROOT="${npapiroot}/i686-build/VLC Plugin.plugin"
diff --git a/extras/macosx/dmg_setup.scpt b/extras/macosx/dmg_setup.scpt
new file mode 100644
index 0000000..ceaeb23
Binary files /dev/null and b/extras/macosx/dmg_setup.scpt differ



More information about the vlc-commits mailing list