Changeset 18 for caixamagica


Ignore:
Timestamp:
Jul 26, 2007, 5:45:54 PM (13 years ago)
Author:
fasma
Message:

Updated the script svn2rpm.sh an added the config file tarball_names

Location:
caixamagica/scripts/cmbuild
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • caixamagica/scripts/cmbuild/config/svn_fonts

    r1 r18  
    77
    88drakx-net->drakx-net
    9 drakconf->control-center
     9mandriva-theme->theme/mandriva-theme
  • caixamagica/scripts/cmbuild/config/tarball_files

    r1 r18  
    22#
    33# First we say the package to be built,
    4 # then the origin of the file, and then the destination.
     4# then the origin of the file, and then the destination directory.
     5# If the file has to be renamed then add a thirs argument wich is
     6# the new name of the file
    57#
    68# The origin root is the SVN directory.
    79#
    8 # The destination root is the SVN/tmp/package-version directory.
     10# The destination directory root is the SVN/tmp/package-version directory.
    911#
    1012# Each package can have multiple lines, so that files
     
    1315# Wild Cards can be used.
    1416#
    15 # If the destination is a directory, ALWAYS end it with a slash (/)
     17# The string "_VERSION_" will be changed to the version of the package
     18#
     19# The destination directory, must ALWAYS end with a slash (/)
    1620#
    1721# If the destination is ommited, the file(s) will be coppied to the
     
    2125# packageXPTO->Origin1/* Destination1/
    2226# drakx-net->drakx-net/* ./
    23 # drakx-net->drakxtools/dir1/asda.pm dir2/
     27# drakx-net->drakxtools/dir1/asda.pm dir2/ asda.pm1
    2428
    25 drakx-net->drakx-net/*
    26 drakconf->control-center/*
     29drakx-net->drakx-net/* drakx-net-_VERSION_/
     30mandriva-theme->theme/mandriva-theme/common/bootsplash/config/animations.cfg mandriva-theme-_VERSION_/common/bootsplash/config/
  • caixamagica/scripts/cmbuild/svn2rpm.sh

    r1 r18  
    1616#             config/tarball_files -> Indicates for each package, the files needed to be
    1717#                              added to the tarball.
     18#             config/tarball_names -> Indicates for each package the name and type/extension
     19#                              of the tarball to be made, and also where is the file that indicates
     20#                              the version of the package.
    1821#         
    1922#
     
    2326#DIR="/caixamagica/Dist12/install/cmbuild"
    2427
    25 FTP_REPO="isildur.adetti.intranet:/data/ftp-teste/antibes/i586/media/main/release/"
    26 
    2728SVN_SERV="http://contribsoft.caixamagica.pt/repo"
    2829
    2930SVN_FONT="$DIR/config/svn_fonts"
    3031SVN_TARBALL="$DIR/config/tarball_files"
    31 
    32 #Should be dynamic according to the makefile
    33 VERSION="0.12"
     32TARBALL_INFO="$DIR/config/tarball_names"
    3433
    3534# Read all of the command-line arguments as a single string.
     
    163162if test "$TARBALL" = "yes"; then
    164163       
     164
    165165        cd $DIR/SOURCES/
     166
     167        #Parse the tarball_names file to get the name of the tarball, version, and type
     168        while read ITEM; do
     169                if [ "`echo \"$ITEM\" | grep ^$PACKAGE`" ]; then
     170                        TARBALL_NAME1="`echo $ITEM  | awk 'BEGIN {FS="->"}{print $2}'| awk '{print $1}'`"
     171                        TARBALL_TYPE="`echo $ITEM  | awk 'BEGIN {FS="->"}{print $2}'| awk '{print $2}'`"
     172                        MAKEFILE="`echo $ITEM  | awk 'BEGIN {FS="->"}{print $2}'| awk '{print $3}'`"
     173                fi
     174        done < $TARBALL_INFO
     175
     176
     177        VERSION=`grep ^VERSION $MAKEFILE | awk 'BEGIN {FS="="} {print $NF}' | sed "s/ //g"`
     178
     179
     180        TARBALL_NAME=`echo ${TARBALL_NAME1} | sed "s/_VERSION_/$VERSION/g"`
     181
     182        #Command line for the tarball type
     183        # Check to see if the argument fits one of the following and act on it.
     184        case $TARBALL_TYPE in
     185
     186                tar.bz2)
     187                        TARBALL_COMMAND="cjvf"
     188                ;;
     189
     190                tar.gz|tgz)
     191                        TARBALL_COMMAND="czvf"
     192                ;;
     193
     194                tar)
     195                        TARBALL_COMMAND="cvf"
     196                ;;
     197
     198                *)
     199                        echo "The tarball type $TARBALL_TYPE is not suported"
     200                        exit 1
     201                ;;
     202
     203        esac
    166204
    167205        #create the directory if necessary
     
    178216                if [ "`echo \"$ITEM\" | grep ^$PACKAGE`" ]; then
    179217                        ORI="`echo $ITEM  | awk 'BEGIN {FS="->"}{print $2}'| awk '{print $1}'`"
    180                         DEST="`echo $ITEM  | awk 'BEGIN {FS="->"}{print $2}'| awk '{print $2}'`"
     218                        DEST1="`echo $ITEM  | awk 'BEGIN {FS="->"}{print $2}'| awk '{print $2}'`"
     219                        NEW_NAME="`echo $ITEM  | awk 'BEGIN {FS="->"}{print $2}'| awk '{print $3}'`"
     220
     221                        DEST=`echo ${DEST1} | sed "s/_VERSION_/$VERSION/g"`
    181222
    182223                        if test ! -d $DIR/SOURCES/tmp/$PACKAGE-$VERSION/$DEST/; then
     224                                echo "Creating the directory \"$DIR/SOURCES/tmp/$PACKAGE-$VERSION/$DEST\""
    183225                                mkdir -p $DIR/SOURCES/tmp/$PACKAGE-$VERSION/$DEST
    184226                        fi
    185227
    186228                        echo "Copying \"$DIR/SOURCES/$ORI\" to \"$DIR/SOURCES/tmp/$PACKAGE-$VERSION/$DEST\""
    187                         cp -a $DIR/SOURCES/$ORI $DIR/SOURCES/tmp/$PACKAGE-$VERSION/$DEST
     229                        cp -a $DIR/SOURCES/$ORI $DIR/SOURCES/tmp/$PACKAGE-$VERSION/$DEST/$NEW_NAME
    188230               fi             
    189231        done < $SVN_TARBALL
    190232
    191         cd  tmp/
    192         rm -rf $PACKAGE-$VERSION.tar.bz2
    193         tar -cjvf $PACKAGE-$VERSION.tar.bz2 --exclude=*.svn* $PACKAGE-$VERSION/
    194         echo
    195         echo "Copying the tarball to the right place:"
    196         cp -f $PACKAGE-$VERSION.tar.bz2  $DIR/PACKAGES/$PACKAGE/SOURCES/
     233
     234
     235        cd  tmp/$PACKAGE-$VERSION/
     236        rm -rf ../$TARBALL_NAME.$TARBALL_TYPE
     237        tar $TARBALL_COMMAND ../$TARBALL_NAME.$TARBALL_TYPE --exclude=*.svn* *
     238
     239        echo
     240        echo "Copying the tarball from \"$DIR/SOURCES/tmp/$TARBALL_NAME.$TARBALL_TYPE\" to \"$DIR/PACKAGES/$PACKAGE/SOURCES/\""
     241        cp -f ../$TARBALL_NAME.$TARBALL_TYPE  $DIR/PACKAGES/$PACKAGE/SOURCES/
    197242fi
    198243
Note: See TracChangeset for help on using the changeset viewer.