Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
[ios] cleanup mkdeb scripts, Allows us to run mkdeb-xbmc-xxx.sh from …
Browse files Browse the repository at this point in the history
…anywhere in the three, rather than the tools/osx/packaging/xbmc-xxx folder only
  • Loading branch information
amet committed Mar 21, 2011
1 parent 1996df5 commit 251ed82
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 81 deletions.
94 changes: 48 additions & 46 deletions tools/osx/packaging/xbmc-atv2/mkdeb-xbmc-atv2.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/bin/sh
# usage: ./mkdeb-xbmc-atv2.sh release/debug (case insensitive)

# Allows us to run mkdeb-xbmc-atv2.sh from anywhere in the three, rather than the tools/osx/packaging/xbmc-atv2 folder only
SWITCH=`echo $1 | tr [A-Z] [a-z]`
DIRNAME=`dirname $0`

if [ $SWITCH = "debug" ]; then
if [ ${SWITCH:-""} = "debug" ]; then
echo "Packaging Debug target for ATV2"
XBMC="../../../../build/Debug-iphoneos/XBMC.frappliance"
elif [ $SWITCH = "release" ]; then
XBMC="$DIRNAME/../../../../build/Debug-iphoneos/XBMC.frappliance"
elif [ ${SWITCH:-""} = "release" ]; then
echo "Packaging Release target for ATV2"
XBMC="../../../../build/Release-iphoneos/XBMC.frappliance"
XBMC="$DIRNAME/../../../../build/Release-iphoneos/XBMC.frappliance"
echo $XBMC
else
echo "You need to specify the build target"
exit 1
Expand All @@ -34,53 +36,53 @@ REVISION=7
ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_iphoneos-arm.deb

echo Creating $PACKAGE package version $VERSION revision $REVISION
${SUDO} rm -rf $PACKAGE
${SUDO} rm -rf $ARCHIVE
${SUDO} rm -rf $DIRNAME/$PACKAGE
${SUDO} rm -rf $DIRNAME/$ARCHIVE

# create debian control file.
mkdir -p $PACKAGE/DEBIAN
echo "Package: $PACKAGE" > $PACKAGE/DEBIAN/control
echo "Priority: Extra" >> $PACKAGE/DEBIAN/control
echo "Name: XBMC-ATV2" >> $PACKAGE/DEBIAN/control
echo "Depends: curl, org.awkwardtv.whitelist, org.xbmc.xbmc-seatbeltunlock" >> $PACKAGE/DEBIAN/control
echo "Version: $VERSION-$REVISION" >> $PACKAGE/DEBIAN/control
echo "Architecture: iphoneos-arm" >> $PACKAGE/DEBIAN/control
echo "Description: XBMC Multimedia Center for AppleTV 2" >> $PACKAGE/DEBIAN/control
echo "Homepage: http://xbmc.org/" >> $PACKAGE/DEBIAN/control
echo "Maintainer: Scott Davilla, Edgar Hucek" >> $PACKAGE/DEBIAN/control
echo "Author: TeamXBMC" >> $PACKAGE/DEBIAN/control
echo "Section: Multimedia" >> $PACKAGE/DEBIAN/control
mkdir -p $DIRNAME/$PACKAGE/DEBIAN
echo "Package: $PACKAGE" > $DIRNAME/$PACKAGE/DEBIAN/control
echo "Priority: Extra" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Name: XBMC-ATV2" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Depends: curl, org.awkwardtv.whitelist, org.xbmc.xbmc-seatbeltunlock" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Version: $VERSION-$REVISION" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Architecture: iphoneos-arm" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Description: XBMC Multimedia Center for AppleTV 2" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Homepage: http://xbmc.org/" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Maintainer: Scott Davilla, Edgar Hucek" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Author: TeamXBMC" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Section: Multimedia" >> $DIRNAME/$PACKAGE/DEBIAN/control

# prerm: called on remove and upgrade - get rid of existing bits.
echo "#!/bin/sh" > $PACKAGE/DEBIAN/prerm
echo "rm -rf /Applications/XBMC.frappliance" >> $PACKAGE/DEBIAN/prerm
echo "if [ \"\`uname -r\`\" = \"10.3.1\" ]; then" >> $PACKAGE/DEBIAN/prerm
echo " rm -rf /Applications/Lowtide.app/Appliances/XBMC.frappliance" >> $PACKAGE/DEBIAN/prerm
echo "else" >> $PACKAGE/DEBIAN/prerm
echo " rm -rf /Applications/AppleTV.app/Appliances/XBMC.frappliance" >> $PACKAGE/DEBIAN/prerm
echo "fi" >> $PACKAGE/DEBIAN/prerm
chmod +x $PACKAGE/DEBIAN/prerm
echo "#!/bin/sh" > $DIRNAME/$PACKAGE/DEBIAN/prerm
echo "rm -rf /Applications/XBMC.frappliance" >> $DIRNAME/$PACKAGE/DEBIAN/prerm
echo "if [ \"\`uname -r\`\" = \"10.3.1\" ]; then" >> $DIRNAME/$PACKAGE/DEBIAN/prerm
echo " rm -rf /Applications/Lowtide.app/Appliances/XBMC.frappliance" >> $DIRNAME/$PACKAGE/DEBIAN/prerm
echo "else" >> $DIRNAME/$PACKAGE/DEBIAN/prerm
echo " rm -rf /Applications/AppleTV.app/Appliances/XBMC.frappliance" >> $DIRNAME/$PACKAGE/DEBIAN/prerm
echo "fi" >> $DIRNAME/$PACKAGE/DEBIAN/prerm
chmod +x $DIRNAME/$PACKAGE/DEBIAN/prerm

# postinst: symlink XBMC.frappliance into correct location and reload Lowtide/AppleTV.
echo "#!/bin/sh" > $PACKAGE/DEBIAN/postinst
echo "if [ \"\`uname -r\`\" = \"10.3.1\" ]; then" >> $PACKAGE/DEBIAN/postinst
echo " ln -sf /Applications/XBMC.frappliance /Applications/Lowtide.app/Appliances/XBMC.frappliance" >> $PACKAGE/DEBIAN/postinst
echo " killall Lowtide" >> $PACKAGE/DEBIAN/postinst
echo "else" >> $PACKAGE/DEBIAN/postinst
echo " ln -sf /Applications/XBMC.frappliance /Applications/AppleTV.app/Appliances/XBMC.frappliance" >> $PACKAGE/DEBIAN/postinst
echo " killall AppleTV" >> $PACKAGE/DEBIAN/postinst
echo "fi" >> $PACKAGE/DEBIAN/postinst
chmod +x $PACKAGE/DEBIAN/postinst
echo "#!/bin/sh" > $DIRNAME/$PACKAGE/DEBIAN/postinst
echo "if [ \"\`uname -r\`\" = \"10.3.1\" ]; then" >> $DIRNAME/$PACKAGE/DEBIAN/postinst
echo " ln -sf /Applications/XBMC.frappliance /Applications/Lowtide.app/Appliances/XBMC.frappliance" >> $DIRNAME/$PACKAGE/DEBIAN/postinst
echo " killall Lowtide" >> $DIRNAME/$PACKAGE/DEBIAN/postinst
echo "else" >> $DIRNAME/$PACKAGE/DEBIAN/postinst
echo " ln -sf /Applications/XBMC.frappliance /Applications/AppleTV.app/Appliances/XBMC.frappliance" >> $DIRNAME/$PACKAGE/DEBIAN/postinst
echo " killall AppleTV" >> $DIRNAME/$PACKAGE/DEBIAN/postinst
echo "fi" >> $DIRNAME/$PACKAGE/DEBIAN/postinst
chmod +x $DIRNAME/$PACKAGE/DEBIAN/postinst

# prep XBMC.frappliance
mkdir -p $PACKAGE/Applications
cp -r $XBMC $PACKAGE/Applications/
find $PACKAGE/Applications/ -name '.svn' -exec rm -rf {} \;
find $PACKAGE/Applications/ -name '.gitignore' -exec rm -rf {} \;
find $PACKAGE/Applications/ -name '.DS_Store' -exec rm -rf {} \;
mkdir -p $DIRNAME/$PACKAGE/Applications
cp -r $XBMC $DIRNAME/$PACKAGE/Applications/
find $DIRNAME/$PACKAGE/Applications/ -name '.svn' -exec rm -rf {} \;
find $DIRNAME/$PACKAGE/Applications/ -name '.gitignore' -exec rm -rf {} \;
find $DIRNAME/$PACKAGE/Applications/ -name '.DS_Store' -exec rm -rf {} \;

# set ownership to root:root
${SUDO} chown -R 0:0 $PACKAGE
${SUDO} chown -R 0:0 $DIRNAME/$PACKAGE

echo Packaging $PACKAGE
# Tell tar, pax, etc. on Mac OS X 10.4+ not to archive
Expand All @@ -89,9 +91,9 @@ echo Packaging $PACKAGE
export COPYFILE_DISABLE=true
export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
#
dpkg-deb -b $PACKAGE $ARCHIVE
dpkg-deb --info $ARCHIVE
dpkg-deb --contents $ARCHIVE
dpkg-deb -b $DIRNAME/$PACKAGE $DIRNAME/$ARCHIVE
dpkg-deb --info $DIRNAME/$ARCHIVE
dpkg-deb --contents $DIRNAME/$ARCHIVE

# clean up by removing package dir
${SUDO} rm -rf $PACKAGE
${SUDO} rm -rf $DIRNAME/$PACKAGE
71 changes: 36 additions & 35 deletions tools/osx/packaging/xbmc-ios/mkdeb-xbmc-ios.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/sh

# usage: ./mkdeb-xbmc-ios.sh release/debug (case insensitive)

Allows us to run mkdeb-xbmc-ios.sh from anywhere in the three, rather than the tools/osx/packaging/xbmc-ios folder only
SWITCH=`echo $1 | tr [A-Z] [a-z]`
DIRNAME=`dirname $0`

if [ $SWITCH = "debug" ]; then
if [ ${SWITCH:-""} = "debug" ]; then
echo "Packaging Debug target for iOS"
XBMC="../../../../build/Debug-iphoneos/XBMC.app"
elif [ $SWITCH = "release" ]; then
XBMC="$DIRNAME/../../../../build/Debug-iphoneos/XBMC.app"
elif [ ${SWITCH:-""} = "release" ]; then
echo "Packaging Release target for iOS"
XBMC="../../../../build/Release-iphoneos/XBMC.app"
XBMC="$DIRNAME/../../../../build/Release-iphoneos/XBMC.app"
else
echo "You need to specify the build target"
exit 1
Expand All @@ -35,42 +36,42 @@ REVISION=7
ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_iphoneos-arm.deb

echo Creating $PACKAGE package version $VERSION revision $REVISION
${SUDO} rm -rf $PACKAGE
${SUDO} rm -rf $ARCHIVE
${SUDO} rm -rf $DIRNAME/$PACKAGE
${SUDO} rm -rf $DIRNAME/$ARCHIVE

# create debian control file.
mkdir -p $PACKAGE/DEBIAN
echo "Package: $PACKAGE" > $PACKAGE/DEBIAN/control
echo "Priority: Extra" >> $PACKAGE/DEBIAN/control
echo "Name: XBMC-iOS" >> $PACKAGE/DEBIAN/control
echo "Depends: firmware (>= 4.1), curl, org.xbmc.xbmc-iconpack" >> $PACKAGE/DEBIAN/control
echo "Version: $VERSION-$REVISION" >> $PACKAGE/DEBIAN/control
echo "Architecture: iphoneos-arm" >> $PACKAGE/DEBIAN/control
echo "Description: XBMC Multimedia Center for 4.x iOS" >> $PACKAGE/DEBIAN/control
echo "Homepage: http://xbmc.org/" >> $PACKAGE/DEBIAN/control
echo "Maintainer: Scott Davilla, Edgar Hucek" >> $PACKAGE/DEBIAN/control
echo "Author: TeamXBMC" >> $PACKAGE/DEBIAN/control
echo "Section: Multimedia" >> $PACKAGE/DEBIAN/control
echo "Icon: file:///Applications/Cydia.app/Sources/mirrors.xbmc.org.png" >> $PACKAGE/DEBIAN/control
mkdir -p $DIRNAME/$PACKAGE/DEBIAN
echo "Package: $PACKAGE" > $DIRNAME/$PACKAGE/DEBIAN/control
echo "Priority: Extra" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Name: XBMC-iOS" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Depends: firmware (>= 4.1), curl, org.xbmc.xbmc-iconpack" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Version: $VERSION-$REVISION" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Architecture: iphoneos-arm" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Description: XBMC Multimedia Center for 4.x iOS" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Homepage: http://xbmc.org/" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Maintainer: Scott Davilla, Edgar Hucek" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Author: TeamXBMC" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Section: Multimedia" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Icon: file:///Applications/Cydia.app/Sources/mirrors.xbmc.org.png" >> $DIRNAME/$PACKAGE/DEBIAN/control

# prerm: called on remove and upgrade - get rid of existing bits.
echo "#!/bin/sh" > $PACKAGE/DEBIAN/prerm
echo "rm -rf /Applications/XBMC.app" >> $PACKAGE/DEBIAN/prerm
chmod +x $PACKAGE/DEBIAN/prerm
echo "#!/bin/sh" > $DIRNAME/$PACKAGE/DEBIAN/prerm
echo "rm -rf /Applications/XBMC.app" >> $DIRNAME/$PACKAGE/DEBIAN/prerm
chmod +x $DIRNAME/$PACKAGE/DEBIAN/prerm

# postinst: nothing for now.
echo "#!/bin/sh" > $PACKAGE/DEBIAN/postinst
chmod +x $PACKAGE/DEBIAN/postinst
echo "#!/bin/sh" > $DIRNAME/$PACKAGE/DEBIAN/postinst
chmod +x $DIRNAME/$PACKAGE/DEBIAN/postinst

# prep XBMC.app
mkdir -p $PACKAGE/Applications
cp -r $XBMC $PACKAGE/Applications/
find $PACKAGE/Applications/ -name '.svn' -exec rm -rf {} \;
find $PACKAGE/Applications/ -name '.gitignore' -exec rm -rf {} \;
find $PACKAGE/Applications/ -name '.DS_Store' -exec rm -rf {} \;
mkdir -p $DIRNAME/$PACKAGE/Applications
cp -r $XBMC $DIRNAME/$PACKAGE/Applications/
find $DIRNAME/$PACKAGE/Applications/ -name '.svn' -exec rm -rf {} \;
find $DIRNAME/$PACKAGE/Applications/ -name '.gitignore' -exec rm -rf {} \;
find $DIRNAME/$PACKAGE/Applications/ -name '.DS_Store' -exec rm -rf {} \;

# set ownership to root:root
${SUDO} chown -R 0:0 $PACKAGE
${SUDO} chown -R 0:0 $DIRNAME/$PACKAGE

echo Packaging $PACKAGE
# Tell tar, pax, etc. on Mac OS X 10.4+ not to archive
Expand All @@ -79,9 +80,9 @@ echo Packaging $PACKAGE
export COPYFILE_DISABLE=true
export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
#
dpkg-deb -b $PACKAGE $ARCHIVE
dpkg-deb --info $ARCHIVE
dpkg-deb --contents $ARCHIVE
dpkg-deb -b $DIRNAME/$PACKAGE $DIRNAME/$ARCHIVE
dpkg-deb --info $DIRNAME/$ARCHIVE
dpkg-deb --contents $DIRNAME/$ARCHIVE

# clean up by removing package dir
${SUDO} rm -rf $PACKAGE
${SUDO} rm -rf $DIRNAME/$PACKAGE

0 comments on commit 251ed82

Please sign in to comment.