From 0d5e3cee3bacba5e41898e599f189bb6ee0381c5 Mon Sep 17 00:00:00 2001 From: rudson Date: Sun, 21 Oct 2007 23:26:09 +0000 Subject: atualizações ao mkbuild e ao modelo .mkSlackBuild MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@450 04377dda-e619-0410-9926-eae83683ac58 --- trunk/mkbuild/generic.mkSlackBuild | 20 ++++++------ trunk/mkbuild/model.mkbuild | 30 +++++++++--------- trunk/mkbuild/sample-Pyrex-large.mkbuild | 28 ++++++++--------- trunk/mkbuild/sample-Pyrex-small.mkbuild | 10 +++++- trunk/src/mkbuild | 53 +++++++++++++++++--------------- 5 files changed, 77 insertions(+), 64 deletions(-) diff --git a/trunk/mkbuild/generic.mkSlackBuild b/trunk/mkbuild/generic.mkSlackBuild index 7c8620c..777deac 100644 --- a/trunk/mkbuild/generic.mkSlackBuild +++ b/trunk/mkbuild/generic.mkSlackBuild @@ -4,7 +4,7 @@ ## Version 0.8.1 - Luis ( luis at riseup d0t net) ## ################################################### - all + off #!/bin/bash # # [[PROGRAM NAME]].SlackBuild is free software; you can redistribute @@ -36,7 +36,7 @@ elif [ -f /etc/slackbuildrc ]; then fi - all + off # Set variables CWD="$(pwd)" SRC_NAME="[[SOURCE NAME]]" @@ -55,7 +55,7 @@ CONF_OPTIONS=${CONF_OPTIONS:="[[OTHER CONFIGURE ARGS]]"} NUMJOBS=${NUMJOBS:="[[NUMBER OF JOBS]]"} - all + off # Set system libraries' path and optmization flags based on $ARCH LIBDIR="$PREFIX/lib" @@ -81,7 +81,7 @@ ERROR_TAR=37; ERROR_MKPKG=38; ERROR_GPG=39 ERROR_PATCH=40; ERROR_VCS=41; ERROR_MKDIR=42 - all + off # Clean up any leftovers of previous builds rm -rf "$PKG_SRC" 2> /dev/null rm -rf "$PKG" 2> /dev/null @@ -136,14 +136,14 @@ fi gpg --verify "$SRC_DIR/$SRC.sig" "$SRC_DIR/$SRC" || exit $ERROR_GPG - all + off # Untar cd "$TMP" tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR cd "$PKG_SRC" - off + off # Patch source patches="[[PATCH FILES]] $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff @@ -155,7 +155,7 @@ for patch in $patches; do patch -Np[[NUMBER OF PREFIX SLASHES TO STRIP]] < "$CWD/patches/$patch" || exit $ERROR_PATCH fi done - + off # Configure @@ -165,12 +165,12 @@ CFLAGS="$SLKCFLAGS" \ --prefix="$PREFIX" --libdir="$LIBDIR" $CONF_OPTIONS || exit $ERROR_CONF - all + off # Compile make $NUMJOBS || exit $ERROR_MAKE - all + off # Install make install DESTDIR="$PKG" || exit $ERROR_INSTALL @@ -256,7 +256,7 @@ config path/to/config_file.new EOSCRIPT - all + off # Build the package cd "$PKG" makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG diff --git a/trunk/mkbuild/model.mkbuild b/trunk/mkbuild/model.mkbuild index 02877f8..3fb88c0 100644 --- a/trunk/mkbuild/model.mkbuild +++ b/trunk/mkbuild/model.mkbuild @@ -91,33 +91,33 @@ #--------------------- # SlackBuild Sections #--------------------- -# Default enable sections: +# Default sections: # head, set_variables, slkflags, start_structure, untar_source, # make_package, install_package, build_package # Warning: don't remove '#>>' and "#<<" tags. #>> Start SlackBuild Sections: -#all: head + on: head on: slackbuildrc -#all: set_variables + on: set_variables on: slkflags on: error_codes -#all: start_structure + on: start_structure on: download_source -#off: md5sum_download_and_check_0 -#off: md5sum_download_and_check_1 -#off: gpg_signature_check -#all: untar_source -#off: path_source +off: md5sum_download_and_check_0 +off: md5sum_download_and_check_1 +off: gpg_signature_check + on: untar_source +off: patch_source on: configure -#all: make_package -#all: install_package + on: make_package + on: install_package on: strip_binaries -#off: compress_manpages -#off: compress_info_files +off: compress_manpages +off: compress_info_files on: install_documentation on: slackdesc -#off: postinstall_script -#all: build_package +off: postinstall_script + on: build_package on: clean_builds #<< End SlackBuild Sections diff --git a/trunk/mkbuild/sample-Pyrex-large.mkbuild b/trunk/mkbuild/sample-Pyrex-large.mkbuild index 4001238..bbcf7e6 100644 --- a/trunk/mkbuild/sample-Pyrex-large.mkbuild +++ b/trunk/mkbuild/sample-Pyrex-large.mkbuild @@ -108,33 +108,33 @@ #--------------------- # SlackBuild Sections #--------------------- -# Default enable sections: +# Default sections: # head, set_variables, slkflags, start_structure, untar_source, # make_package, install_package, build_package # Warning: don't remove '#>>' and "#<<" tags. #>> Start SlackBuild Sections: -#all: head + on: head on: slackbuildrc -#all: set_variables + on: set_variables on: slkflags on: error_codes -#all: start_structure + on: start_structure on: download_source on: md5sum_download_and_check_0 -#off: md5sum_download_and_check_1 -#off: gpg_signature_check -#all: untar_source -#off: path_source +off: md5sum_download_and_check_1 +off: gpg_signature_check + on: untar_source +off: path_source on: configure -#all: make_package -#all: install_package + on: make_package + on: install_package on: strip_binaries -#off: compress_manpages -#off: compress_info_files +off: compress_manpages +off: compress_info_files on: install_documentation on: slackdesc -#off: postinstall_script -#all: build_package +off: postinstall_script + on: build_package on: clean_builds #<< End SlackBuild Sections diff --git a/trunk/mkbuild/sample-Pyrex-small.mkbuild b/trunk/mkbuild/sample-Pyrex-small.mkbuild index 83dfca9..5dcd4b4 100644 --- a/trunk/mkbuild/sample-Pyrex-small.mkbuild +++ b/trunk/mkbuild/sample-Pyrex-small.mkbuild @@ -23,19 +23,27 @@ [[DOWNLOAD FOLDER URL]]="http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/Pyrex-0.9.5.1a.tar.gz" # -# Default enable sections: +# Default sections: # head, set_variables, slkflags, start_structure, untar_source, # make_package, install_package, build_package # Warning: don't remove '#>>' and "#<<" tags. #>> Start SlackBuild Sections: + on: head on: slackbuildrc + on: set_variables on: slkflags on: error_codes + on: start_structure on: download_source + on: md5sum_download_and_check_0 + on: untar_source on: configure + on: make_package + on: install_package on: strip_binaries on: install_documentation on: slackdesc + on: build_package on: clean_builds #<< End SlackBuild Sections diff --git a/trunk/src/mkbuild b/trunk/src/mkbuild index 172bc9c..8572e77 100755 --- a/trunk/src/mkbuild +++ b/trunk/src/mkbuild @@ -18,8 +18,8 @@ # # Based in model generic.SlackBuild of Luiz # -# Version 1.0.4 -PROG_VERSION=1.0.4 +# Version 1.0.5 +PROG_VERSION=1.0.5 PROG_NAME=`basename $0` #-------------------------------------------------------------------- @@ -139,16 +139,10 @@ function set_parameters { # 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 + # Parameters analyze + while [ "$1" ]; do + case $1 in '-c'|'--commit') # Commit directory COMMIT=$on @@ -156,8 +150,9 @@ function set_parameters { '-n'|'--new') # New mkbuild configure file let i++ - MKBUILD_NAME=${ALL_PAR[$i]} + MKBUILD_NAME=$2 [ ${MKBUILD_NAME:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR "--new " + shift ;; '-d'|'--debug') # Debug mode @@ -178,72 +173,82 @@ function set_parameters { '-a'|'--author') # Enter with author name let i++ - AUTHOR=${ALL_PAR[$i]} + AUTHOR=$2 [ ${AUTHOR:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR AUTHOR + shift ;; '-ai'|'--author_initials') # Enter with author name let i++ - AUTHOR_INITIALS=${ALL_PAR[$i]} + AUTHOR_INITIALS=$2 [ ${AUTHOR_INITIALS:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR AUTHOR_INITIALS + shift ;; '-cs'|'--const_string') # Enter with construction source name string let i++ - CONST_STRING=${ALL_PAR[$i]} + CONST_STRING=$2 [ ${CONST_STRING:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR CONST_STRING + shift ;; '-md'|'--model') # Enter with SlackBuild model let i++ - MODEL=${ALL_PAR[$i]} + MODEL=$2 [ ${MODEL:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR MODEL + shift ;; '-j'|'--jobs') # Enter with SlackBuild model let i++ - NUMJOBS=${ALL_PAR[$i]} + NUMJOBS=$2 [ ${NUMJOBS:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR NUMJOBS [ ! is_number $NUMJOBS ] && mkbuild_error $ERROR_INPUT_PAR NUMJOBS NUMJOBS="-j$NUMJOBS" + shift ;; '--prefix') # Enter with SlackBuild model let i++ - PREFIX=${ALL_PAR[$i]} + PREFIX=$2 [ ${PREFIX:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR PREFIX + shift ;; '-pn'|'--pkg_name') # Enter with package name let i++ - PKG_NAME=${ALL_PAR[$i]} + PKG_NAME=$2 [ ${PKG_NAME:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR PKG_NAME + shift ;; '-pv'|'pkg_version') # Enter with package version let i++ - VERSION=${ALL_PAR[$i]} + VERSION=$2 [ ${VERSION:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR VERSION + shift ;; '-sn'|'--src_name') # Enter with source name let i++ - SRC_NAME=${ALL_PAR[$i]} + SRC_NAME=$2 [ ${SRC_NAME:0:1} = '-' ] && mkbuild_error $ERROR_INPUT_PAR SRC_NAME + shift ;; '-u'|'--url') # Enter with url address let i++ - URL=${ALL_PAR[$i]} + URL=$2 [ ${URL:0:1} = '-' ] && mkbuild_error $ERROR_INPUT_PAR URL + shift ;; *) # mkbuild input file - MK_INPUT_FILE="${PAR//.mkbuild}.mkbuild" + MK_INPUT_FILE="${1//.mkbuild}.mkbuild" [ ! -e $MK_INPUT_FILE ] && mkbuild_error $ERROR_FILE_NOT_FOUND $MK_INPUT_FILE ;; esac - let i++ + shift done } -- cgit v1.2.3