Changeset 681


Ignore:
Timestamp:
Aug 13, 2004, 2:45:48 PM (20 years ago)
Author:
joergs
Message:

changed build behaviour to not require a Makefile to create the source
tar file. Instead the file "SOURCES" is used by the build.sh skript, to
generate the tar on the fly.
Both methods are currently supported. build.sh checks if the file
"SOURCES" exist, otherwise it uses the makefile method.
The spec file must have the following setting:
Source: %{name}-%{version}.tar.bz2
%setup -c %{name}-%{version}
(instead of setup -n)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/technical/common/build/build.sh

    r679 r681  
    1 
    21#!/bin/bash
    32# Remote build script (iboernig@suse.de)
     
    6261                "9.1-i386")     
    6362                        BUILD_RPMS_TEST=$BUILD_RPMS_9_1_i386 ;;
     63                "sles9-i386")   
     64                        BUILD_RPMS_TEST=$BUILD_RPMS_sles9_i386 ;;
    6465        esac
    6566        if [ "$BUILD_RPMS_TEST" ]; then
     
    8081if [ -z "$1" ]; then
    8182        # without parameter, we are in source directory
    82         test -e Makefile && make
    8383        SPECFILE=$(ls *.spec | awk '{print $1}')
    84         TARFILE=$(ls  *.tar.[gb]z*| awk '{print $1}')
    8584        PACKAGE=$(awk '/^Name:/ {print $2}' <$SPECFILE)
    8685        VERSION=$(awk '/^Version:/ {print $2}' <$SPECFILE)
     86       
     87        # if config file exist, source it.
     88        # after this, the variable SOURCES should be set
     89        if [ -r SOURCES ]; then
     90                . SOURCES
     91                # create a tar file from the sources
     92                CREATE_TAR="yes"
     93        else
     94                # legacy method:
     95                # call the existing makefile to generate a tar file     
     96                test -e Makefile && make
     97                TARFILE=$(ls  *.tar.[gb]z*| awk '{print $1}')
     98        fi
    8799        SRC_FILES="$SPECFILE $TARFILE"
    88100else
     
    103115cp -a $SRC_FILES ${BUILDTEMP}/src/${PACKAGE}
    104116
     117if [ "$CREATE_TAR" = "yes" ]; then
     118        tar cvjf ${BUILDTEMP}/src/${PACKAGE}/$PACKAGE-$VERSION.tar.bz2 --files-from SOURCES
     119fi
     120
    105121if [ "$1" ]; then
    106122        # extract RPM in a tempoary directory
     
    110126
    111127# create buildscript
    112 
    113128cat > $BUILDSCRIPT <<EOF
    114129#!/bin/bash
     
    125140$BUILD_CMD $BUILD_MODE
    126141EOF
     142
    127143chmod a+x $BUILDSCRIPT
    128144
Note: See TracChangeset for help on using the changeset viewer.