aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rwxr-xr-xutils/mkslackbuild46
1 files changed, 32 insertions, 14 deletions
diff --git a/utils/mkslackbuild b/utils/mkslackbuild
index 6a28520..daefef0 100755
--- a/utils/mkslackbuild
+++ b/utils/mkslackbuild
@@ -9,7 +9,7 @@
# Slackbuilds são scripts utilizados no Slackware para gerar
# pacotes tgz.
#
-# Version 0.9.0
+# Version 0.9.1
#
#--------------------------------------------------------------------
# Functions
@@ -23,6 +23,9 @@ function config_help()
# Exit function
function mk_exit()
{
+ [ ! -z $SLACKBUILD ] && [ -e $SLACKBUILD ] && echo "SlackBuild save in $SLACKBUILD"
+ [ ! -z $MKSLACKBUILD ] && [ -e $MKSLACKBUILD ] && echo "mkSlackBuild save in $SLACKBUILD"
+
clean_all
exit $1
}
@@ -275,7 +278,13 @@ function edit_docfiles()
SELECTDOCS=`eval "dialog --stdout --separate-output --backtitle \"mkSlackBuild $PROG_VERSION [$MK_PKGNAME]\" --title \" Documentations files \" --checklist \"Select documentation files below:\" 20 45 13 $DOCMENU"`
fi
- MK_DOCFILES="$SELECTDOCS"
+ MK_DOCFILES="`echo $SELECTDOCS | sed ':i; N; s/\n/ /; bi'`"
+}
+
+# Edit compiler architecture
+function edit_arch()
+{
+ MK_ARCH=`dialog --stdout --backtitle "mkSlackBuild documentation files below:" --inputbox "Set an architecture to compiler:" $MK_ARCH`
}
#--------------------------------------------------------------------
@@ -294,12 +303,13 @@ function change_strings()
# Build initial sections
function start_build()
{
+ change_strings "AUTHOR" "$MK_AUTHOR"
+ change_strings "AUTHOR INITIALS" $MK_AUTHOR_INITIALS
change_strings "SOURCE NAME" "${MK_SRCNAME//.$MK_EXTENSION}"
change_strings "PROGRAM NAME" "$MK_PKGNAME"
change_strings "PACKAGE NAME" "$MK_PKGNAME"
change_strings "PROGRAM URL" "$MK_URL"
- change_strings "AUTHOR" "$MK_AUTHOR"
- change_strings "AUTHOR INITIALS" $MK_AUTHOR_INITIALS
+ change_strings "ARCH" "$MK_ARCH"
change_strings "VERSION" $MK_VERSION
change_strings "SOURCE EXTENSION" $MK_EXTENSION
change_strings "DOWNLOAD FOLDER URL" "`dirname $MK_URL`"
@@ -311,7 +321,7 @@ function start_build()
# Mount final SlackBuild
function mount_slackbuild()
{
- dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --infobox "SlackBuild save..." 5 30
+ dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --infobox "SlackBuild save in $SLACKBUILD" 5 30
rm $SLACKBUILD 2>/dev/null
for i in `seq 0 $MAXSECTION`; do
@@ -367,6 +377,9 @@ function create_slackbuild()
# Package name, version and extension
edit_pkgname
+ # Compile arch
+ edit_arch
+
# Get source file
dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \
--yesno " Download $MK_SRCNAME? " 5 50
@@ -393,6 +406,9 @@ function create_slackbuild()
# Slackbuild script name
SLACKBUILD=$MK_SLACKBUILDDIR/$MK_PKGNAME.Slackbuild
+ # mkSlackBuild script name
+ MKSLACKBUILD=$BASEDIR/$MK_PKGNAME.mkslackbuild
+
mk_slackdesc > slackdesc_$MK_PKGNAME.mkbuild
# Edit builds sections
@@ -405,35 +421,35 @@ function create_slackbuild()
# Open mkslackbuild
function open_mkslackbuild()
{
- MKFILE=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \
+ MKSLACKBUILD=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \
--title " Select source file name (use spaces to select): " \
--fselect "$BASEDIR/" 10 70`
[ $? -ne 0 ] && mk_exit 1
- if [ -f $MKFILE ]; then
+ if [ -f $MKSLACKBUILD ]; then
# Start defaults variables
- source $MKFILE
+ source $MKSLACKBUILD
# SlackBuild scrit name
SLACKBUILD=$MK_SLACKBUILDDIR/$MK_PKGNAME.Slackbuild
# Create files sections
- make_file_sections $MKFILE
+ make_file_sections $MKSLACKBUILD
# Main-Menu
edit_menu
else
dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \
- --msgbox "$MKFILE most be a file" 0 0
+ --msgbox "$MKSLACKBUILD most be a file" 0 0
fi
}
# Save mkSlackbuild
function save_mkslackbuild()
{
- dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --infobox "mkSlackBuild save..." 5 30
+ dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --infobox "mkSlackBuild save in $MKSLACKBUILD" 5 30
- MKSLACKBUILD=$BASEDIR/$MK_PKGNAME.mkslackbuild
+# MKSLACKBUILD=$BASEDIR/$MK_PKGNAME.mkslackbuild
rm $MKSLACKBUILD 2>/dev/null
echo '#!/bin/bash' > $MKSLACKBUILD
@@ -498,8 +514,8 @@ function edit_menu()
# Start Program
#--------------------------------------------------------------------
#
-set +x
-PROG_VERSION=0.9.0
+set +x # turn off debug
+PROG_VERSION=0.9.1
LANG=us
BASEDIR=`pwd`
AUX_TMP=`mktemp -p /tmp/ aux_tmp.XXXXXX`
@@ -528,6 +544,7 @@ MK_AUTHOR_INITIALS="[[AUTHOR INITIALS]]"
MK_EDITOR=[[EDITOR]]
MK_LIMITRATE="100k"
MK_SOURCEDIR=\`pwd\`
+MK_ARCH="i468"
#MK_URL="ftp://localhost"
#MK_SLACKBUILDDIR=/slackbuild-dir
EOF
@@ -536,6 +553,7 @@ fi
source ~/.mkslackbuild
MK_SOURCEDIR=${MK_SOURCEDIR:=$BASEDIR}
MK_SLACKBUILDDIR=${MK_SLACKBUILDDIR:=$BASEDIR}
+MK_ARCH=${MK_ARCH:="i486"}
# Config Author
if [ "$MK_AUTHOR" = "[[AUTHOR NAME]]" ]; then