aboutsummaryrefslogtreecommitdiff
path: root/trunk/src/mkbuild
diff options
context:
space:
mode:
authorrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>2007-11-28 17:36:31 +0000
committerrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>2007-11-28 17:36:31 +0000
commit96c62a78b61d993eaeae2ca136085bffc2c5fc7c (patch)
tree9b394981850ccc129adf25495a985c20a2694c25 /trunk/src/mkbuild
parentd2cd448dc7cc047bdd1bb19a9d78a1c67114cbe2 (diff)
downloadsimplepkg-96c62a78b61d993eaeae2ca136085bffc2c5fc7c.tar.gz
simplepkg-96c62a78b61d993eaeae2ca136085bffc2c5fc7c.tar.bz2
várias mudanças: lspkg, createpkg, mkbuild, common.sh, simplepkg.conf.new, generic.mkSlackBuild, model.mkbuild
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@458 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk/src/mkbuild')
-rwxr-xr-xtrunk/src/mkbuild206
1 files changed, 96 insertions, 110 deletions
diff --git a/trunk/src/mkbuild b/trunk/src/mkbuild
index 0a024f1..fa8f828 100755
--- a/trunk/src/mkbuild
+++ b/trunk/src/mkbuild
@@ -18,8 +18,8 @@
#
# Based in model generic.SlackBuild of Luiz
#
-# Version 1.1.4
-PROG_VERSION=1.1.4
+# Version 1.1.8
+PROG_VERSION=1.1.8
PROG_NAME=`basename $0`
#--------------------------------------------------------------------
@@ -64,8 +64,12 @@ DESCRIPTION
Program options:
-h, --help
this help mesage
- -c, --commit
+ -cs, --commit-slackbuild
commit SlackBuilds in local svn SlackBuild tree
+ -cm, --commit-mkbuild
+ commit .mkbuild in local svn mkbuild tree
+ -c, --commit-all
+ commit SlackBuild and .mkbuild files in local svn tree
-n, --new <mkbuild_name>
start a new mkbuild configure file
-v, --version
@@ -97,42 +101,6 @@ COPYRIGHT
" | 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
@@ -143,15 +111,24 @@ function set_parameters {
# Parameters analyze
while [ "$1" ]; do
case $1 in
- '-c'|'--commit')
- # Commit directory
- COMMIT=$on
+ '-cs'|'--commit-slackbuild')
+ # Commit SlackBuild file
+ COMMIT_SLACKBUILD=$on
+ ;;
+ '-cm'|'--commit-mkbuild')
+ # commit mkbuild file
+ COMMIT_MKBUILD=$on
+ ;;
+ '-c'|'--commit-all')
+ # Commit SlackBuild and mkbuild file
+ COMMIT_SLACKBUILD=$on
+ COMMIT_MKBUILD=$on
;;
'-n'|'--new')
# New mkbuild configure file
let i++
MKBUILD_NAME=$2
- [ ${MKBUILD_NAME:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR "--new <mkbuild_name>"
+ [ ${MKBUILD_NAME:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR "--new <mkbuild_name>"
shift
;;
'-d'|'--debug')
@@ -174,36 +151,36 @@ function set_parameters {
# Enter with author name
let i++
AUTHOR=$2
- [ ${AUTHOR:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR AUTHOR
+ [ ${AUTHOR:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR AUTHOR
shift
;;
'-ai'|'--author_initials')
# Enter with author name
let i++
AUTHOR_INITIALS=$2
- [ ${AUTHOR_INITIALS:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR AUTHOR_INITIALS
+ [ ${AUTHOR_INITIALS:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR AUTHOR_INITIALS
shift
;;
'-cs'|'--const_string')
# Enter with construction source name string
let i++
CONST_STRING=$2
- [ ${CONST_STRING:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR CONST_STRING
+ [ ${CONST_STRING:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR CONST_STRING
shift
;;
'-md'|'--model')
# Enter with SlackBuild model
let i++
MODEL=$2
- [ ${MODEL:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR MODEL
+ [ ${MODEL:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR MODEL
shift
;;
'-j'|'--jobs')
# Enter with SlackBuild model
let i++
NUMJOBS=$2
- [ ${NUMJOBS:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR NUMJOBS
- [ ! is_number $NUMJOBS ] && mkbuild_error $ERROR_INPUT_PAR NUMJOBS
+ [ ${NUMJOBS:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR NUMJOBS
+ [ ! is_number $NUMJOBS ] && handle_error $ERROR_MKBUILD_INPUT_PAR NUMJOBS
NUMJOBS="-j$NUMJOBS"
shift
;;
@@ -211,41 +188,41 @@ function set_parameters {
# Enter with SlackBuild model
let i++
PREFIX=$2
- [ ${PREFIX:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR PREFIX
+ [ ${PREFIX:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR PREFIX
shift
;;
'-pn'|'--pkg_name')
# Enter with package name
let i++
PKG_NAME=$2
- [ ${PKG_NAME:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR PKG_NAME
+ [ ${PKG_NAME:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR PKG_NAME
shift
;;
'-pv'|'pkg_version')
# Enter with package version
let i++
VERSION=$2
- [ ${VERSION:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR VERSION
+ [ ${VERSION:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR VERSION
shift
;;
'-sn'|'--src_name')
# Enter with source name
let i++
SRC_NAME=$2
- [ ${SRC_NAME:0:1} = '-' ] && mkbuild_error $ERROR_INPUT_PAR SRC_NAME
+ [ ${SRC_NAME:0:1} = '-' ] && handle_error $ERROR_MKBUILD_INPUT_PAR SRC_NAME
shift
;;
'-u'|'--url')
# Enter with url address
let i++
URL=$2
- [ ${URL:0:1} = '-' ] && mkbuild_error $ERROR_INPUT_PAR URL
+ [ ${URL:0:1} = '-' ] && handle_error $ERROR_MKBUILD_INPUT_PAR URL
shift
;;
*)
# mkbuild input file
MK_INPUT_FILE="${1//.mkbuild}.mkbuild"
- [ ! -e $MK_INPUT_FILE ] && mkbuild_error $ERROR_FILE_NOT_FOUND $MK_INPUT_FILE
+ [ ! -e $MK_INPUT_FILE ] && handle_error $ERROR_FILE_NOTFOUND $MK_INPUT_FILE
;;
esac
shift
@@ -255,7 +232,7 @@ function set_parameters {
function get_variable {
# Get variable value from mkbuild file (MK_INPUT_FILE)
- [ $# -ne 1 ] && mkbuild_error $ERROR_PROGRAM
+ [ $# -ne 1 ] && handle_error $ERROR_MKBUILD_PROGRAM
[ -z $MK_INPUT_FILE ] && echo "Warning: no [mkbuild_file]." && return 0
grep "^\[\[${1}\]\]" $MK_INPUT_FILE | cut -f2- -d= | sed -e 's/^"//' -e 's/"$//'
@@ -267,7 +244,7 @@ function edit_file {
local STR_OLD
local STR_NEW
- [ $# -ne 3 ] && mkbuild_error $ERROR_PROGRAM
+ [ $# -ne 3 ] && handle_error $ERROR_MKBUILD_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"
@@ -280,7 +257,7 @@ function edit_file_full {
local STR_OLD
local STR_NEW
- [ $# -ne 3 ] && mkbuild_error $ERROR_PROGRAM
+ [ $# -ne 3 ] && handle_error $ERROR_MKBUILD_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"
@@ -290,7 +267,7 @@ function edit_file_full {
function start_build {
# Build initial sections
- [ $# -ne 1 ] && mkbuild_error $ERROR_PROGRAM
+ [ $# -ne 1 ] && handle_error $ERROR_MKBUILD_PROGRAM
edit_file "SLACKBUILD AUTHOR" "$AUTHOR" $1
edit_file "SLACKBUILD AUTHOR INITIALS" $AUTHOR_INITIALS $1
@@ -301,7 +278,6 @@ function start_build {
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
@@ -330,7 +306,7 @@ function set_status {
# $1 - Section
# $2 - Status
# $3 - file
- [ $# -ne 3 ] && mkbuild_error $ERROR_PROGRAM
+ [ $# -ne 3 ] && handle_error $ERROR_MKBUILD_PROGRAM
if [ "`get_status $1 $3`" != "all" ]; then
[ $VERBOSE -eq $on ] && echo "Section $1 $2"
eval "sed 's/^<$1>.*$/<$1> $2/' $3" > $AUX_TMP
@@ -345,7 +321,7 @@ function get_status {
# Get status from section
# $1 - Section
# $2 - file
- [ $# -ne 2 ] && mkbuild_error $ERROR_PROGRAM
+ [ $# -ne 2 ] && handle_error $ERROR_MKBUILD_PROGRAM
eval "sed '/^<$1>.*$/! d' $2"
}
@@ -418,7 +394,7 @@ function slackdesc_edit {
function section_change {
# Change section lines
- [ $# -ne 1 ] && mkbuild_error $ERROR_PROGRAM
+ [ $# -ne 1 ] && handle_error $ERROR_MKBUILD_PROGRAM
# Copy first half
eval "sed '1,/^<$1>/! d' $SLACKBUILD_TEMP > $AUX_TMP"
@@ -472,15 +448,12 @@ function commit_slackbuild {
echo "Only root can commit SlackBuilds..."
return 1
fi
+ echo -e "\nCommit $SLACKBUILD"
# 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" ""`
- [ $VERBOSE -eq $on ] && echo "[[SLACKBUILD PATH]]=\"$SLACKBUILD_PATH\""
-
# Get SlackBuild path in slackbuild local tree
if [ -z $SLACKBUILD_PATH ]; then
SLACKBUILD_PATH=`find $SLACKBUILDS_DIR -name $SLACKBUILD | xargs dirname` 2>/dev/null
@@ -517,17 +490,18 @@ function commit_mkbuild {
echo "Only root can commit mkbuild..."
return 1
fi
+ echo -e "\nCommit $MK_INPUT_FILE"
# check mkbuild directory
- [ ! -e $MKBUILD_REPOS ] && createpkg --sync
+ [ ! -e $MKBUILDS_DIR ] && build_repo $MKBUILDS_DIR $MKBUILDS_SVN
# Get mkbuild path in parameter file
MKBUILD_PATH=`validate_parameter "$SLACKBUILD_PATH" "SLACKBUILD PATH" ""`
- [ $VERBOSE -eq $on ] && echo "[[SLACKBUILD PATH]]=\"$SLACKBUILD_PATH\""
+ #[ $VERBOSE -eq $on ] && echo "[[SLACKBUILD PATH]]=\"$SLACKBUILD_PATH\""
# Get mkbuild path in slackbuild local tree
if [ -z $MKBUILD_PATH ]; then
- MKBUILD_PATH=`find $MKBUILD_REPOS -name $MKBUILD_NAME | xargs dirname` 2>/dev/null
+ MKBUILD_PATH=`find $MKBUILDS_DIR -name $MK_INPUT_FILE | xargs dirname` 2>/dev/null
fi
# Get SlackBuild path in gentoo-portage tree
@@ -545,7 +519,7 @@ function commit_mkbuild {
# check path
[ ! -e $MKBUILD_PATH ] && svn_mkdir $MKBUILD_PATH
# add SlackBuild
- svn_add $MKBUILD_NAME $MKBUILD_PATH
+ svn_add $MK_INPUT_FILE $MKBUILD_PATH
cd $WORK
}
@@ -553,9 +527,8 @@ function commit_mkbuild {
function svn_mkdir {
# svn make directory
- [ $# -ne 1 ] && mkbuild_error 0
+ [ $# -ne 1 ] && handle_error 0
- echo "svn_mkdir $1 $2"
DIR_LIST=`echo $1 | tr '/' ' '`
DIR=""
@@ -568,7 +541,7 @@ function svn_mkdir {
function svn_add {
# svn add file
- [ $# -ne 2 ] && mkbuild_error 0
+ [ $# -ne 2 ] && handle_error 0
# copy file
if [ -e $2/$1 ]; then
@@ -584,27 +557,17 @@ function svn_add {
# ----------------------------------------------------------------
# ------------------- general functions --------------------------
-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
+ [ $# -ne 3 ] && return 1
+
if [ ! -z "$1" ]; then
echo "$1"
else
local STRING="`get_variable "$2"`"
if [ -z "$STRING" ]; then
- [ ! -z "$3" ] && echo "$3" || return 1
+ echo "$3"
else
echo "$STRING"
fi
@@ -628,7 +591,7 @@ function decompress_find {
DECOMPRESSOR_TEST_FLAG="-t"
;;
*)
- mkbuild_error $ERROR_CONSTRUCTION "DECOMPRESSOR"
+ handle_error $ERROR_MKBUILD_CONSTRUCTION "DECOMPRESSOR"
;;
esac
}
@@ -636,8 +599,10 @@ function decompress_find {
function load_parameters {
# Load Createpkg parameters
- MKBUILD_REPOS="`eval_parameter MAKEPKG_REPOS /var/simplaret/repos`"
SLACKBUILDS_DIR="`eval_parameter SLACKBUILDS_DIR /var/simplaret/slackbuilds`"
+ MKBUILDS_DIR="`eval_parameter MKBUILDS_DIR /var/simplaret/mkbuilds`"
+ SLACKBUILDS_SVN="`eval_parameter SLACKBUILDS_DIR svn://slack.sarava.org/slackbuilds`"
+ MKBUILDS_SVN="`eval_parameter MKBUILDS_SVN svn://slack.sarava.org/mkbuilds`"
COLOR_MODE="`eval_parameter COLOR_MODE none`"
}
@@ -650,6 +615,7 @@ function load_parameters {
# Common functions
COMMON_SH="/usr/libexec/simplepkg/common.sh"
SIMPLEPKG_CONF="/etc/simplepkg/simplepkg.conf"
+BASENAME="`basename $0`"
WORK=`pwd`
LANG=en_US
@@ -657,14 +623,15 @@ if [ -f "$COMMON_SH" ]; then
source $COMMON_SH
else
echo "error: file $COMMON_SH not found. Check your $BASENAME installation"
- mkbuild_error 0
+ handle_error 0
fi
# Start constants
set_constants
# Set commit off
-COMMIT=$off
+COMMIT_SLACKBUILD=$off
+COMMIT_MKBUILD=$off
# Set verbose off
VERBOSE=$off
@@ -681,33 +648,42 @@ SLACKDESC_LEN=78
# Load error codes
error_codes
-[ $# -eq 0 ] && mkbuild_error $NULL_STRING
+[ $# -eq 0 ] && mkbuild_use && exit 1
# Configure input parameters
set_parameters $@
[ $VERBOSE -eq $on ] && echo -e "$PROG_NAME version $PROG_VERSION\n"
-
if [ ! -z $MKBUILD_NAME ]; then
- # Start new mkbuild config-file
+ # Create a new .mkbuild parameters-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
+ # Package Author
+ [ -z $AUTHOR ] && edit_file "YOUR NAME" "${AUTHOR}" ${MKBUILD_NAME}.mkbuild
+ # Package Author Signature
+ [ -z $AUTHOR_INITIAL ] && edit_file "YOUR SIGNATURE" "${AUTHOR_INITIAL}" ${MKBUILD_NAME}.mkbuild
+ # Change Default SourceForge URL
+ [ -z $URL ] && URL="http://downloads.sourceforge.net/[[PACKAGE NAME]]"
+ edit_file "DEFAULT URL" "${URL}" ${MKBUILD_NAME}.mkbuild
+ # Change Package Name
+ edit_file "PACKAGE NAME" "${MKBUILD_NAME}" ${MKBUILD_NAME}.mkbuild
+ edit_file "PACKAGE NAME" "${MKBUILD_NAME}" ${MKBUILD_NAME}.mkbuild
+
+ # Print .mkbuild name
echo "${MKBUILD_NAME}.mkbuild"
else
# Get values
# Author name
AUTHOR=${AUTHOR:="`get_variable "SLACKBUILD AUTHOR"`"}
- [ -z "$AUTHOR" ] && mkbuild_error $ERROR_CONSTRUCTION "SLACKBUILD AUTHOR"
+ [ -z "$AUTHOR" ] && handle_error $ERROR_MKBUILD_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"
+ AUTHOR_INITIALS="`validate_parameter "$AUTHOR_INITIALS" "SLACKBUILD AUTHOR INITIALS" "$STR_MOUNT"`" || handle_error $ERROR_MKBUILD_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"
+ URL=`validate_parameter "$URL" "DOWNLOAD FOLDER URL" ""` || handle_error $ERROR_MKBUILD_CONSTRUCTION "URL"
[ $VERBOSE -eq $on ] && echo "[[URL]]=\"$URL\""
STR_MOUNT="`echo $URL | rev | cut -c1-3 | rev | tr -d '.'`"
@@ -720,16 +696,16 @@ else
[ $VERBOSE -eq $on ] && echo "[[DOWNLOAD FOLDER URL]]=\"$URL_BASE\""
# Extension
- EXTENSION=`validate_parameter "$EXTENSION" "EXTENSION" "$STR_MOUNT"` || mkbuild_error $ERROR_CONSTRUCTION "EXTENSION"
+ EXTENSION=`validate_parameter "$EXTENSION" "EXTENSION" "$STR_MOUNT"` || handle_error $ERROR_MKBUILD_CONSTRUCTION "EXTENSION"
[ $VERBOSE -eq $on ] && echo "[[EXTENSION]]=\"$EXTENSION\""
# Unpacker
- UNPACKER=`validate_parameter "$UNPACKER" "UNPACKER" "tar"` || mkbuild_error $ERROR_CONSTRUCTION "UNPACKER"
+ UNPACKER=`validate_parameter "$UNPACKER" "UNPACKER" "tar"` || handle_error $ERROR_MKBUILD_CONSTRUCTION "UNPACKER"
[ $VERBOSE -eq $on ] && echo "[[UNPACKER]]=\"$UNPACKER\""
# Unpacker flags
- [ "$UNPACKER"=="tar" ] && STR_MOUNT="--no-same-owner --no-same-permissions -xvf" || STRING=""
- UNPACKER_FLAGS=`validate_parameter "$UNPACKER_FLAGS" "UNPACKER FLAGS" "$STR_MOUNT"` || mkbuild_error $ERROR_CONSTRUCTION "UNPACKER FLAGS"
+ [ "$UNPACKER" == "tar" ] && STR_MOUNT="--no-same-owner --no-same-permissions -xvf" || STR_MOUNT=""
+ UNPACKER_FLAGS=`validate_parameter "$UNPACKER_FLAGS" "UNPACKER FLAGS" "$STR_MOUNT"` || handle_error $ERROR_MKBUILD_CONSTRUCTION "UNPACKER FLAGS"
[ $VERBOSE -eq $on ] && echo "[[UNPACKER_FLAGS]]=\"$UNPACKER_FLAGS\""
# Build archteture
@@ -738,7 +714,7 @@ else
# 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"
+ SRC_NAME=`validate_parameter "$SRC_NAME" "SOURCE NAME" "$STR_MOUNT"` || handle_error $ERROR_MKBUILD_CONSTRUCTION "SOURCE NAME"
[ $VERBOSE -eq $on ] && echo "[[SOURCE NAME]]=\"$SRC_NAME\""
# Package name
@@ -748,7 +724,7 @@ else
# Version
STR_MOUNT=`echo $SOURCE_NAME | sed -r 's/(.*)-(.*)\.(.*\..*)$/\2/'`
- VERSION=`validate_parameter "$VERSION" "VERSION" $STR_MOUNT` || mkbuild_error $ERROR_CONSTRUCTION "VERSION"
+ VERSION=`validate_parameter "$VERSION" "VERSION" $STR_MOUNT` || handle_error $ERROR_MKBUILD_CONSTRUCTION "VERSION"
[ $VERBOSE -eq $on ] && echo "[[VERSION]]=\"$VERSION\""
# Construction source name string
@@ -760,10 +736,11 @@ else
[ $VERBOSE -eq $on ] && echo "SOURCE_NAME=\"$SOURCE_NAME\""
# Decompressor program and test flag
- DECOMPRESSOR=`validate_parameter "$DECOMPRESSOR" "DECOMPRESSOR" ""` || decompress_find
+ DECOMPRESSOR=`validate_parameter "$DECOMPRESSOR" "DECOMPRESSOR" ""`
+ [ -z $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"
+ DECOMPRESSOR_TEST_FLAG=`validate_parameter "$DECOMPRESSOR_TEST_FLAG" "DECOMPRESSOR TEST FLAG" ""` || handle_error $ERROR_MKBUILD_CONSTRUCTION "DECOMPRESSOR TEST FLAG"
[ $VERBOSE -eq $on ] && echo "[[DECOMPRESSOR TEST FLAG]]=\"$DECOMPRESSOR_TEST_FLAG\""
# Documentations list
@@ -780,6 +757,7 @@ else
# Number of jobs
NUMJOBS=`validate_parameter "$NUMJOBS" "NUMBER OF JOBS" ""`
+ [ `is_number $NUMJOBS` ] && NUMJOBS="-j${NUMJOBS}"
[ $VERBOSE -eq $on ] && echo "[[NUMBER OF JOBS]]=\"$NUMJOBS\""
# Make slack-required file
@@ -790,8 +768,13 @@ else
MODEL=`validate_parameter "$MODEL" "SLACKBUILD MODEL" "generic.mkSlackBuild"`
[ $VERBOSE -eq $on ] && echo "[[SLACKBUILD MODEL]]=\"$MODEL\""
- #
- # Start build SlackBuild
+ # SlackBuild path
+ SLACKBUILD_PATH=`validate_parameter "$SLACKBUILD_PATH" "SLACKBUILD PATH" ""`
+ [ $VERBOSE -eq $on ] && echo "[[SLACKBUILD PATH]]=\"$SLACKBUILD_PATH\""
+
+ #--------------------------------------------------------------
+ #- Start build SlackBuild -
+ #--------------------------------------------------------------
[ $VERBOSE -eq $on ] && echo -e "\nStart SlackBuild make"
SLACKBUILD=${PKG_NAME}.SlackBuild
SLACKBUILD_TEMP=$SLACKBUILD.tmp
@@ -829,7 +812,10 @@ else
change_others_parameters
# Commit SlackBuild
- [ $COMMIT -eq $on ] && commit_slackbuild
+ [ $COMMIT_SLACKBUILD -eq $on ] && commit_slackbuild
+
+ # Commit mkbuild
+ [ $COMMIT_MKBUILD -eq $on ] && commit_mkbuild
fi
# Clear temporary files