# SlackBuilds são scripts utilizados no Slackware para gerar
# pacotes tgz.
#
-# Version 0.9.3
-PROG_VERSION=0.9.3
+# Version 0.9.4
+PROG_VERSION=0.9.4
#--------------------------------------------------------------------
# Functions
Program options:
-h, --help
this help mesage
- -s, --show
- show output files
+ -c, --commit
+ commit slackbuild
-v, --version
program version
# get parameter[i]
PAR=${ALL_PAR[$i]}
case $PAR in
+ '-c'|'--commit')
+ # Commit directory
+ COMMIT=1
+ ;;
'-d'|'--debug')
# Debug mode
set -x
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
function make_slack_required {
# Build slack-required file
- rm slack-required 2>/dev/null
+ [ -e slack-required ] && mv slack-required slack-required.old
[ -z "$SLACK_REQUIRED" ] && return 0
echo -e "# Dependency list to broffice\n#\n# dependency [condition] [version]]" > slack-required
done
}
+function commit_slackbuild {
+
+ AUX=`lynx -dump http://gentoo-portage.com/Search?search=$PKG_NAME | sed -n '/Results:/,+1 { /Results:/ b ; p }' | head --lines=1 | tr -d " "`
+ [ -z $AUX ] && echo $SLACKBUILD path not found! && return 0
+
+ SLACKBUILD_PATH="`dirname $AUX | tr - /`/`basename $AUX`"
+
+ if [ -e $SLACKBUILDS_DIR/$SLACKBUILD_PATH/$SLACKBUILD ]; then
+ echo "$SLACKBUILD_PATH/$SLACKBUILD exist!"
+ else
+ cp $SLACKBUILD $SLACKBUILDS_DIR/$SLACKBUILD_PATH/
+ echo "copy $SLACKBUILD to $SLACKBUILDS_DIR/$SLACKBUILD_PATH/"
+ fi
+
+ if [ -e $SLACKBUILDS_DIR/$SLACKBUILD_PATH/slack-required ]; then
+ echo "$SLACKBUILD_PATH/slack-required exist!"
+ else
+ cp slack-required $SLACKBUILDS_DIR/$SLACKBUILD_PATH/
+ echo "copy slack-required to $SLACKBUILDS_DIR/$SLACKBUILD_PATH/"
+ fi
+}
+
+
#=============================
# Main Program
#=============================
+#-----------------------------
+# Common functions
+COMMON="/usr/libexec/simplepkg/common.sh"
+SIMPLEPKG_CONF="/etc/simplepkg/simplepkg.conf"
+
+if [ -f "$COMMON" ]; then
+ source $COMMON
+else
+ echo "error: file $COMMON found, check your $BASENAME installation"
+ mk_exit 0
+fi
+
+# createpkg and mkbuild section
+SLACKBUILDS_DIR="`eval_parameter SLACKBUILDS_DIR /var/slackbuilds`"
+#MAKEPKG_REPOS="`eval_parameter MAKEPKG_REPOS /var/simplaret/binaries`"
+#-----------------------------
+
# Start variables
DOWNLOAD_SOURCE=0 # desable download source
# Auxiliar file
# Clear temporary files
clear_files
+
+[ $COMMIT -eq 1 ] && commit_slackbuild
+