Difference between revisions of "KTp/Getting Set Up/Scripted"

Jump to: navigation, search
Line 28: Line 28:
 
FILE=""
 
FILE=""
 
DIR="."
 
DIR="."
 +
cpus=$(ls -d /sys/devices/system/cpu/cpu? | wc -l)
 
# init
 
# init
 
# look for empty dir
 
# look for empty dir
 +
 +
function build {
 +
 +
## Add/Remove custom CMake options over here
 +
customcmakeopts="-DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` \
 +
                -DCMAKE_BUILD_TYPE=debugfull"
 +
if [ -f /usr/bin/neonmake ]; then
 +
    neonmake
 +
else
 +
    makej=$(($cpus + 1))
 +
    mkdir -p build
 +
    cd build
 +
    cmake $customcmakeopts ..
 +
    make --jobs=$makej
 +
    cd ..
 +
fi
 +
 +
}
 +
 
if [ -n "$(ls -A $DIR)" ]; then
 
if [ -n "$(ls -A $DIR)" ]; then
 
     echo "Updating telepathy repos, since $DIR is not Empty"
 
     echo "Updating telepathy repos, since $DIR is not Empty"
 
     for folder in $(ls -p | grep \/); do
 
     for folder in $(ls -p | grep \/); do
 
         cd $folder
 
         cd $folder
         echo "Updating folder $folder"  
+
         echo "####################################################"
 +
        echo "              Updating folder $folder             "
 +
        echo "####################################################"
 
         git pull
 
         git pull
 
         if [ "$1" = "-b" ]; then
 
         if [ "$1" = "-b" ]; then
             ## Add custom build commands here, leave as such for Project Neon
+
             echo "####################################################"
             neonmake
+
            echo "              Building folder $folder              "
 +
            echo "####################################################"
 +
             build
 
         fi
 
         fi
 
         cd ..  
 
         cd ..  
Line 64: Line 88:
 
       for folder in $(ls -p | grep \/); do
 
       for folder in $(ls -p | grep \/); do
 
             cd $folder
 
             cd $folder
               echo "Building folder $folder"  
+
               echo "####################################################"
               ## Add custom build commands here, leave as such for Project Neon
+
              echo "              Building folder $folder               "  
               neonmake
+
               echo "####################################################"
 +
               build
 
               cd ..  
 
               cd ..  
 
       done
 
       done

Revision as of 18:23, 19 August 2011

Here is a script to help you a major part of Telepathy KDE, feel free to modify it according to your needs.

#!/bin/bash
#
# Build script for telepathy-kde, assumes you have the latest telepathy-qt4, 
# have a proper gitconfig setup for and that you use Project Neon
#
# Instructions on how to use the script :
#      -b : Also build the cloned repos
#
# Copyright (C) 2011 Rohan Garg <[email protected]>
#
# 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 3 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, see <http://www.gnu.org/licenses/>.
#
###############################################################################
FILE=""
DIR="."
cpus=$(ls -d /sys/devices/system/cpu/cpu? | wc -l)
# init
# look for empty dir

function build {

## Add/Remove custom CMake options over here
customcmakeopts="-DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` \
                 -DCMAKE_BUILD_TYPE=debugfull"
if [ -f /usr/bin/neonmake ]; then
    neonmake
else
    makej=$(($cpus + 1))
    mkdir -p build
    cd build
    cmake $customcmakeopts ..
    make --jobs=$makej
    cd ..
fi

}

if [ -n "$(ls -A $DIR)" ]; then
    echo "Updating telepathy repos, since $DIR is not Empty"
    for folder in $(ls -p | grep \/); do
        cd $folder
        echo "####################################################"
        echo "               Updating folder $folder              " 
        echo "####################################################"
        git pull
        if [ "$1" = "-b" ]; then
            echo "####################################################"
            echo "              Building folder $folder               "
            echo "####################################################"
            build
        fi
        cd .. 
    done
else
    echo "$DIR is Empty, clone them repos!!!"
    # Uncomment the next line to build telepathy-qt4 from sources as well
    # git://anongit.freedesktop.org/telepathy/telepathy-qt4
    git clone git://oscaf.git.sourceforge.net/gitroot/oscaf/shared-desktop-ontologies
    git clone kde:kwhiteboard
    git clone kde:telepathy-accounts-kcm
    git clone kde:telepathy-approver
    git clone kde:telepathy-call-ui
    git clone kde:telepathy-chat-handler
    git clone kde:telepathy-contact-list
    git clone kde:telepathy-kde
    git clone kde:telepathy-nepomuk-service
    git clone kde:telepathy-presence-applet
    git clone kde:telepathy-presence-dataengine  
    git clone kde:telepathy-testlib
    git clone kde:telepathy-test-tool
    git clone kde:telepathy-filetransfer-handler
    git clone kde:telepathy-send-file
    if [ "$1" = "-b" ]; then
      for folder in $(ls -p | grep \/); do
            cd $folder
              echo "####################################################"
              echo "              Building folder $folder               " 
              echo "####################################################"
              build
              cd .. 
      done
    fi
fi

Content is available under Creative Commons License SA 4.0 unless otherwise noted.