5 # usage: ./mkdeb-ios.sh release/debug (case insensitive)
6 # Allows us to run mkdeb-ios.sh from anywhere in the three, rather than the tools/darwin/packaging/ios folder only
7 NATIVEPREFIX
=@NATIVEPREFIX@
8 SWITCH
=`echo $1 | tr [A-Z] [a-z]`
10 DSYM_TARGET_DIR
=/Users
/Shared
/xbmc-depends
/dSyms
11 DSYM_FILENAME
=@APP_NAME@.app.dSYM
13 if [ "@PLATFORM@" == "appletvos" ]; then
17 if [ "${SWITCH#*debug}" != "${SWITCH}" ]; then
18 echo "Packaging Debug target for ${PP_DEVICE}"
19 APP
="$DIRNAME/../../../../build/Debug-@PLATFORM@/@APP_NAME@.app"
20 DSYM
="$DIRNAME/../../../../build/Debug-@PLATFORM@/$DSYM_FILENAME"
21 elif [ "${SWITCH#*release}" != "${SWITCH}" ]; then
22 echo "Packaging Release target for ${PP_DEVICE}"
23 APP
="$DIRNAME/../../../../build/Release-@PLATFORM@/@APP_NAME@.app"
24 DSYM
="$DIRNAME/../../../../build/Release-@PLATFORM@/$DSYM_FILENAME"
26 echo "You need to specify the build target"
30 #copy bzip2 of dsym to xbmc-depends install dir
32 if [ -d $DSYM_TARGET_DIR ]; then
33 tar -C $DSYM/..
-c $DSYM_FILENAME/ |
bzip2 > $DSYM_TARGET_DIR/`$DIRNAME/../gitrev-posix`-${DSYM_FILENAME}.
tar.bz2
38 if [ ! -d $APP ]; then
39 echo "@APP_NAME@.app not found! are you sure you built $1 target?"
43 if [ -f "${NATIVEPREFIX}/bin/dpkg-deb" ]; then
44 # make sure we pickup our tar, gnutar will fail when dpkg -i
45 bin_path
=$
(cd ${NATIVEPREFIX}/bin
; pwd)
46 export PATH
=${bin_path}:${PATH}
49 PACKAGE
="@PLATFORM_BUNDLE_IDENTIFIER@"
50 PACKAGE_ARM64
="${PACKAGE}64"
52 VERSION
=@APP_VERSION_MAJOR@.@APP_VERSION_MINOR@
55 if [ "@APP_VERSION_TAG_LC@" != "" ]; then
56 REVISION
=$REVISION~@APP_VERSION_TAG_LC@
58 # customize revision string
59 [ ! -z "$2" ] && REVISION
="$2"
61 ARCHIVE
=${PACKAGE_ARM64}_${VERSION}-${REVISION}_@PLATFORM@
-arm.deb
63 SIZE
="$(du -s -k ${APP} | awk '{print $1}')"
65 echo Creating
$PACKAGE package version
$VERSION revision
$REVISION
66 rm -rf $DIRNAME/$PACKAGE
67 rm -rf $DIRNAME/$ARCHIVE
69 # create debian control file.
70 mkdir
-p $DIRNAME/$PACKAGE/DEBIAN
71 echo "Package: $PACKAGE_ARM64" > $DIRNAME/$PACKAGE/DEBIAN
/control
72 echo "Name: @APP_NAME@-${PP_DEVICE} (64-bit)" >> $DIRNAME/$PACKAGE/DEBIAN
/control
73 echo "Pre-Depends: cy+cpu.arm64" >> $DIRNAME/$PACKAGE/DEBIAN
/control
74 echo "Conflicts: $PACKAGE" >> $DIRNAME/$PACKAGE/DEBIAN
/control
75 echo "Replaces: $PACKAGE" >> $DIRNAME/$PACKAGE/DEBIAN
/control
76 echo "Priority: Extra" >> $DIRNAME/$PACKAGE/DEBIAN
/control
77 echo "Version: $VERSION-$REVISION" >> $DIRNAME/$PACKAGE/DEBIAN
/control
78 if [ "@PLATFORM@" == "iphoneos" ]; then
79 echo "Architecture: iphoneos-arm" >> $DIRNAME/$PACKAGE/DEBIAN
/control
81 echo "Architecture: appletvos-arm64" >> $DIRNAME/$PACKAGE/DEBIAN
/control
83 echo "Installed-Size: $SIZE" >> $DIRNAME/$PACKAGE/DEBIAN
/control
84 echo "Description: @APP_NAME@ Entertainment Center for iOS" >> $DIRNAME/$PACKAGE/DEBIAN
/control
85 echo "Homepage: @APP_WEBSITE@" >> $DIRNAME/$PACKAGE/DEBIAN
/control
86 echo "Maintainer: Memphiz et al." >> $DIRNAME/$PACKAGE/DEBIAN
/control
87 echo "Author: Team-@APP_NAME@" >> $DIRNAME/$PACKAGE/DEBIAN
/control
88 echo "Section: Multimedia" >> $DIRNAME/$PACKAGE/DEBIAN
/control
89 echo "Icon: file:///Applications/@APP_NAME@.app/AppIcon57x57.png" >> $DIRNAME/$PACKAGE/DEBIAN
/control
91 # prerm: called on remove and upgrade - get rid of existing bits.
92 echo "#!/bin/sh" > $DIRNAME/$PACKAGE/DEBIAN
/prerm
93 echo "find /Applications/@APP_NAME@.app -delete" >> $DIRNAME/$PACKAGE/DEBIAN
/prerm
94 chmod +x
$DIRNAME/$PACKAGE/DEBIAN
/prerm
96 # postinst: nothing for now.
97 echo "#!/bin/sh" > $DIRNAME/$PACKAGE/DEBIAN
/postinst
98 echo "chown -R mobile:mobile /Applications/@APP_NAME@.app" >> $DIRNAME/$PACKAGE/DEBIAN
/postinst
99 echo "/usr/bin/uicache" >> $DIRNAME/$PACKAGE/DEBIAN
/postinst
100 echo "echo 'finish:respringing ...'" >> $DIRNAME/$PACKAGE/DEBIAN
/postinst
101 chmod +x
$DIRNAME/$PACKAGE/DEBIAN
/postinst
103 # prep @APP_NAME@.app
104 mkdir
-p $DIRNAME/$PACKAGE/Applications
105 rsync
-a --no-links $APP $DIRNAME/$PACKAGE/Applications
/
106 find $DIRNAME/$PACKAGE/Applications
/ -name '.svn' -exec rm -rf {} \
;
107 find $DIRNAME/$PACKAGE/Applications
/ -name '.git*' -exec rm -rf {} \
;
108 find $DIRNAME/$PACKAGE/Applications
/ -name '.DS_Store' -exec rm -rf {} \
;
110 echo Packaging
$PACKAGE
111 # Tell tar, pax, etc. on Mac OS X 10.4+ not to archive
112 # extended attributes (e.g. resource forks) to ._* archive members.
113 # Also allows archiving and extracting actual ._* files.
114 export COPYFILE_DISABLE
=true
115 export COPY_EXTENDED_ATTRIBUTES_DISABLE
=true
117 dpkg-deb
-bZ xz
--no-uniform-compression --root-owner-group $DIRNAME/$PACKAGE $DIRNAME/$ARCHIVE
118 dpkg-deb
--info $DIRNAME/$ARCHIVE
119 dpkg-deb
--contents $DIRNAME/$ARCHIVE
121 # clean up by removing package dir
122 rm -rf $DIRNAME/$PACKAGE