diff options
author | Memphiz <memphis@machzwo.de> | 2014-08-14 23:25:29 +0200 |
---|---|---|
committer | Memphiz <memphis@machzwo.de> | 2014-10-19 21:33:03 +0200 |
commit | bc71a0a6a5450957bd8d560b6ccd08a98b0dcb01 (patch) | |
tree | 3fa86fd438290b385005d9c3796a5e13ca184304 /tools/darwin/packaging/osx | |
parent | a7e43070ed9b7a4722da919608a32cd40fc413ce (diff) |
[rebrand][packaging/osx/ios/atv2] - move all package scripts to appname
agnostic folders, rename them to be appname agnostic and use @APP_NAME@ -
also add migration step in debian post-inst which will move XBMC data to Kodi if found
Diffstat (limited to 'tools/darwin/packaging/osx')
-rw-r--r-- | tools/darwin/packaging/osx/VolumeDSStore | bin | 0 -> 12292 bytes | |||
-rw-r--r-- | tools/darwin/packaging/osx/VolumeDSStoreApp | bin | 0 -> 12292 bytes | |||
-rw-r--r-- | tools/darwin/packaging/osx/VolumeIcon.icns | bin | 0 -> 219878 bytes | |||
-rw-r--r-- | tools/darwin/packaging/osx/background/DiskImageBackground.png | bin | 0 -> 22292 bytes | |||
-rw-r--r-- | tools/darwin/packaging/osx/background/DiskImageBackgroundDebug.png | bin | 0 -> 22292 bytes | |||
-rwxr-xr-x | tools/darwin/packaging/osx/dmgmaker.pl | 81 | ||||
-rwxr-xr-x | tools/darwin/packaging/osx/mkdmg-osx.sh.in | 41 |
7 files changed, 122 insertions, 0 deletions
diff --git a/tools/darwin/packaging/osx/VolumeDSStore b/tools/darwin/packaging/osx/VolumeDSStore Binary files differnew file mode 100644 index 0000000000..387b6e21eb --- /dev/null +++ b/tools/darwin/packaging/osx/VolumeDSStore diff --git a/tools/darwin/packaging/osx/VolumeDSStoreApp b/tools/darwin/packaging/osx/VolumeDSStoreApp Binary files differnew file mode 100644 index 0000000000..f1a82a4bbb --- /dev/null +++ b/tools/darwin/packaging/osx/VolumeDSStoreApp diff --git a/tools/darwin/packaging/osx/VolumeIcon.icns b/tools/darwin/packaging/osx/VolumeIcon.icns Binary files differnew file mode 100644 index 0000000000..75215701b6 --- /dev/null +++ b/tools/darwin/packaging/osx/VolumeIcon.icns diff --git a/tools/darwin/packaging/osx/background/DiskImageBackground.png b/tools/darwin/packaging/osx/background/DiskImageBackground.png Binary files differnew file mode 100644 index 0000000000..2299a1ac75 --- /dev/null +++ b/tools/darwin/packaging/osx/background/DiskImageBackground.png diff --git a/tools/darwin/packaging/osx/background/DiskImageBackgroundDebug.png b/tools/darwin/packaging/osx/background/DiskImageBackgroundDebug.png Binary files differnew file mode 100644 index 0000000000..2299a1ac75 --- /dev/null +++ b/tools/darwin/packaging/osx/background/DiskImageBackgroundDebug.png diff --git a/tools/darwin/packaging/osx/dmgmaker.pl b/tools/darwin/packaging/osx/dmgmaker.pl new file mode 100755 index 0000000000..4720bf047a --- /dev/null +++ b/tools/darwin/packaging/osx/dmgmaker.pl @@ -0,0 +1,81 @@ +#!/usr/bin/perl + +# Copyright (C) 2008-2013 Team Kodi +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use strict; +use warnings; + +sub make_dmg { + my $mpkg = shift; + my $volname = shift; + my $pkgname = shift; + my $dev_handle; + + die("Could not find \"$mpkg\"\n") + if ! -d $mpkg; + + my $ext = $1 if $mpkg =~ /.*\.(.*?)$/; + $ext = "mpkg" if !$ext; + + # thanks to http://dev.simon-cozens.org/songbee/browser/release-manager-tools/build-dmg.sh + `hdiutil create -fs HFS+ -volname "$volname" -format UDRW -srcfolder "$mpkg" "$volname.dmg"`; + $dev_handle = `hdiutil attach -readwrite -noverify -noautoopen "$volname.dmg" | grep Apple_HFS`; + chomp $dev_handle; + $dev_handle = $1 if $dev_handle =~ /^\/dev\/(disk.)/; + die("Could not obtain device handle\n") if !$dev_handle; + print "Got device handle \"$dev_handle\"\n"; + print "Ignore \"No space left on device\" warnings from ditto, they are an autosize artifact\n"; + `ditto "$mpkg" "/Volumes/$volname/$pkgname.$ext"`; + + # set a volume icon if we have one + if ( -f "VolumeIcon.icns" ) { + `ditto VolumeIcon.icns "/Volumes/$volname/.VolumeIcon.icns"`; + } + # make symlink to /Applications + `ln -s /Applications "/Volumes/$volname/Applications"`; + + if ( -d "background" ) { + `mkdir "/Volumes/$volname/background"`; + `ditto background "/Volumes/$volname/background/"`; + } + if ( -f "VolumeDSStore" ) { + `ditto VolumeDSStore "/Volumes/$volname/.DS_Store"` if $ext ne "app"; + `ditto VolumeDSStoreApp "/Volumes/$volname/.DS_Store"` if $ext eq "app"; + } + if ( -d "background" ) { + `xcrun SetFile -a V "/Volumes/$volname/background"`; + } + `xcrun SetFile -a C "/Volumes/$volname/"`; + `hdiutil detach $dev_handle`; + `hdiutil convert "$volname.dmg" -format UDZO -imagekey zlib-level=9 -o "$volname.udzo.dmg"`; + `rm -f "$volname.dmg"`; + `mv "$volname.udzo.dmg" "$volname.dmg"`; + `hdiutil internet-enable -yes "$volname.dmg"`; +} + +if (! defined $ARGV[0]) { + die("Please specify the mpkg to make a DMG of as the first argument\n". + "or -c to create a package and use it.\n"); +} + +if ( $ARGV[0] eq "-c" ) { + die("TODO: -c\n"); + #make_dmg(make_mpkg(), "Kodi Atlantis - 8.10", "Kodi Media Center"); + exit; +} + +make_dmg($ARGV[0], $ARGV[1], "Kodi"); diff --git a/tools/darwin/packaging/osx/mkdmg-osx.sh.in b/tools/darwin/packaging/osx/mkdmg-osx.sh.in new file mode 100755 index 0000000000..39b0e12eb5 --- /dev/null +++ b/tools/darwin/packaging/osx/mkdmg-osx.sh.in @@ -0,0 +1,41 @@ +#!/bin/sh + +# usage: ./mkdmg-osx.sh release/debug (case insensitive) +# Allows us to run mkdmg-osx.sh from anywhere in the three, rather than the tools/darwin/packaging/osx folder only +SWITCH=`echo $1 | tr [A-Z] [a-z]` +DIRNAME=`dirname $0` + +if [ ${SWITCH:-""} = "debug" ]; then + echo "Packaging Debug target for OSX" + APP="$DIRNAME/../../../../build/Debug/@APP_NAME@.app" +elif [ ${SWITCH:-""} = "release" ]; then + echo "Packaging Release target for OSX" + APP="$DIRNAME/../../../../build/Release/@APP_NAME@.app" +else + echo "You need to specify the build target" + exit 1 +fi + +if [ ! -d $APP ]; then + echo "@APP_NAME@.app not found! are you sure you built $1 target?" + exit 1 +fi +ARCHITECTURE=`file $APP/Contents/MacOS/@APP_NAME@ | awk '{print $NF}'` + +PACKAGE=org.xbmc.kodi-osx + +VERSION=@APP_VERSION_MAJOR@.@APP_VERSION_MINOR@ +REVISION=0~@APP_VERSION_TAG_LC@ +ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_macosx-intel-${ARCHITECTURE} + +echo Creating $PACKAGE package version $VERSION revision $REVISION +${SUDO} rm -rf $DIRNAME/$ARCHIVE + +if [ -e "/Volumes/$ARCHIVE" ] +then + umount /Volumes/$ARCHIVE +fi + +$DIRNAME/dmgmaker.pl $APP $ARCHIVE + +echo "done" |