##########␊ |
# Gisto - Gitso is to support others␊ |
# ␊ |
# Copyright 2008, 2009: Aaron Gerber, Derek Buranen␊ |
# Copyright 2008 - 2010: Aaron Gerber, Derek Buranen␊ |
#␊ |
# Gitso is free software: you can redistribute it and/or modify␊ |
# it under the terms of the GNU General Public License as published by␊ |
|
##########␊ |
␊ |
␊ |
DMG_OSX_106="Gitso_0.6_SnowLeopard.dmg"␊ |
DMG_OSX_105="Gitso_0.6_Leopard.dmg"␊ |
DEB="gitso_0.6_all.deb"␊ |
TARGZ="gitso_0.6_all.tar.gz"␊ |
SRC="gitso_0.6_src.tar.bz2"␊ |
RPM="gitso-0.6-1.i586.rpm"␊ |
RPMOUT="gitso_0.6-1_opensuse.i586.rpm"␊ |
##␊ |
# Helper methods␊ |
############################␊ |
␊ |
␊ |
#␊ |
# Creates the source package, works on all UNIX/LINUX based platforms␊ |
#␊ |
function mksrc {␊ |
␉␉P=`pwd`␊ |
␉␉TMP_PKG="../pkg"␊ |
␊ |
␉␉# Clean up first.␊ |
␉␉find . -name "*~" -exec rm {} ';'␊ |
␉␉rm -rf $OSX_BUILD_DIR␊ |
␉␉rm -rf $RPM_BUILD_DIR␊ |
␉␉rm -rf $DEB_BUILD_DIR␊ |
␉␉rm -rf $DEB_TARGZ_PATH␊ |
␉␉rm -rf $P/*.bz2␊ |
␉␉rm -rf $P/*.tar␊ |
␉␉rm -rf $P/*.gz␊ |
␉␉rm -rf $P/*.app␊ |
␉␉rm -rf $P/*.dmg␊ |
␉␉rm -rf $P/*.exe␊ |
␉␉rm -rf $TMP_PKG␊ |
␊ |
␉␉# Create the SRC file␊ |
␉␉mkdir -p $TMP_PKG/trunk/␊ |
␉␉cp -r ./ $TMP_PKG/trunk/␊ |
␉␉find $TMP_PKG/trunk -name ".svn" -exec rm -rf {} 2>&1 > /dev/null ';' 2>&1 > /dev/null␊ |
|
␉␉rm -rf $TMP_PKG␊ |
}␊ |
␊ |
␊ |
#␊ |
# Create the .app folder for snow leopard, it uses a different version of pythong␊ |
# And because py2app needs to know there, we just use different config files.␊ |
#␊ |
function snowLeopardDMG {␊ |
␉echo -e "Creating Gitso.app "␊ |
␉rm -f setup.py␊ |
␉rm -rf dist␊ |
␉rm -rf $OSX_BUILD_DIR␊ |
␉␊ |
␉#echo -e ".."␊ |
␉#py2applet --make-setup Gitso.py␊ |
|
␉#rm setup.py␊ |
␉␊ |
␉echo -e ".."␊ |
␉cp arch/osx/Info_OSX-10.6.plist dist/Gitso.app/Contents/␊ |
␉cp arch/osx/Info_OSX-10.6.plist $OSX_BUILD_DIR/Gitso.app/Contents/␊ |
␉␊ |
␉cp COPYING dist/Gitso.app/Contents/Resources/␊ |
␉cp PythonApplet.icns dist/Gitso.app/Contents/Resources/␊ |
␉cp COPYING $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉cp PythonApplet.icns $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉␊ |
␉tar xvfz arch/osx/OSXvnc.tar.gz␊ |
␉mv OSXvnc dist/Gitso.app/Contents/Resources/␊ |
␉mv OSXvnc $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␊ |
␉tar xvfz arch/osx/cotvnc.app.tar.gz␊ |
␉mv cotvnc.app dist/Gitso.app/Contents/Resources/␊ |
␉␊ |
␉cp icon.ico dist/Gitso.app/Contents/Resources/␊ |
␉cp icon.png dist/Gitso.app/Contents/Resources/␊ |
␉cp __init__.py dist/Gitso.app/Contents/Resources/␊ |
␉cp ArgsParser.py dist/Gitso.app/Contents/Resources/␊ |
␉cp Processes.py dist/Gitso.app/Contents/Resources/␊ |
␉cp ConnectionWindow.py dist/Gitso.app/Contents/Resources/␊ |
␉cp AboutWindow.py dist/Gitso.app/Contents/Resources/␊ |
␉cp GitsoThread.py dist/Gitso.app/Contents/Resources/␊ |
␉␊ |
␉cp arch/osx/libjpeg-copyright.txt dist/Gitso.app/Contents/Frameworks/␊ |
␉cp arch/osx/osxnvc_echoware-copyright.txt dist/Gitso.app/Contents/Resources/OSXvnc/␊ |
␉cp arch/osx/cotvnc-copyright.txt dist/Gitso.app/Contents/Resources/cotvnc.app/contents/Resources␊ |
␉cp arch/osx/osxvnc-copyright.txt dist/Gitso.app/Contents/Resources/OSXvnc/␊ |
␉mv cotvnc.app $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉␊ |
␉cp icon.ico $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉cp icon.png $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉cp __init__.py $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉cp ArgsParser.py $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉cp Processes.py $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉cp ConnectionWindow.py $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉cp AboutWindow.py $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉cp GitsoThread.py $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉␊ |
␉cp arch/osx/libjpeg-copyright.txt $OSX_BUILD_DIR/Gitso.app/Contents/Frameworks/␊ |
␉cp arch/osx/osxnvc_echoware-copyright.txt $OSX_BUILD_DIR/Gitso.app/Contents/Resources/OSXvnc/␊ |
␉cp arch/osx/cotvnc-copyright.txt $OSX_BUILD_DIR/Gitso.app/Contents/Resources/cotvnc.app/contents/Resources␊ |
␉cp arch/osx/osxvnc-copyright.txt $OSX_BUILD_DIR/Gitso.app/Contents/Resources/OSXvnc/␊ |
␉␊ |
␉echo -e " [done]\n"␊ |
␉␊ |
␉echo -e "Creating $DMG_OSX_106"␊ |
␉rm -f $DMG_OSX_106␊ |
␉␊ |
␉mkdir dist/Gitso␊ |
␉cp arch/osx/dmg_DS_Store dist/Gitso/.DS_Store␊ |
␉ln -s /Applications/ dist/Gitso/Applications␊ |
␉mkdir $OSX_BUILD_DIR/Gitso␊ |
␉cp arch/osx/dmg_DS_Store $OSX_BUILD_DIR/Gitso/.DS_Store␊ |
␉ln -s /Applications/ $OSX_BUILD_DIR/Gitso/Applications␊ |
␉␊ |
␉mv "dist/Gitso.app" "dist/Gitso/"␊ |
␉cp -r arch/osx/Readme.rtfd dist/Gitso/Readme.rtfd␊ |
␉mv "$OSX_BUILD_DIR/Gitso.app" "$OSX_BUILD_DIR/Gitso/"␊ |
␉cp -r arch/osx/Readme.rtfd $OSX_BUILD_DIR/Gitso/Readme.rtfd␊ |
␉␊ |
␉echo -e "..."␊ |
␉hdiutil create -srcfolder dist/Gitso/ $DMG_OSX_106␊ |
␉hdiutil create -srcfolder $OSX_BUILD_DIR/Gitso/ $DMG_OSX_106␊ |
␉echo -e "... [done]\n"␊ |
}␊ |
␊ |
␊ |
#␊ |
# Create the .app folder for Leopard, it uses a different version of pythong␊ |
# And because py2app needs to know there, we just use different config files.␊ |
#␊ |
function LeopardDMG {␊ |
␉echo -e "Creating Gitso.app "␊ |
␉rm -f setup.py␊ |
␉rm -rf dist␊ |
␉rm -rf $OSX_BUILD_DIR␊ |
␉␊ |
␉echo -e ".."␊ |
␉␊ |
␉python arch/osx/setup.py py2app␊ |
␉␊ |
␉echo -e ".."␊ |
␉cp arch/osx/Info_OSX-10.5.plist dist/Gitso.app/Contents/␊ |
␉cp arch/osx/Info_OSX-10.5.plist $OSX_BUILD_DIR/Gitso.app/Contents/␊ |
␉␊ |
␉cp COPYING dist/Gitso.app/Contents/Resources/␊ |
␉cp PythonApplet.icns dist/Gitso.app/Contents/Resources/␊ |
␉cp COPYING $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉cp PythonApplet.icns $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉␊ |
␉tar xvfz arch/osx/OSXvnc.tar.gz␊ |
␉mv OSXvnc dist/Gitso.app/Contents/Resources/␊ |
␉mv OSXvnc $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␊ |
␉tar xvfz arch/osx/cotvnc.app.tar.gz␊ |
␉mv cotvnc.app dist/Gitso.app/Contents/Resources/␊ |
␉␊ |
␉cp icon.ico dist/Gitso.app/Contents/Resources/␊ |
␉cp icon.png dist/Gitso.app/Contents/Resources/␊ |
␉cp __init__.py dist/Gitso.app/Contents/Resources/␊ |
␉cp ArgsParser.py dist/Gitso.app/Contents/Resources/␊ |
␉cp Processes.py dist/Gitso.app/Contents/Resources/␊ |
␉cp ConnectionWindow.py dist/Gitso.app/Contents/Resources/␊ |
␉cp AboutWindow.py dist/Gitso.app/Contents/Resources/␊ |
␉cp GitsoThread.py dist/Gitso.app/Contents/Resources/␊ |
␉␊ |
␉cp arch/osx/libjpeg-copyright.txt dist/Gitso.app/Contents/Frameworks/␊ |
␉cp arch/osx/osxnvc_echoware-copyright.txt dist/Gitso.app/Contents/Resources/OSXvnc/␊ |
␉cp arch/osx/cotvnc-copyright.txt dist/Gitso.app/Contents/Resources/cotvnc.app/contents/Resources␊ |
␉cp arch/osx/osxvnc-copyright.txt dist/Gitso.app/Contents/Resources/OSXvnc/␊ |
␉mv cotvnc.app $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉␊ |
␉cp icon.ico $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉cp icon.png $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉cp __init__.py $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉cp ArgsParser.py $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉cp Processes.py $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉cp ConnectionWindow.py $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉cp AboutWindow.py $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉cp GitsoThread.py $OSX_BUILD_DIR/Gitso.app/Contents/Resources/␊ |
␉␊ |
␉cp arch/osx/libjpeg-copyright.txt $OSX_BUILD_DIR/Gitso.app/Contents/Frameworks/␊ |
␉cp arch/osx/osxnvc_echoware-copyright.txt $OSX_BUILD_DIR/Gitso.app/Contents/Resources/OSXvnc/␊ |
␉cp arch/osx/cotvnc-copyright.txt $OSX_BUILD_DIR/Gitso.app/Contents/Resources/cotvnc.app/contents/Resources␊ |
␉cp arch/osx/osxvnc-copyright.txt $OSX_BUILD_DIR/Gitso.app/Contents/Resources/OSXvnc/␊ |
␉␊ |
␉echo -e " [done]\n"␊ |
␉␊ |
␉echo -e "Creating $DMG_OSX_105"␊ |
␉rm -f $DMG_OSX_105␊ |
␉␊ |
␉mkdir dist/Gitso␊ |
␉cp arch/osx/dmg_DS_Store dist/Gitso/.DS_Store␊ |
␉ln -s /Applications/ dist/Gitso/Applications␊ |
␉mkdir $OSX_BUILD_DIR/Gitso␊ |
␉cp arch/osx/dmg_DS_Store $OSX_BUILD_DIR/Gitso/.DS_Store␊ |
␉ln -s /Applications/ $OSX_BUILD_DIR/Gitso/Applications␊ |
␉␊ |
␉mv "dist/Gitso.app" "dist/Gitso/"␊ |
␉cp -r arch/osx/Readme.rtfd dist/Gitso/Readme.rtfd␊ |
␉mv "$OSX_BUILD_DIR/Gitso.app" "$OSX_BUILD_DIR/Gitso/"␊ |
␉cp -r arch/osx/Readme.rtfd $OSX_BUILD_DIR/Gitso/Readme.rtfd␊ |
␉␊ |
␉echo -e "..."␊ |
␉hdiutil create -srcfolder dist/Gitso/ $DMG_OSX_105␊ |
␉hdiutil create -srcfolder $OSX_BUILD_DIR/Gitso/ $DMG_OSX_105␊ |
␉echo -e "... [done]\n"␊ |
}␊ |
␊ |
␊ |
CLEAN="yes"␊ |
RPMNAME="opensuse"␊ |
echo -n "Starting makegitso:"␊ |
␊ |
if [ "$1" = "" ]; then␊ |
␉echo -n ".."␊ |
elif test "$1" = "--no-clean"; then␊ |
␉CLEAN="no"␊ |
elif test "$1" = "--fedora"; then␊ |
␉RPMNAME="fedora"␊ |
␉RPMOUT="gitso_0.6-1_fedora.i386.rpm"␊ |
elif test "$1" = "--opensuse"; then␊ |
␉RPMNAME="opensuse"␊ |
else␊ |
␉echo -e "Usage makegitso.sh: [ --no-clean | --fedora | --opensuse | --help ]"␊ |
␉echo -e "\tOptions:"␊ |
#␊ |
# Displays the help menu␊ |
#␊ |
function helpMenu {␊ |
␉echo -e "Usage makegitso.sh: [ BUILD OPTIONS ] [ OPTIONS ]"␊ |
␉echo -e "\tBUILD OPTIONS"␊ |
␉echo -e "\t--fedora\tMake package for Fedora. (only avaible on Fedora)"␊ |
␉echo -e "\t--opensuse\tMake package for OpenSUSE. (only avaible on OpenSUSE)"␊ |
␉echo -e "\t--source\tMake the source package. (All UNIX/Linux systems)\n"␊ |
␉echo -e "\tOPTIONS:"␊ |
␉echo -e "\t--no-clean\tDo not remove the build directory."␊ |
␉echo -e "\t--fedora\tMake Build for Fedora."␊ |
␉echo -e "\t--opensuse\tMake Build for OpenSUSE."␊ |
␉echo -e "\t--help \tThese options."␊ |
␉exit 0␊ |
fi␊ |
␊ |
if [ "$2" = "" ]; then␊ |
␉echo ".."␊ |
elif test "$2" = "--no-clean"; then␊ |
␉CLEAN="no"␊ |
␉echo ".."␊ |
elif test "$2" = "--fedora"; then␊ |
␉RPMNAME="fedora"␊ |
␉RPMOUT="gitso_0.6-1_fedora.i386.rpm"␊ |
␉echo ".."␊ |
elif test "$2" = "--opensuse"; then␊ |
␉RPMNAME="opensuse"␊ |
␉echo ".."␊ |
else␊ |
␉echo -e "Usage makegitso.sh: [ --no-clean | --fedora | --opensuse | --help ]"␊ |
␉echo -e "\tOptions:"␊ |
␉echo -e "\t--no-clean\tDo not remove the build directory."␊ |
␉echo -e "\t--help \tThese options."␊ |
␉exit 0␊ |
}␊ |
␊ |
␊ |
##␊ |
# Initialize values␊ |
############################␊ |
DMG_OSX_106="Gitso_0.6_SnowLeopard.dmg"␊ |
DMG_OSX_105="Gitso_0.6_Leopard.dmg"␊ |
DEB="gitso_0.6_all.deb"␊ |
TARGZ="gitso_0.6_all.tar.gz"␊ |
SRC="gitso_0.6_src.tar.bz2"␊ |
RPM="gitso-0.6-1.i586.rpm"␊ |
RPMOUT="gitso_0.6-1_opensuse.i586.rpm"␊ |
␊ |
OSX_BUILD_DIR=`pwd`"/dist"␊ |
RPM_BUILD_DIR=`pwd`"/build"␊ |
DEB_BUILD_DIR="gitso"␊ |
DEB_TARGZ_PATH="Gitso"␊ |
␊ |
CLEAN="yes"␊ |
RPMNAME="opensuse"␊ |
USESRC="no"␊ |
␊ |
␊ |
##␊ |
# Get Comman line arguments␊ |
############################␊ |
if test "$1" = ""; then␊ |
␉helpMenu␊ |
fi␊ |
␊ |
if [ "`uname -a | grep Darwin`" != "" ]; then␊ |
for param in "$@"␊ |
do␊ |
if test "${param}" = "--no-clean"; then␊ |
␉␉CLEAN="no"␊ |
␉elif test "${param}" = "--fedora"; then␊ |
␉␉RPMNAME="fedora"␊ |
␉␉RPMOUT="gitso_0.6-1_fedora.i386.rpm"␊ |
␉elif test "${param}" = "--opensuse"; then␊ |
␉␉RPMNAME="opensuse"␊ |
␉elif test "${param}" = "--opensuse"; then␊ |
␉␉RPMNAME="opensuse"␊ |
␉elif test "${param}" = "--source"; then␊ |
␉␉USESRC="yes"␊ |
␉else␊ |
␉␉helpMenu␊ |
␉fi␊ |
done␊ |
␊ |
␊ |
##␊ |
# Create packages!␊ |
########################␊ |
if [ "$USESRC" = "yes" ]; then␊ |
␉# Creating the source␊ |
␉echo -n "Creating gitso $SRC...."␊ |
␉mksrc␊ |
␉echo -e " [done]\n"␊ |
␊ |
elif [ "`uname -a | grep Darwin`" != "" ]; then␊ |
␉#We're on OS X␊ |
␉␊ |
␉if test `which py2applet`; then␊ |
␉␉# To Make cotvnc␊ |
␉␉# cvs -z3 -d:pserver:anonymous@cotvnc.cvs.sourceforge.net:/cvsroot/cotvnc co -P cotvnc␊ |
|
␉fi␊ |
␉␊ |
elif test "`uname -a 2>&1 | grep Linux | grep -v which`"; then␊ |
␉if test "`which dpkg 2>&1 | grep -v which`"; then␊ |
␉BUILDPATH="gitso"␊ |
␉TARGZPATH="Gitso"␊ |
␉echo -n "Creating $DEB"␊ |
␉rm -rf $BUILDPATH␊ |
␊ |
␉# Deb version of Gitso.␊ |
␉mkdir -p $BUILDPATH/DEBIAN␊ |
␉mkdir -p $BUILDPATH/usr/bin␊ |
␉mkdir -p $BUILDPATH/usr/share/applications␊ |
␉mkdir -p $BUILDPATH/usr/share/doc/$BUILDPATH␊ |
␉mkdir -p $BUILDPATH/usr/share/$BUILDPATH␊ |
␉mkdir -p $BUILDPATH/usr/share/man/man1␊ |
␊ |
␉echo -n ".."␊ |
␉cp arch/linux/control $BUILDPATH/DEBIAN␊ |
␉cp arch/linux/gitso $BUILDPATH/usr/bin/␊ |
␉chmod 755 $BUILDPATH/usr/bin/gitso␊ |
␉cp Gitso.py $BUILDPATH/usr/share/$BUILDPATH/␊ |
␉cp ConnectionWindow.py $BUILDPATH/usr/share/$BUILDPATH/␊ |
␉cp AboutWindow.py $BUILDPATH/usr/share/$BUILDPATH/␊ |
␉cp GitsoThread.py $BUILDPATH/usr/share/$BUILDPATH/␊ |
␉cp Processes.py $BUILDPATH/usr/share/$BUILDPATH/␊ |
␉cp ArgsParser.py $BUILDPATH/usr/share/$BUILDPATH/␊ |
␉cp __init__.py $BUILDPATH/usr/share/$BUILDPATH/␊ |
␉cp hosts.txt $BUILDPATH/usr/share/$BUILDPATH/␊ |
␉cp icon.ico $BUILDPATH/usr/share/$BUILDPATH/␊ |
␉cp icon.png $BUILDPATH/usr/share/$BUILDPATH/␊ |
␊ |
␉echo -n ".."␊ |
␉cp arch/linux/gitso.desktop $BUILDPATH/usr/share/applications/␊ |
␉cp arch/linux/README.txt $BUILDPATH/usr/share/doc/$BUILDPATH/README␊ |
␉cp COPYING $BUILDPATH/usr/share/doc/$BUILDPATH/␊ |
␉gzip -cf arch/linux/changelog > $BUILDPATH/usr/share/doc/$BUILDPATH/changelog.gz␊ |
␉gzip -cf arch/linux/gitso.1 > $BUILDPATH/usr/share/man/man1/gitso.1.gz␊ |
␊ |
␉echo -n ".."␊ |
␉dpkg -b $BUILDPATH/ $DEB 2>&1 > /dev/null␊ |
␉␊ |
␉echo -e " [done]"␊ |
␊ |
␉# Standalone version of Gitso.␊ |
␉echo -n "Creating $TARGZ"␊ |
␉rm -rf $TARGZPATH␊ |
␉␊ |
␉cp -r $BUILDPATH $TARGZPATH␊ |
␉rm -rf $TARGZPATH/DEBIAN␊ |
␊ |
␉echo -n ".."␊ |
␉cp arch/linux/README-stand-alone.txt $TARGZPATH/README␊ |
␉cp arch/linux/run-gitso.sh $TARGZPATH/␊ |
␉mv $TARGZPATH/usr/bin $TARGZPATH/bin␊ |
␉mv $TARGZPATH/usr/share $TARGZPATH/share␊ |
␉rm -rf $TARGZPATH/usr/␊ |
␉␊ |
␉echo -n "."␊ |
␉tar -cvzf $TARGZ $TARGZPATH 2>&1 > /dev/null␊ |
␉#We're on Linux␊ |
␉␊ |
␉echo -e " [done]\n"␊ |
␊ |
␉echo -n "Creating gitso $SRC...."␊ |
␉mksrc␊ |
␉echo -e " [done]\n"␊ |
␊ |
␊ |
␉if [ "$CLEAN" = "yes" ]; then␊ |
␉␉rm -rf $BUILDPATH␊ |
␉␉rm -rf $TARGZPATH␊ |
␉␉find . -name "*.pyc" -exec rm {} ';'␊ |
␉fi␊ |
␉if test "`which dpkg 2>&1 | grep -v which`"; then␊ |
␉␉# Deb version of Gitso.␊ |
␉␉echo -n "Creating $DEB"␊ |
␉␉rm -rf $DEB_BUILD_DIR␊ |
␉␊ |
␉␉mkdir -p $DEB_BUILD_DIR/DEBIAN␊ |
␉␉mkdir -p $DEB_BUILD_DIR/usr/bin␊ |
␉␉mkdir -p $DEB_BUILD_DIR/usr/share/applications␊ |
␉␉mkdir -p $DEB_BUILD_DIR/usr/share/doc/$DEB_BUILD_DIR␊ |
␉␉mkdir -p $DEB_BUILD_DIR/usr/share/$DEB_BUILD_DIR␊ |
␉␉mkdir -p $DEB_BUILD_DIR/usr/share/man/man1␊ |
␉␊ |
␉␉echo -n ".."␊ |
␉␉cp arch/linux/control $DEB_BUILD_DIR/DEBIAN␊ |
␉␉cp arch/linux/gitso $DEB_BUILD_DIR/usr/bin/␊ |
␉␉chmod 755 $DEB_BUILD_DIR/usr/bin/gitso␊ |
␉␉cp Gitso.py $DEB_BUILD_DIR/usr/share/$DEB_BUILD_DIR/␊ |
␉␉cp ConnectionWindow.py $DEB_BUILD_DIR/usr/share/$DEB_BUILD_DIR/␊ |
␉␉cp AboutWindow.py $DEB_BUILD_DIR/usr/share/$DEB_BUILD_DIR/␊ |
␉␉cp GitsoThread.py $DEB_BUILD_DIR/usr/share/$DEB_BUILD_DIR/␊ |
␉␉cp Processes.py $DEB_BUILD_DIR/usr/share/$DEB_BUILD_DIR/␊ |
␉␉cp ArgsParser.py $DEB_BUILD_DIR/usr/share/$DEB_BUILD_DIR/␊ |
␉␉cp __init__.py $DEB_BUILD_DIR/usr/share/$DEB_BUILD_DIR/␊ |
␉␉cp hosts.txt $DEB_BUILD_DIR/usr/share/$DEB_BUILD_DIR/␊ |
␉␉cp icon.ico $DEB_BUILD_DIR/usr/share/$DEB_BUILD_DIR/␊ |
␉␉cp icon.png $DEB_BUILD_DIR/usr/share/$DEB_BUILD_DIR/␊ |
␉␊ |
␉␉echo -n ".."␊ |
␉␉cp arch/linux/gitso.desktop $DEB_BUILD_DIR/usr/share/applications/␊ |
␉␉cp arch/linux/README.txt $DEB_BUILD_DIR/usr/share/doc/$DEB_BUILD_DIR/README␊ |
␉␉cp COPYING $DEB_BUILD_DIR/usr/share/doc/$DEB_BUILD_DIR/␊ |
␉␉gzip -cf arch/linux/changelog > $DEB_BUILD_DIR/usr/share/doc/$DEB_BUILD_DIR/changelog.gz␊ |
␉␉gzip -cf arch/linux/gitso.1 > $DEB_BUILD_DIR/usr/share/man/man1/gitso.1.gz␊ |
␉␊ |
␉␉echo -n ".."␊ |
␉␉dpkg -b $DEB_BUILD_DIR/ $DEB 2>&1 > /dev/null␊ |
␉␉␊ |
␉␉echo -e " [done]"␊ |
␉␊ |
␉␉# Standalone version of Gitso.␊ |
␉␉echo -n "Creating $TARGZ"␊ |
␉␉rm -rf $DEB_TARGZ_PATH␊ |
␉␉␊ |
␉␉cp -r $DEB_BUILD_DIR $DEB_TARGZ_PATH␊ |
␉␉rm -rf $DEB_TARGZ_PATH/DEBIAN␊ |
␉␊ |
␉␉echo -n ".."␊ |
␉␉cp arch/linux/README-stand-alone.txt $DEB_TARGZ_PATH/README␊ |
␉␉cp arch/linux/run-gitso.sh $DEB_TARGZ_PATH/␊ |
␉␉mv $DEB_TARGZ_PATH/usr/bin $DEB_TARGZ_PATH/bin␊ |
␉␉mv $DEB_TARGZ_PATH/usr/share $DEB_TARGZ_PATH/share␊ |
␉␉rm -rf $DEB_TARGZ_PATH/usr/␊ |
␉␉␊ |
␉␉echo -n "."␊ |
␉␉tar -cvzf $TARGZ $DEB_TARGZ_PATH 2>&1 > /dev/null␊ |
␉␉␊ |
␉␉echo -e " [done]\n"␊ |
␉␉␊ |
␉elif test "`which rpm 2>&1 | grep -v which`"; then␊ |
␉␉# RPM version of Gitso␊ |
␉␉if [ "$RPMNAME" = "fedora" ]; then␊ |
␉␉␉SPEC="gitso_rpm_fedora.spec"␊ |
␉␉␉# Before installing the .rpm␊ |
|
␉␉else␊ |
␉␉␉SPEC="gitso_rpm.spec"␊ |
␉␉fi␊ |
␉␉# RPM version of Gitso␊ |
␉␉echo "Creating $RPM"␊ |
␉␉BUILD_DIR=`pwd`␊ |
␉␉export BUILD_DIR="$BUILD_DIR/build"␊ |
␉␉TMP="$BUILD_DIR/rpm/tmp"␊ |
␉␉BUILD_ROOT="$BUILD_DIR/rpm/tmp/gitso-root"␊ |
␊ |
␉␉mkdir -p $BUILD_DIR/rpm/{BUILD,RPMS/$ARCH,RPMS/noarch,SOURCES,SRPMS,SPECS,tmp}␊ |
␉␉mkdir -p $BUILD_ROOT␊ |
␉␉echo "Creating $RPM"␊ |
␉␉export RPM_BUILD_DIR=$RPM_BUILD_DIR␊ |
␉␉TMP="$RPM_BUILD_DIR/rpm/tmp"␊ |
␉␉BUILD_ROOT="$RPM_BUILD_DIR/rpm/tmp/gitso-root"␊ |
␊ |
␉␉# We need this because the rpmbuild below needs to the source ball.␊ |
␉␉# Also realize that mksrc is going to clean-up, so if you creat dist files before this line␊ |
␉␉# They will be deleted.␊ |
␉␉mksrc␊ |
␉␉␊ |
␉␉mkdir -p $RPM_BUILD_DIR/rpm/{BUILD,RPMS/$ARCH,RPMS/noarch,SOURCES,SRPMS,SPECS,tmp}␊ |
␉␉mkdir -p $BUILD_ROOT␊ |
␊ |
␉␉cp $SRC $BUILD_DIR/rpm/SOURCES/$SRC␊ |
␉␉cp $SRC $RPM_BUILD_DIR/rpm/SOURCES/$SRC␊ |
␊ |
␉␉cp arch/linux/$SPEC $TMP␊ |
␉ perl -e 's/%\(echo \$HOME\)/$ENV{'BUILD_DIR'}/g;' -pi $TMP/$SPEC␊ |
␉␉perl -e 's/%\(echo \$HOME\)/$ENV{'RPM_BUILD_DIR'}/g;' -pi $TMP/$SPEC␊ |
␊ |
␉␉rpmbuild -ba $TMP/$SPEC␊ |
␉␉find $BUILD_DIR/rpm/RPMS -name "*.rpm" -exec cp {} $RPMOUT ';'␊ |
␉␉find $RPM_BUILD_DIR/rpm/RPMS -name "*.rpm" -exec cp {} $RPMOUT ';'␊ |
␊ |
␉␉echo -e " [done]\n"␊ |
␉␉if [ "$CLEAN" = "yes" ]; then␊ |
␉␉␉rm -rf $BUILD_DIR␊ |
␉␉␉find . -name "*.pyc" -exec rm {} ';'␊ |
␉␉fi␊ |
␉␊ |
␉fi␊ |
␊ |
fi␊ |
␊ |
# Clean up␊ |
if [ "$CLEAN" = "yes" ]; then␊ |
␉echo -e "Cleaning up...."␊ |
␉rm -rf $RPM_BUILD_DIR␊ |
␉rm -rf $DEB_BUILD_DIR␊ |
␉rm -rf $DEB_TARGZ_PATH␊ |
␉find . -name "*.pyc" -exec rm {} ';'␊ |
␉echo -e " [done]\n"␊ |
fi␊ |
␊ |