aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>2007-11-18 23:04:16 +0000
committerrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>2007-11-18 23:04:16 +0000
commit0fb54dd941d469fc8a073e1c200d185042b67a82 (patch)
treeb518d09a083f0a6d75e32dccb8ce513d681e250b
parentf7e8eae3eccddf31033841aeffd05ec066c55a32 (diff)
downloadsimplepkg-0fb54dd941d469fc8a073e1c200d185042b67a82.tar.gz
simplepkg-0fb54dd941d469fc8a073e1c200d185042b67a82.tar.bz2
mkbuild-1.1.3: correção a UNPACKER e UNPACKER_FLAGS
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@453 04377dda-e619-0410-9926-eae83683ac58
-rw-r--r--trunk/conf/simplepkg.conf.new3
-rwxr-xr-xtrunk/src/mkbuild77
2 files changed, 71 insertions, 9 deletions
diff --git a/trunk/conf/simplepkg.conf.new b/trunk/conf/simplepkg.conf.new
index 0ec81e7..b5eb5e7 100644
--- a/trunk/conf/simplepkg.conf.new
+++ b/trunk/conf/simplepkg.conf.new
@@ -132,6 +132,9 @@ SLACKBUILDS_DIR="/var/simplepkg/slackbuilds"
# Set binaries default repository directory
MAKEPKG_REPOS="/var/simplepkg/repos"
+# Set mkbuild default repository directory
+MKBUILD_REPOS="/var/simplepkg/mkbuild"
+
# Set sources default directory
SOURCE_DIR="/var/simplepkg/sources"
diff --git a/trunk/src/mkbuild b/trunk/src/mkbuild
index 99f631e..e0e6d7b 100755
--- a/trunk/src/mkbuild
+++ b/trunk/src/mkbuild
@@ -18,8 +18,8 @@
#
# Based in model generic.SlackBuild of Luiz
#
-# Version 1.1.2
-PROG_VERSION=1.1.2
+# Version 1.1.3
+PROG_VERSION=1.1.3
PROG_NAME=`basename $0`
#--------------------------------------------------------------------
@@ -65,7 +65,7 @@ DESCRIPTION
-h, --help
this help mesage
-c, --commit
- commit SlackBuilds in local svn tree
+ commit SlackBuilds in local svn SlackBuild tree
-n, --new <mkbuild_name>
start a new mkbuild configure file
-v, --version
@@ -310,6 +310,8 @@ function start_build {
edit_file "OTHER CONFIGURE ARGS" "$OPTIONS" $1
edit_file "DOCUMENTATION FILES" "$DOCFILES" $1
edit_file "PREFIX" "$PREFIX" $1
+ edit_file "UNPACKER" "$UNPACKER" $1
+ edit_file "UNPACKER FLAGS" "$UNPACKER_FLAGS" $1
edit_file_full "\$EXTENSION" "$EXTENSION" $1
}
@@ -461,6 +463,8 @@ function get_slackbuild_path {
}
+# ----------------------------------------------------------------
+# ------------------- svn functions ------------------------------
function commit_slackbuild {
# Commit SlackBuild in local Slack.Sarava tree
@@ -506,6 +510,46 @@ function commit_slackbuild {
cd $WORK
}
+function commit_mkbuild {
+
+ # Commit mkbuild in local mkbuild Slack.Sarava tree
+ if [ $UID -ne 0 ]; then
+ echo "Only root can commit mkbuild..."
+ return 1
+ fi
+
+ # check mkbuild directory
+ [ ! -e $MKBUILD_REPOS ] && createpkg --sync
+
+ # Get mkbuild path in parameter file
+ MKBUILD_PATH=`validate_parameter "$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
+ fi
+
+ # Get SlackBuild path in gentoo-portage tree
+ if [ -z $MKBUILD_PATH ]; then
+ # Mount mkbuild path
+ [ $VERBOSE -eq $on ] && echo -e "\nFind mkbuild PATH in Slack.Sarava tree..."
+ AUX=`get_slackbuild_path`
+ [ ! -z $AUX ] && MKBUILD_PATH="`dirname $AUX | tr - /`/`basename $AUX`" || MKBUILD_PATH="others/unclassified/$PKG_NAME"
+ fi
+
+ # change to mkbuilds directory
+ cd $MKBUILDS_DIR/
+
+ # Add mkbuild scripts
+ # check path
+ [ ! -e $MKBUILD_PATH ] && svn_mkdir $MKBUILD_PATH
+ # add SlackBuild
+ svn_add $MKBUILD_NAME $MKBUILD_PATH
+
+ cd $WORK
+}
+
function svn_mkdir {
# svn make directory
@@ -537,6 +581,9 @@ function svn_add {
fi
}
+# ----------------------------------------------------------------
+# ------------------- general functions --------------------------
+
function is_number {
# Check if $1 is a number
@@ -586,20 +633,30 @@ function decompress_find {
esac
}
+function load_parameters {
+
+ # Load Createpkg parameters
+ MKBUILD_REPOS="`eval_parameter MAKEPKG_REPOS /var/simplaret/repos`"
+ SLACKBUILDS_DIR="`eval_parameter SLACKBUILDS_DIR /var/simplaret/slackbuilds`"
+
+ COLOR_MODE="`eval_parameter COLOR_MODE none`"
+}
+# ----------------------------------------------------------------
+
#=============================
# Main Program
#=============================
#-----------------------------
# Common functions
-COMMON="/usr/libexec/simplepkg/common.sh"
+COMMON_SH="/usr/libexec/simplepkg/common.sh"
SIMPLEPKG_CONF="/etc/simplepkg/simplepkg.conf"
WORK=`pwd`
LANG=en_US
-if [ -f "$COMMON" ]; then
- source $COMMON
+if [ -f "$COMMON_SH" ]; then
+ source $COMMON_SH
else
- echo "error: file $COMMON found, check your $BASENAME installation"
+ echo "error: file $COMMON_SH not found. Check your $BASENAME installation"
mkbuild_error 0
fi
@@ -610,8 +667,10 @@ set_constants
COMMIT=$off
# Set verbose off
VERBOSE=$off
-# Createpkg and mkbuild section
-SLACKBUILDS_DIR="`eval_parameter SLACKBUILDS_DIR /var/slackbuilds`"
+
+# Load /etc/simplepkg/simplepkg.conf parameters
+load_parameters
+
# Auxiliar file
AUX_TMP=/tmp/mkbuild_tmp.$RANDOM
# Derectory to SlackBuild models