aboutsummaryrefslogtreecommitdiff
path: root/trunk/src
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/src')
-rwxr-xr-xtrunk/src/mkbuild237
1 files changed, 127 insertions, 110 deletions
diff --git a/trunk/src/mkbuild b/trunk/src/mkbuild
index 8dbd1c7..7d131e3 100755
--- a/trunk/src/mkbuild
+++ b/trunk/src/mkbuild
@@ -18,8 +18,8 @@
#
# Based in model generic.SlackBuild of Luiz
#
-# Version 1.0.2
-PROG_VERSION=1.0.2
+# Version 1.0.3
+PROG_VERSION=1.0.3
PROG_NAME=`basename $0`
#--------------------------------------------------------------------
@@ -66,6 +66,8 @@ DESCRIPTION
this help mesage
-c, --commit
commit SlackBuilds in local svn tree
+ -n, --new <mkbuild_name>
+ start a new mkbuild configure file
-v, --version
program version
-V, --verbose
@@ -151,6 +153,12 @@ function set_parameters {
# Commit directory
COMMIT=$on
;;
+ '-n'|'--new')
+ # New mkbuild configure file
+ let i++
+ MKBUILD_NAME=${ALL_PAR[$i]}
+ [ ${MKBUILD_NAME:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR "--new <mkbuild_name>"
+ ;;
'-d'|'--debug')
# Debug mode
set -x
@@ -306,7 +314,7 @@ function clear_files {
# Remove temporary files
rm $AUX_TMP 2>/dev/null
rm $SLACKBUILD_TEMP 2>/dev/null
- chmod 755 *.SlackBuild
+ chmod 755 *.SlackBuild 2>/dev/null
}
function set_status {
@@ -611,132 +619,141 @@ 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`
+if [ ! -z $MKBUILD_NAME ]; then
+ # Start new mkbuild config-file
+ cp $MODEL_DIR/model.mkbuild ${MKBUILD_NAME}.mkbuild
+ edit_file "NAME" "${MKBUILD_NAME}" ${MKBUILD_NAME}.mkbuild
+ edit_file "NAME" "${MKBUILD_NAME}" ${MKBUILD_NAME}.mkbuild
+ echo "Edit ${MKBUILD_NAME}.mkbuild"
else
- URL_BASE=$URL
-fi
-[ $VERBOSE -eq $on ] && echo "[[DOWNLOAD FOLDER URL]]=\"$URL_BASE\""
+ # 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\""
+ # 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\""
+ # 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\""
+ # 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\""
+ # 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\""
+ # 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\""
+ # 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\""
+ # 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 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\""
+ 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\""
+ # 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\""
+ # ./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\""
+ # 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\""
+ # 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\""
+ # 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\""
+ # 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
+ #
+ # 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 .."
-# Others changes
-change_others_parameters
-[ $VERBOSE -eq $on ] && echo -en ".\nEdit others [[]] parameters .."
+ # 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 .."
+
+ # Commit SlackBuild
+ [ $COMMIT -eq $on ] && commit_slackbuild
+fi
# Clear temporary files
clear_files
[ $VERBOSE -eq $on ] && echo -e ".\nRemove temporary files ..."
-
-[ $COMMIT -eq $on ] && commit_slackbuild