diff options
Diffstat (limited to 'branches/0.6/src/mkbuild')
| -rwxr-xr-x | branches/0.6/src/mkbuild | 732 | 
1 files changed, 0 insertions, 732 deletions
diff --git a/branches/0.6/src/mkbuild b/branches/0.6/src/mkbuild deleted file mode 100755 index 60566dd..0000000 --- a/branches/0.6/src/mkbuild +++ /dev/null @@ -1,732 +0,0 @@ -#!/bin/bash -# -# mkbuild: SlackBuild scripts maker -# feedback: rudsonaalves at yahoo.com.br | gpl -# -#  mkbuild 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 2 of the License, or any later version. -# -#  mkbuild 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, write to the Free Software Foundation, Inc., 59 Temple -#  Place - Suite 330, Boston, MA 02111-1307, USA -# -# -# Based in model generic.SlackBuild of Luiz -# -# Version 1.0.0 -PROG_VERSION=1.0.0 -PROG_NAME=`basename $0` - -#-------------------------------------------------------------------- -# Functions -#-------------------------------------------------------------------- -function mkbuild_use() - -{ -    # mkbuild help function -    echo " -NAME -        mkbuild - create SlackBuild script from .mkbuild input file - -SYNOPSIS -        mkbuild [OPIONS] [mkbuild_file] - -DESCRIPTION -        <mkbuild_file> input file with build rules and variables - -        Input options: -            -a, --author <author_name> -                author name -            -ai, --author_initials <initials> -                author signature -            -cs, --const_string <string> -                construction string to source name -            -u, --url <url_address> -                url address to source -            -pn, --pkg_name <package_name> -                package name -            -sn, --src_name <source_name> -                source name -            -pv, --pkg_version <version> -                package version -            -md, --model <SlackBuild_model> -                SlackBuild model file -            -j, --jobs <jobs_number> -                Number of jobs to run simultaneously -            --prefix <install_dir> -                Prefix install directory - -        Program options: -        -h, --help -            this help mesage -        -c, --commit -            commit SlackBuilds in local svn tree -        -v, --version -            program version -        -V, --verbose -            print debug information - -EXAMPLES -        mkbuild --prefix /usr/local pyrex.mkbuild -            build pyrex.SlackBuild with prefix /usr/local and pyrex.mkbuild -            variables and options definitions. - -AUTHOR -        Written by Rduson R. Alves - -AVAILABILITY -        by svn: svn checkout svn://slack.sarava.org/simplepkg -        this mkbuild is found in branches/0.6/ - -REPORTING BUGS -        Report bugs to <alves_list@yahoo.com.br> - -COPYRIGHT -        Copyright © 2006 Free Software Foundation, Inc. -        This is free software. You may redistribute copies of it under the -        terms of the GNU General Public License -        <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the -        extent permitted by law. -" | less -} - -function error_codes { - -    # Start error codes function -    NULL_STRING=499 -    ERROR_FILE_NOT_FOUND=500 -    ERROR_CONSTRUCTION=501 -    ERROR_PROGRAM=502 -    ERROR_INPUT_PAR=503 -} - -function mkbuild_error { - -    # Error function -    case $1 in -        "$ERROR_FILE_NOT_FOUND") -            echo "File $2 not found!" -        ;; -        "$ERROR_CONSTRUCTION") -            echo "Construction error in $2 variable." -        ;; -        "$ERROR_PROGRAM") -            echo "Program logical error." -        ;; -        "$ERROR_INPUT_PAR") -            echo "Input parameter $2 error. See \"mkbuild --help\"." -        ;; -        "$NULL_STRING") -            mkbuild_use -        ;; -        *) -            echo "Unknow error!" -        ;; -    esac -    exit $1 -} - -function set_parameters { - -    # Get and set mkbuild variables with parameters input -    # Use: set_parameters $@ -    #           where $@ are the parameters input -    # -    ALL_PAR=( $@ )      # all parameters -    N_PAR=$#            # number of parameters - -    i=0                 # start counter - -    # analyze all the parameters -    while [ $i -lt $N_PAR ]; do -        # get parameter[i] -        PAR=${ALL_PAR[$i]} -        case $PAR in -            '-c'|'--commit') -                # Commit directory -                COMMIT=$on -            ;; -            '-d'|'--debug') -                # Debug mode -                set -x -            ;; -            '-h'|'--help' ) -                # Show help mesage -                mkbuild_use && exit 0 -            ;; -            '-v'|'--version') -                # Show program version -                echo -e "\n$PROG_NAME version $PROG_VERSION\n" && exit 0 -            ;; -            '-V' | '--verbose') -                # Enable verbose mode -                VERBOSE=1 -            ;; -            '-a'|'--author') -                # Enter with author name -                let i++ -                AUTHOR=${ALL_PAR[$i]} -                [ ${AUTHOR:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR AUTHOR -            ;; -            '-ai'|'--author_initials') -                # Enter with author name -                let i++ -                AUTHOR_INITIALS=${ALL_PAR[$i]} -                [ ${AUTHOR_INITIALS:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR AUTHOR_INITIALS -            ;; -            '-cs'|'--const_string') -                # Enter with construction source name string -                let i++ -                CONST_STRING=${ALL_PAR[$i]} -                [ ${CONST_STRING:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR CONST_STRING -            ;; -            '-md'|'--model') -                # Enter with SlackBuild model -                let i++ -                MODEL=${ALL_PAR[$i]} -                [ ${MODEL:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR MODEL -            ;; -            '-j'|'--jobs') -                # Enter with SlackBuild model -                let i++ -                NUMJOBS=${ALL_PAR[$i]} -                [ ${NUMJOBS:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR NUMJOBS -                [ ! is_number $NUMJOBS ] &&  mkbuild_error $ERROR_INPUT_PAR NUMJOBS -                NUMJOBS="-j$NUMJOBS" -            ;; -            '--prefix') -                # Enter with SlackBuild model -                let i++ -                PREFIX=${ALL_PAR[$i]} -                [ ${PREFIX:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR PREFIX -            ;; -            '-pn'|'--pkg_name') -                # Enter with package name -                let i++ -                PKG_NAME=${ALL_PAR[$i]} -                [ ${PKG_NAME:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR PKG_NAME -            ;; -            '-pv'|'pkg_version') -                # Enter with package version -                let i++ -                VERSION=${ALL_PAR[$i]} -                [ ${VERSION:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR VERSION -            ;; -            '-sn'|'--src_name') -                # Enter with source name -                let i++ -                SRC_NAME=${ALL_PAR[$i]} -                [ ${SRC_NAME:0:1} = '-' ] && mkbuild_error $ERROR_INPUT_PAR SRC_NAME -            ;; -            '-u'|'--url') -                # Enter with url address -                let i++ -                URL=${ALL_PAR[$i]} -                [ ${URL:0:1} = '-' ] && mkbuild_error $ERROR_INPUT_PAR URL -            ;; -            *) -                # mkbuild input file -                MK_INPUT_FILE="${PAR//.mkbuild}.mkbuild" -                [ ! -e $MK_INPUT_FILE ] && mkbuild_error $ERROR_FILE_NOT_FOUND $MK_INPUT_FILE -            ;; -        esac -        let i++ -    done -} - -function get_variable { - -    # Get variable value from mkbuild file (MK_INPUT_FILE) -    [ $# -ne 1 ] && mkbuild_error $ERROR_PROGRAM -    [ -z $MK_INPUT_FILE ] && echo "Warning: no [mkbuild_file]." && return 0 - -    grep "^\[\[${1}\]\]" $MK_INPUT_FILE | cut -f2- -d= | tr -d '\"' -} - -function edit_file { - -    # Edit file  $3, by change string [[$1]] to $2 -    local STR_OLD -    local STR_NEW - -    [ $# -ne 3 ] && mkbuild_error $ERROR_PROGRAM -    STR_OLD=$( echo $1 | sed 's/\//\\\//g' ) -    STR_NEW=$( echo $2 | sed 's/\//\\\//g' ) -    eval "sed 's/\[\[$STR_OLD\]\]/$STR_NEW/' $3 > $AUX_TMP" -    mv $AUX_TMP $3 -} - -function edit_file_full { - -    # Edit file  $3, by change string $1 to $2 -    local STR_OLD -    local STR_NEW - -    [ $# -ne 3 ] && mkbuild_error $ERROR_PROGRAM -    STR_OLD=$( echo $1 | sed 's/\//\\\//g' ) -    STR_NEW=$( echo $2 | sed 's/\//\\\//g' ) -    eval "sed 's/$STR_OLD/$STR_NEW/' $3 > $AUX_TMP" -    mv $AUX_TMP $3 -} - -function start_build  { - -    # Build initial sections -    [ $# -ne 1 ] && mkbuild_error $ERROR_PROGRAM - -    edit_file "SLACKBUILD AUTHOR" "$AUTHOR" $1 -    edit_file "SLACKBUILD AUTHOR INITIALS" $AUTHOR_INITIALS $1 -    edit_file "SOURCE NAME" "$SRC_NAME" $1 -    edit_file "PROGRAM NAME" "$PKG_NAME" $1 -    edit_file "PACKAGE NAME" "$PKG_NAME" $1 -    edit_file "DECOMPRESSOR" "$DECOMPRESSOR" $1 -    edit_file "DECOMPRESSOR TEST FLAG" "$DECOMPRESSOR_TEST_FLAG" $1 -    edit_file "PROGRAM URL" "$URL" $1 -    edit_file "ARCH" "$ARCH" $1 -    [ `is_number $NUMJOBS` ] && NUMJOBS="-j${NUMJOBS}" -    edit_file "NUMBER OF JOBS" "$NUMJOBS" $1 -    edit_file "VERSION" $VERSION $1 -    edit_file "SOURCE NAME CONSTRUCTION STRING" "$CONST_STRING" $1 -    edit_file "EXTENSION" "$EXTENSION" $1 -    edit_file "DOWNLOAD FOLDER URL" "$URL_BASE" $1 -    edit_file "OTHER CONFIGURE ARGS" "$OPTIONS" $1 -    edit_file "DOCUMENTATION FILES" "$DOCFILES" $1 -    edit_file "PREFIX" "$PREFIX" $1 - -    edit_file_full "\$EXTENSION" "$EXTENSION" $1 -} - -function clear_files { - -    # Remove temporary files -    rm $AUX_TMP 2>/dev/null -    rm $SLACKBUILD_TEMP 2>/dev/null -    chmod 755 *.SlackBuild -} - -function set_status { - -    # Set status section -    # $1 - Section -    # $2 - Status -    # $3 - file -    [ $# -ne 3 ] && mkbuild_error $ERROR_PROGRAM -    if [ "`get_status $1 $3`" != "all" ]; then -        eval "sed 's/^<$1>.*$/<$1> $2/' $3" > $AUX_TMP -        mv $AUX_TMP $3 -    else -        echo "Warning: Section $1 have status all. Can't change!" -    fi -} - -function get_status { - -    # Get status from section -    # $1 - Section -    # $2 - file -    [ $# -ne 2 ] && mkbuild_error $ERROR_PROGRAM -    eval "sed '/^<$1>.*$/! d' $2" -} - -function activate_sections { - -    # Enable and desable sections -    ACTIONS_LIST=`sed '/^#>>/,/<</ ! d; /^#/ d ' $MK_INPUT_FILE | tr -d ' '` -    for i in $ACTIONS_LIST; do -        STATUS=`echo $i | cut -f1 -d:` -        SECTION=`echo $i | cut -f2 -d:` -        set_status $SECTION $STATUS $SLACKBUILD_TEMP -    done -} - -function build_slackbuild { - -    # Remove off sections -    [ -e $SLACKBUILD ] && mv $SLACKBUILD $SLACKBUILD.old -    sed '/^<[a-z].*> off/, /^<\/[a-z].*>$/ d' $SLACKBUILD_TEMP > $AUX_TMP -    # Remove sections names -    sed '/^<.*$/ d' $AUX_TMP > $SLACKBUILD_TEMP -    # Remove clear lines -    sed ':i ; $! N; s/\n/<NL>/ ; t i' $SLACKBUILD_TEMP | sed 's/<NL><NL><NL>/<NL><NL>/g' | sed 's/<NL><NL><NL>/<NL><NL>/g' | sed 's/<NL>/\n/g' > $AUX_TMP -    sed '1,/^#\!/ {/^#\!/ b; d }' $AUX_TMP > $SLACKBUILD -} - -function section_edit { - -    # Edits a section substituting its content -    [ -z $MK_INPUT_FILE ] && return 0 - -    SECTION_LIST=`grep '^#>[a-z]' $MK_INPUT_FILE | cut -c3-` - -    # Check for sections change -    [ -z "$SECTION_LIST" ] && return 0 - -    # Change sections -    for i in $SECTION_LIST; do -        if [ "$i" = "slackdesc" ]; then -            # Special slackdesc section -            slackdesc_edit > $AUX_TMP -            mv $AUX_TMP $SLACKBUILD_TEMP -        else -            # Others sections -            section_change $i -        fi -    done -} - -function slackdesc_edit { - -    # Edit slackdesc section -    sed -n '1,/|-----/ { /<slackdesc>/ b; /|-----/ b; p; }' $SLACKBUILD_TEMP -    echo -n $PKG_NAME | tr [a-z+\-] " " -    echo -n "|-----handy-ruler" -    let N=18+${#PKG_NAME} -    for i in `seq $N $SLACKDESC_LEN`; do -        echo -n "-" -    done -    echo -en "|\n" - -    sed -n '/#>slackdesc/,/#<slackdesc/ { /^#/ b; p }' $MK_INPUT_FILE -    sed '1, /\[\[SLACK-DESC\]\]/ d' $SLACKBUILD_TEMP -} - -function section_change { - -    # Change section lines -    [ $# -ne 1 ] && mkbuild_error $ERROR_PROGRAM - -    # Copy first half -    eval "sed '1,/^<$1>/! d' $SLACKBUILD_TEMP > $AUX_TMP" -    # Paste new section -    eval "sed -n '/#>$1/,/#<$1/ { /^#>/ b; /^#</ b; p }' $MK_INPUT_FILE >> $AUX_TMP" -    # Copy second halt -    eval "sed '/^<\/$1>/,$ ! d' $SLACKBUILD_TEMP >> $AUX_TMP" - -    mv $AUX_TMP $SLACKBUILD_TEMP -} - -function make_slack_required { - -    # Build slack-required file -    [ -e slack-required ] && mv slack-required slack-required.old -    [ -z "$SLACK_REQUIRED" ] && return 0 - -    echo -e "# Dependency list to $SRC_NAME\n#\n# dependency [condition] [version]]" > slack-required - -    echo $SLACK_REQUIRED | sed 's/:/\n/g' | while read i; do -        REQ=`echo $i | awk '{ print $1 }'` -        CON=`echo $i | awk '{ print $2 }'` -        VER=`echo $i | awk '{ print $3 }'` -        echo -e "$REQ\t\t$CON\t\t$VER" >> slack-required -    done -} - -function change_others_parameters { - -    # Change others parameters started by '[[' in .mkbuild file -    grep '\[\[[A-Za-z]' $MK_INPUT_FILE | while read i; do -        CHANGE="`echo $i | sed 's/\[\[\(.*\)\]\]=\"\(.*\)\"/\1/'`" -        VALUE="`echo $i | sed 's/\[\[\(.*\)\]\]=\"\(.*\)\"/\2/'`" -        edit_file "$CHANGE" "$VALUE" $SLACKBUILD -    done -} - -function commit_slackbuild { - -    # Commit SlackBuild in local Slack.Sarava tree -    if [ $UID -ne 0 ]; then -        echo "Only root can commit SlackBuilds..." -        return 1 -    fi - -    # check SlackBuilds directory -    [ ! -e $SLACKBUILDS_DIR ] && createpkg --sync - -    # Get SlackBuild path -    # Get SlackBuild path in parameter file -    SLACKBUILD_PATH=`validate_parameter "$SLACKBUILD_PATH" "SLACKBUILD PATH" ""` -    # Get SlackBuild path in slackbuild local tree -    if [ $? -ne 0 ]; then -        SLACKBUILD_PATH=`find $SLACKBUILDS_DIR -name $SLACKBUILD | xargs dirname` -    fi -    # Get SlackBuild path in gentoo-portage tree -    if [ "$SLACKBUILD_PATH" == "" ]; then -        # Mount SlackBuild path -        [ $VERBOSE -eq $on ] && echo -e "\nFind SlackBuild PATH in Slack.Sarava tree..." -        AUX=`lynx -connect_timeout=10 -dump http://gentoo-portage.com/Search?search=$PKG_NAME | sed -n '/Results:/,+1 { /Results:/ b ; p }' | head --lines=1 | tr -d " "` -        [ ! -z $AUX ] && SLACKBUILD_PATH="`dirname $AUX | tr - /`/`basename $AUX`" || SLACKBUILD_PATH="others/unclassified/$PKG_NAME" -    fi - -    # change to SlackBuilds directory -    cd $SLACKBUILDS_DIR/ - -    # Add SlackBuild scripts -    # check path -    [ ! -e $SLACKBUILD_PATH ] && svn_mkdir $SLACKBUILD_PATH -    # add SlackBuild -    svn_add $SLACKBUILD $SLACKBUILD_PATH - -    # check slack-required -    # add slack-required -    [ -e $WORK/slack-required ] && svn_add slack-required $SLACKBUILD_PATH - -    cd $WORK -} - -function svn_mkdir { - -    # svn make directory -    [ $# -ne 1 ] && mkbuild_error 0 - -    echo "svn_mkdir $1  $2" -    DIR_LIST=`echo $1 | tr '/' ' '` - -    DIR="" -    for i in $DIR_LIST; do -        DIR=$DIR/$i -        [ ! -e ${DIR:1} ] && svn mkdir ${DIR:1} -    done -} - -function svn_add { - -    # svn add file -    [ $# -ne 2 ] && mkbuild_error 0 - -    # copy file -    if [ -e $2/$1 ]; then -        echo "$2/$1 exist. Overwriter it." -        cp $WORK/$1 $2/ -    else -        cp $WORK/$1 $2/ -        # add file to svn tree -        svn add $2/$1 -    fi -} - -function is_number { - -    # Check if $1 is a number -    local -i int -    if [ $# -eq 0 ]; then -        return 1 -    else -        (let int=$1)  2>/dev/null -        return $?       # Exit status of the let thread -    fi -} - -function validate_parameter { - -    # Validate parameter in .mkbuild file -    if [ ! -z "$1" ]; then -        echo "$1" -    else -        local STRING="`get_variable "$2"`" -        if [ -z "$STRING" ]; then -            [ ! -z "$3" ] && echo "$3" || return 1 -        else -            echo "$STRING" -        fi -    fi -} - -function decompress_find { - -    # Find decompressor program and test flag -    case $EXTENSION in -        'gz'|'GZ') -            DECOMPRESSOR="gunzip" -            DECOMPRESSOR_TEST_FLAG="-t"$NULL_STRING -        ;; -        'bz2'|'BZ2') -            DECOMPRESSOR="bunzip2" -            DECOMPRESSOR_TEST_FLAG="-t" -        ;; -        'zip'|'ZIP') -            DECOMPRESSOR="unzip" -            DECOMPRESSOR_TEST_FLAG="-t" -        ;; -        *) -            mkbuild_error $ERROR_CONSTRUCTION "DECOMPRESSOR" -        ;; -    esac -} - -#============================= -#        Main Program -#============================= -#----------------------------- -# Common functions -COMMON="/usr/libexec/simplepkg/common.sh" -SIMPLEPKG_CONF="/etc/simplepkg/simplepkg.conf" -WORK=`pwd` -LANG=en_US - -if [ -f "$COMMON" ]; then -  source $COMMON -else -  echo "error: file $COMMON found, check your $BASENAME installation" -  mk_exit 0 -fi - -# Start constants -set_constants - -# Set commit off -COMMIT=$off -# Set verbose off -VERBOSE=$off -# Createpkg and mkbuild section -SLACKBUILDS_DIR="`eval_parameter SLACKBUILDS_DIR /var/slackbuilds`" -# Auxiliar file -AUX_TMP=/tmp/mkbuild_tmp.$RANDOM -# Derectory to SlackBuild models -MODEL_DIR=${MODEL_DIR:="/etc/simplepkg/defaults/mkbuild"} -# SlackDesk line length -SLACKDESC_LEN=78 - -# Load error codes -error_codes - -[ $# -eq 0 ] && mk_exit $NULL_STRING - -# Configure input parameters -set_parameters $@ - -[ $VERBOSE -eq $on ] && echo -e "$PROG_NAME version $PROG_VERSION\n" - -# Get values -# Author name -AUTHOR=${AUTHOR:="`get_variable "SLACKBUILD AUTHOR"`"} -[ -z "$AUTHOR" ] && mkbuild_error $ERROR_CONSTRUCTION "SLACKBUILD AUTHOR" -[ $VERBOSE -eq $on ] && echo "[[SLACKBUILD AUTHOR]]=\"$AUTHOR\"" - -# Author initials -STR_MOUNT=`echo $AUTHOR | sed 's/ /\n/g' | sed 's/^\([A-Z]\).*/\1/' | sed ':i; $!N;  s/\n//; ti' | tr [A-Z] [a-z]` -AUTHOR_INITIALS="`validate_parameter "$AUTHOR_INITIALS" "SLACKBUILD AUTHOR INITIALS" "$STR_MOUNT"`" || mkbuild_error $ERROR_CONSTRUCTION "SLACKBUILD AUTHOR INITIALS" -[ $VERBOSE -eq $on ] && echo "[[SLACKBUILD AUTHOR INITIALS]]=\"$AUTHOR_INITIALS\"" - -# URL program -URL=`validate_parameter "$URL" "DOWNLOAD FOLDER URL" ""` || mkbuild_error $ERROR_CONSTRUCTION "URL" -[ $VERBOSE -eq $on ] && echo "[[URL]]=\"$URL\"" - -STR_MOUNT="`echo $URL | rev | cut -c1-3 | rev | tr -d '.'`" -if [ $STR_MOUNT = "gz" -o $STR_MOUNT = "tgz" -o $STR_MOUNT = "bz2" -o $STR_MOUNT = "zip" ]; then -    SOURCE_NAME=`basename $URL` -    URL_BASE=`dirname $URL` -else -    URL_BASE=$URL -fi -[ $VERBOSE -eq $on ] && echo "[[DOWNLOAD FOLDER URL]]=\"$URL_BASE\"" - -# Extension -EXTENSION=`validate_parameter "$EXTENSION" "EXTENSION" "$STR_MOUNT"` || mkbuild_error $ERROR_CONSTRUCTION "EXTENSION" -[ $VERBOSE -eq $on ] && echo "[[EXTENSION]]=\"$EXTENSION\"" - -# Build archteture -ARCH=`validate_parameter "$ARCH" "ARCH" "i486"` -[ $VERBOSE -eq $on ] && echo "[[ARCH]]=\"$ARCH\"" - -# Source name -STR_MOUNT=`echo $SOURCE_NAME | sed -r 's/(.*)-(.*)\.(.*\..*)$/\1/'` -SRC_NAME=`validate_parameter "$SRC_NAME" "SOURCE NAME" "$STR_MOUNT"` || mkbuild_error $ERROR_CONSTRUCTION "SOURCE NAME" -[ $VERBOSE -eq $on ] && echo "[[SOURCE NAME]]=\"$SRC_NAME\"" - -# Package name -STR_MOUNT=`echo $SRC_NAME | tr [A-Z_] [a-z\-]` -PKG_NAME=`validate_parameter "$PKG_NAME" "PACKAGE NAME" "$STR_MOUNT"` -[ $VERBOSE -eq $on ] && echo "[[PACKAGE NAME]]=\"$PKG_NAME\"" - -# Version -STR_MOUNT=`echo $SOURCE_NAME | sed -r 's/(.*)-(.*)\.(.*\..*)$/\2/'` -VERSION=`validate_parameter "$VERSION" "VERSION" $STR_MOUNT` || mkbuild_error $ERROR_CONSTRUCTION "VERSION" -[ $VERBOSE -eq $on ] && echo "[[VERSION]]=\"$VERSION\"" - -# Construction source name string -CONST_STRING="`validate_parameter "$CONST_STRING" "SOURCE NAME CONSTRUCTION STRING" "\\\$SRC_NAME-\\\$VERSION.tar.$EXTENSION"`" -[ $VERBOSE -eq $on ] && echo "[[SOURCE NAME CONSTRUCTION STRING]]=\"$CONST_STRING\"" - -# Build Source Name -[ -z $SOURCE_NAME ] && SOURCE_NAME=`eval "echo $CONST_STRING"` -[ $VERBOSE -eq $on ] && echo "SOURCE_NAME=\"$SOURCE_NAME\"" - -# Decompressor program and test flag -DECOMPRESSOR=`validate_parameter "$DECOMPRESSOR" "DECOMPRESSOR" ""` || decompress_find -[ $VERBOSE -eq $on ] && echo "[[DECOMPRESSOR]]=\"$DECOMPRESSOR\"" - -DECOMPRESSOR_TEST_FLAG=`validate_parameter "$DECOMPRESSOR_TEST_FLAG" "DECOMPRESSOR TEST FLAG" ""` || mkbuild_error $ERROR_CONSTRUCTION "DECOMPRESSOR TEST FLAG" -[ $VERBOSE -eq $on ] && echo "[[DECOMPRESSOR TEST FLAG]]=\"$DECOMPRESSOR_TEST_FLAG\"" - -# Documentations list -DOCFILES=`validate_parameter "$DOCFILES" "DOCUMENTATION FILES" "NEWS TODO README AUTHORS INSTALL ChangeLog MAINTAINERS COPYING readme.*"` -[ $VERBOSE -eq $on ] && echo "[[DOCUMENTATION FILES]]=\"$DOCFILES\"" - -# ./configure option -OPTIONS=`validate_parameter "$OPTIONS" "OTHER CONFIGURE ARGS" ""` -[ $VERBOSE -eq $on ] && echo "[[OTHER CONFIGURE ARGS]]=\"$OPTIONS\"" - -# PREFIX -PREFIX=`validate_parameter "$PREFIX" "PREFIX" "/usr"` -[ $VERBOSE -eq $on ] && echo "[[PREFIX]]=\"$PREFIX\"" - -# Number of jobs -NUMJOBS=`validate_parameter "$NUMJOBS" "NUMBER OF JOBS" ""` -[ $VERBOSE -eq $on ] && echo "[[NUMBER OF JOBS]]=\"$NUMJOBS\"" - -# Make slack-required file. -SLACK_REQUIRED=`validate_parameter "$SLACK_REQUIRED" "SLACK REQUIRED" ""` -[ $VERBOSE -eq $on ] && echo "[[SLACK REQUIRED]]=\"$SLACK_REQUIRED\"" - -# SlackBuild model -MODEL=`validate_parameter "$MODEL" "SLACKBUILD MODEL" "generic.mkSlackBuild"` -[ $VERBOSE -eq $on ] && echo "[[SLACKBUILD MODEL]]=\"$MODEL\"" - -# -# Start build SlackBuild -SLACKBUILD=${PKG_NAME}.SlackBuild -SLACKBUILD_TEMP=$SLACKBUILD.tmp -cp $MODEL_DIR/$MODEL $SLACKBUILD_TEMP -[ $VERBOSE -eq $on ] && echo -en "\nStart SlackBuild make" - -# Change strings from model -start_build $SLACKBUILD_TEMP -[ $VERBOSE -eq $on ] && echo -en "\nEdit mkSlackBuild model .." - -# On/Off sections -activate_sections -[ $VERBOSE -eq $on ] && echo -en ".\nEnable and desable sections .." - -# Change sections -section_edit -[ $VERBOSE -eq $on ] && echo -en ".\nChange sections .." - -# Remove off sections -build_slackbuild -[ $VERBOSE -eq $on ] && echo -en ".\nRemove off sections .." - -# Make slack-required file -make_slack_required -[ $VERBOSE -eq $on ] && echo -en ".\nMake slack-required file .." - -if [ -e slack-required ]; then -    DEPENDENCY_LIST="`cat slack-required | awk '{print $1}' | grep '^[a-z]' | tr '\012' ' '`" -    edit_file "REQUIRES" "$DEPENDENCY_LIST" $SLACKBUILD -else -    edit_file "REQUIRES" "Null" $SLACKBUILD -fi - -# Others changes -change_others_parameters -[ $VERBOSE -eq $on ] && echo -en ".\nEdit others [[]] parameters .." - -# Clear temporary files -clear_files -[ $VERBOSE -eq $on ] && echo -e ".\nRemove temporary files ..." - -[ $COMMIT -eq $on ] && commit_slackbuild  | 
