diff options
author | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2007-02-11 14:29:54 +0000 |
---|---|---|
committer | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2007-02-11 14:29:54 +0000 |
commit | f9a8dfcd51e481a49355d94a3e74f2762519378f (patch) | |
tree | 948f0382081bd2eb8b1b5458a9661b67a090e795 /utils | |
parent | fef31cbc9988ead081aaec587222b44ed524b6fd (diff) | |
download | simplepkg-f9a8dfcd51e481a49355d94a3e74f2762519378f.tar.gz simplepkg-f9a8dfcd51e481a49355d94a3e74f2762519378f.tar.bz2 |
changed repository layout to trunk/, tags/ and branches/ scheme
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@181 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/add-slack-required | 45 | ||||
-rwxr-xr-x | utils/merge-template | 27 | ||||
-rwxr-xr-x | utils/mkslackbuild | 618 | ||||
-rwxr-xr-x | utils/searchpkg | 24 |
4 files changed, 0 insertions, 714 deletions
diff --git a/utils/add-slack-required b/utils/add-slack-required deleted file mode 100755 index d402c52..0000000 --- a/utils/add-slack-required +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# add slack-required files in an existing repository -# by rhatto at riseup.net -# - -slackbuild="/path/to/slackbuilds" -repository="/path/to/packages" - -COMMON="/usr/libexec/simplepkg/common.sh" -BASENAME="`basename $0`" - -if [ ! -d "$slackbuild" ] || [ ! -d "$repository" ]; then - echo $BASENAME: folder not found: $slackbuild or $repository - exit 1 -fi - -# we need the function package_name -if [ -f "$COMMON" ]; then - source $COMMON -else - echo "error: file $COMMON found, check your $BASENAME installation" - exit 1 -fi - -function search_and_copy_slackbuild { - - if [ -f "$1" ]; then - echo copying `basename $1` to `dirname $package`/$pack.slack-required - cp $1 `dirname $package`/$pack.slack-required - svn add `dirname $package`/$pack.slack-required 2> /dev/null - fi - -} - -for package in `find $repository/ -name *tgz`; do - pack="`package_name $package`" - for build_script in `find $slackbuild/ -name $pack.SlackBuild`; do - - search_and_copy_slackbuild `dirname $build_script`/slack-required - search_and_copy_slackbuild `dirname $build_script`/$pack.slack-required - - done -done - diff --git a/utils/merge-template b/utils/merge-template deleted file mode 100755 index b3eaf5c..0000000 --- a/utils/merge-template +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# - -# -# tip: to assemble a template from all slack tagfiles: -# -# for diskset in a ap d e f k l n t tcl x xap y; do -# lynx -dump http://slack.sarava.org/slackware/slackware-10.2/slackware/$diskset/tagfile >> slack.template -# done -# - -if [ -z "$2" ]; then - echo "usage: `basename $0` <template> <base-template>" - exit 1 -elif [ ! -f "$1" ] || [ ! -f "$2" ]; then - echo error: $1 ou $2 not found - exit 1 -fi - -cp $2 $1.new - -cat $1 | while read line; do - pack="`echo $line | cut -d : -f 1`" - if ! grep -qe "^$pack:" $2; then - echo $line >> $1.new - fi -done diff --git a/utils/mkslackbuild b/utils/mkslackbuild deleted file mode 100755 index daefef0..0000000 --- a/utils/mkslackbuild +++ /dev/null @@ -1,618 +0,0 @@ -#!/bin/bash -x -# -# Script para gerar Slackbuild -# Por Rudson R. Alves -# -# Este script auxilia a criação de SlackBuilds, com o modelo -# do Luiz do Sarava Linux -# -# Slackbuilds são scripts utilizados no Slackware para gerar -# pacotes tgz. -# -# Version 0.9.1 -# -#-------------------------------------------------------------------- -# Functions -#-------------------------------------------------------------------- -# Show ./configure --help -function config_help() -{ - dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --title " Check ./configure --help " --textbox $CONFIG_HELP 20 75 -} - -# 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 -} - -# Clear all temp files -function clean_all() -{ - rm $AUX_TMP 2>/dev/null - rm $SLACKDESC_TMP 2>/dev/null - if [ ! -z $MK_PKGNAME ]; then - rm $BASEDIR/*_$MK_PKGNAME.mkbuild 2>/dev/null - [ -e /tmp/$MK_PKGNAME ] && rm -rf /tmp/$MK_PKGNAME - [ ! -z $CONFIG_HELP ] && rm $CONFIG_HELP 2>/dev/null - fi -} - -# Print from file $2, the lines betwen <$1> and </$1> lines -function print_lines() -{ - [ $# -ne 2 ] && mk_exit 1 - eval "sed -n '/<$1>/,/<\/$1>/ { /<$1>/ b; /<\/$1>/ b; p; }' $2" -} - -# Print from file $2, the lines betwen <$1> and $2 lines -function print_lines_to() -{ - [ $# -ne 3 ] && mk_exit 1 - eval "sed -n '/<$1>/,/$2/ { /<$1>/ b; /$2/ b; p; }' $3" -} - -# Make slack-desc file -function mk_slackdesc() -{ - print_lines_to "slackdesc" "\[\[" $SB_MODEL - echo -n $MK_PKGNAME | tr [a-z\-] " " - echo -n "|-----handy-ruler" - let N=18+${#MK_PKGNAME} - for i in `seq $N $SLACKDESC_LEN`; do - echo -n "-" - done - echo -en "|\n" - - for i in `seq 1 11`; do - echo -en "$MK_PKGNAME: \n" - done - print_lines "slackdesc" $SB_MODEL | sed '1,/\]\]/ d' -} - -# Get label status from Slackbuild model -function get_status() -{ - [ $# -ne 2 ] && mk_exit 1 - eval "sed -n '/<$1>/ p' $2 | sed 's/.*> \([a-z]\+\)/\1/'" -} - -# Get status from edited SlackBuild -# input: $1 -> section name -# output: section status and section number -function mk_status() -{ - for i in `seq 0 $MAXSECTION`;do - if [ "${SECTION_NAME[i]}" = "$1" ]; then - echo "${SECTION_FLAG[i]} $i" - return 0 - fi - done - return 1 -} - -# Edit file $3, by change string [[$1]] to $2 -function edit_file() -{ - local STR_OLD - local STR_NEW - - [ $# -ne 3 ] && mk_exit 1 - STR_OLD=$( echo $1 | sed 's/\//\\\//g' ) - STR_NEW=$( echo $2 | sed 's/\//\\\//g' ) - eval "sed 's/\[\[$STR_OLD\]\]/$STR_NEW/' $3 > $AUX_TMP" - mv $AUX_TMP $3 -} - -# Unpackage source -function unpkg_source() -{ - dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ - --infobox "Uncompress source in /tmp/$MK_PKGNAME. Wait" 3 45 - [ $? -ne 0 ] && mk_exit 0 - mkdir /tmp/$MK_PKGNAME/ 2>/dev/null - tar xvf $MK_SOURCE -C /tmp/$MK_PKGNAME/ 1>/dev/null - [ $? -ne 0 ] && mk_exit 1 - MK_TMPSRC="/tmp/$MK_PKGNAME/`ls /tmp/$MK_PKGNAME/`" -} - -# Download source -function download_url() -{ - clear - wget --limit-rate=$MK_LIMITRATE $MK_URL -P $MK_SOURCEDIR/ - if [ $? -ne 0 ]; then - echo "URL error" - return 0 - fi - MK_SOURCE=$MK_SOURCEDIR/$MK_SRCNAME -} - -# Select source file -function select_source() -{ - MK_SOURCE=$BASEDIR - while [ ! -f $MK_SOURCE ]; do - MK_SOURCE=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ - --title " Select source file name (use spaces to select): " --fselect "$MK_SOURCE" 10 70` - [ $? -ne 0 ] && mk_exit - if [ ! -f $MK_SOURCE ]; then - MK_SOURCE="$MK_SOURCE/" - fi - done - - MK_SRCNAME=`basename $MK_SOURCE` - MK_SOURCEDIR=`dirname $MK_SOURCE` -} - -#-------------------------------------------------------------------- -# Edit functions -#-------------------------------------------------------------------- -# Edit authot, Initials and editor -function edit_author() -{ - MK_AUTHOR=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with author complite name:" 8 60 "$MK_AUTHOR"` - edit_file "AUTHOR NAME" "$MK_AUTHOR" ~/.mkslackbuild - MK_AUTHOR_INITIALS=`echo $MK_AUTHOR | sed 's/ /\n/g' | sed 's/^\([A-Z]\).*/\1/' | sed ':i; $!N; s/\n//; ti' | tr [A-Z] [a-z]` - MK_AUTHOR_INITIALS=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with author assignature:" 8 60 "$MK_AUTHOR_INITIALS"` - edit_file "AUTHOR INITIALS" "$MK_AUTHOR_INITIALS" ~/.mkslackbuild - MK_EDITOR=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with editor command:" 8 60 "pico"` - edit_file "EDITOR" "$MK_EDITOR" ~/.mkslackbuild -} - -# Edit source URL -function edit_url() -{ - MK_URL=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with complite URL from source:" 8 60 "$MK_URL"` - [ $? -ne 0 ] && mk_exit 0 -} - -# Edit source name -function edit_source_name() -{ - # Carrega nome do arquivo - MK_SRCNAME=`basename $MK_URL` - MK_SRCNAME=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with source file name:" 8 60 "$MK_SRCNAME"` - [ $? -ne 0 ] && mk_exit 0 -} - -# Edit MK_PKGNAME, MK_VERSION and MK_EXTENSION -function edit_pkgname() -{ - # Remove nome, versão e extensão do nome da fonte - MK_PKGNAME=`echo $MK_SRCNAME | sed -r 's/(.*)-(.*)\.(.*\..*)$/\1/' | tr [A-Z] [a-z]` - MK_VERSION=`echo $MK_SRCNAME | sed -r 's/(.*)-(.*)\.(.*\..*)$/\2/'` - MK_EXTENSION=`echo $MK_SRCNAME | sed -r 's/(.*)-(.*)\.(.*\..*)$/\3/'` - - # Configura nome, versão e extensão do pacote - ANS=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ - --form "Check information below:" 12 70 5 \ - "Package name:" 1 1 "$MK_PKGNAME" 1 15 30 60 \ - "Version:" 3 1 "$MK_VERSION" 3 15 30 100 \ - "Extension:" 5 1 "$MK_EXTENSION" 5 15 30 8` - [ $? -ne 0 ] && mk_exit 0 - - MK_PKGNAME=`echo $ANS | awk '{print $1}'` - MK_VERSION=`echo $ANS | awk '{print $2}'` - MK_EXTENSION=`echo $ANS | awk '{print $3}'` -} - -# Edit configure options -function edit_configure() -{ - CONFIG_HELP=`mktemp -p /tmp/ config_$MK_PKGNAME.XXXXXX` - - $MK_TMPSRC/configure --help > $CONFIG_HELP - config_help - [ "$( cat $CONFIG_HELP | egrep '/usr/local')" != "" ] && MK_PREFIX=/usr || MK_PREFIX=/opt/kde - MK_OPTIONS="" - local ANS0=1 - - while [ $ANS0 -eq 1 ]; do - local ANS="0" - while [ $ANS -ne 4 ]; do - ANS=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ - --menu "Select one option" 0 0 0 \ - 1 "View ./configure help" \ - 2 "PREFIX=$MK_PREFIX" \ - 3 "OPTIONS=$MK_OPTIONS" \ - 4 "Continue"` - [ $? -ne 0 ] && mk_exit - - case $ANS in - '1') - config_help - ;; - '2') - MK_PREFIX=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with prefix for install $MK_PKGNAME" 8 60 "$MK_PREFIX"` - ;; - '3') - MK_OPTIONS=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with configure options for compile $MK_PKGNAME" 8 60 "$MK_OPTIONS"` - ;; - '4') - echo "Continue..." - ;; - *) - ANS=4 - ;; - esac - done - - # Configure - dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --title " Execute ./configure below? " --yesno "./configure --prefix=$MK_PREFIX $MK_OPTIONS" 6 70 - if [ $? -eq 0 ]; then - ( - cd $MK_TMPSRC - ./configure --prefix=$MK_PREFIX $MK_OPTIONS - ) - - echo -en "\nPress ENTER to continue" - read ANS0 - fi - - dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --title " Configure line is ok? " --yesno "./configure --prefix=$MK_PREFIX $MK_OPTIONS" 6 70 - - ANS0=$? - done -} - -# Edit documentations files -function edit_docfiles() -{ - [ -z $MK_TMPSRC ] && return 0 - - if [ -e $MK_TMPSRC ]; then - LIST=`( cd $MK_TMPSRC; find . -type f -maxdepth 1 | cut -c3- )` - DOCMENU="" - for i in $LIST; do - if [ "`echo NEWS TODO README AUTHORS INSTALL ChangeLog | grep $i`" != "" ]; then - DOCMENU="$DOCMENU $i \"\" on" - else - DOCMENU="$DOCMENU $i \"\" off" - fi - done - 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="`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` -} - -#-------------------------------------------------------------------- -# Mount files -#-------------------------------------------------------------------- -# Change string $1 to $2 in all files in the current directory -function change_strings() -{ - # echo "$1 -> $2" - [ $# -ne 2 ] && mk_exit 1 - eval "grep -l \"\[\[$1\]\]\" *" | while read FILE; do - edit_file "$1" "$2" $FILE - done -} - -# 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 "ARCH" "$MK_ARCH" - change_strings "VERSION" $MK_VERSION - change_strings "SOURCE EXTENSION" $MK_EXTENSION - change_strings "DOWNLOAD FOLDER URL" "`dirname $MK_URL`" - change_strings "OTHER CONFIGURE ARGS" "$MK_OPTIONS" - change_strings "DOCUMENTATION FILES" "$MK_DOCFILES" - change_strings "PREFIX" "$MK_PREFIX" -} - -# Mount final SlackBuild -function mount_slackbuild() -{ - 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 - if [ "${SECTION_FLAG[i]}" = "all" -o "${SECTION_FLAG[i]}" = "on" ]; then - cat ${SECTION_NAME[i]}_$MK_PKGNAME.mkbuild >> $SLACKBUILD - echo "" >> $SLACKBUILD - fi - done -} - -# Make files section -function make_file_sections() -{ - THIS_MODEL=$1 - - # Create SlackBuilds-sections files - rm *_$MK_PKGNAME.mkbuild 2>/dev/null - - # Make files section - INDEX=0 - while read ITEM; do - SECTION_NAME[INDEX]="$ITEM" - - AUX=${SB_SECTION[$INDEX,0]}_${MK_PKGNAME} - SECTION_FILE=${SECTION_NAME[INDEX]}_${MK_PKGNAME}.mkbuild - rm $SECTION_FILE 2>/dev/null - - STRING=$ITEM - # Save section status flag - SECTION_FLAG[INDEX]=`get_status "$STRING" $THIS_MODEL` - - # Create sections files - print_lines "$STRING" $THIS_MODEL > $SECTION_FILE - let INDEX++ - done < <( cat $THIS_MODEL | grep '^<[a-z_]\+>' | sed 's/<\(.*\)>.*$/\1/' ) - - let INDEX-- - MAXSECTION=$INDEX -} - -#-------------------------------------------------------------------- -# Main functions -#-------------------------------------------------------------------- -# Create new Slackbuild -function create_slackbuild() -{ - # Config package URL - edit_url - - # Source Name - edit_source_name - - # 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 - if [ $? -eq 0 ]; then - download_url - else - select_source - fi - - # Uncompress source - unpkg_source - - # Configure compiler options if exist .configure - if [ -e $MK_TMPSRC/configure ]; then - edit_configure - fi - - # Edit documentation list - edit_docfiles - - # Create files sections - make_file_sections $SB_MODEL - - # 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 - start_build - - # Main-Menu - edit_menu -} - -# Open mkslackbuild -function open_mkslackbuild() -{ - 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 $MKSLACKBUILD ]; then - # Start defaults variables - source $MKSLACKBUILD - - # SlackBuild scrit name - SLACKBUILD=$MK_SLACKBUILDDIR/$MK_PKGNAME.Slackbuild - - # Create files sections - make_file_sections $MKSLACKBUILD - - # Main-Menu - edit_menu - else - dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ - --msgbox "$MKSLACKBUILD most be a file" 0 0 - fi -} - -# Save mkSlackbuild -function save_mkslackbuild() -{ - dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --infobox "mkSlackBuild save in $MKSLACKBUILD" 5 30 - -# MKSLACKBUILD=$BASEDIR/$MK_PKGNAME.mkslackbuild - - rm $MKSLACKBUILD 2>/dev/null - echo '#!/bin/bash' > $MKSLACKBUILD - echo -e "# mkSlackBuild version $MK_VERSION\n" >> $MKSLACKBUILD - echo "MK_SRCNAME=\"$MK_SRCNAME\"" >> $MKSLACKBUILD - echo "MK_PKGNAME=\"$MK_PKGNAME\"" >> $MKSLACKBUILD - echo "MK_URL=\"$MK_URL\"" >> $MKSLACKBUILD - echo "MK_AUTHOR=\"$MK_AUTHOR\"" >> $MKSLACKBUILD - echo "MK_AUTHOR_INITIALS=\"$MK_AUTHOR_INITIALS\"" >> $MKSLACKBUILD - echo "MK_VERSION=\"$MK_VERSION\"" >> $MKSLACKBUILD - echo "MK_EXTENSION=\"$MK_EXTENSION\"" >> $MKSLACKBUILD - echo "MK_DOCFILES=\"$MK_DOCFILES\"" >> $MKSLACKBUILD - echo "MK_OPTIONS=\"$MK_OPTIONS\"" >> $MKSLACKBUILD - echo "MK_PREFIX=\"$MK_PREFIX\"" >> $MKSLACKBUILD - echo -e "return 0\n\n" >> $MKSLACKBUILD - - for i in `seq 0 $MAXSECTION`; do - echo "<${SECTION_NAME[i]}> ${SECTION_FLAG[i]}" >> $MKSLACKBUILD - cat ${SECTION_NAME[i]}_$MK_PKGNAME.mkbuild >> $MKSLACKBUILD - echo "</${SECTION_NAME[i]}> ${SECTION_FLAG[i]}" >> $MKSLACKBUILD - echo "" >> $MKSLACKBUILD - done -} - -# Edit Menu -function edit_menu() -{ - ANSE=0 - while [ $ANSE -ne 1 ]; do - # Create main-menu string - EDITMENU="" - for i in `seq 0 $MAXSECTION`; do - #echo "${SECTION_NAME[i]} ${SECTION_FLAG[i]} ${SECTION_FILE[i]}" - EDITMENU="$EDITMENU ${SECTION_NAME[i]} ${SECTION_FLAG[i]}" - done - - SELECT=`eval "dialog --stdout --backtitle \"mkSlackBuild $PROG_VERSION [$MK_PKGNAME]\" --menu \"Select one section to edit\" 20 40 13 $EDITMENU"` - ANSE=$? - if [ $ANSE -ne 1 ]; then - STATUS=`mk_status $SELECT` - if [ $? -ne 0 ]; then - echo "Section name error..." - mk_exit 1 - fi - FLAG=`echo $STATUS | awk '{print $1}'` - INDEX=`echo $STATUS | awk '{print $2}'` - if [ "$FLAG" = "on" ]; then - SECTION_FLAG[$INDEX]=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --radiolist "Change status from $SELECT" 0 0 0 "on" "enable section" "on" "off" "desable section" "off"` - elif [ "$FLAG" = "off" ]; then - SECTION_FLAG[$INDEX]=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --radiolist "Change status from $SELECT" 0 0 0 "on" "enable section" "off" "off" "desable section" "on"` - fi - if [ "${SECTION_FLAG[$INDEX]}" = "on" -o "${SECTION_FLAG[$INDEX]}" = "all" ]; then - $MK_EDITOR ${SELECT}_${MK_PKGNAME}.mkbuild - fi - fi - done -} - - -# -#-------------------------------------------------------------------- -# Start Program -#-------------------------------------------------------------------- -# -set +x # turn off debug -PROG_VERSION=0.9.1 -LANG=us -BASEDIR=`pwd` -AUX_TMP=`mktemp -p /tmp/ aux_tmp.XXXXXX` -SLACKDESC_TMP=`mktemp -p /tmp/ slackdesc_tmp.XXXXXX` -SLACKDESC_LEN=77 -if [ -e ~/.generic.mkSlackBuild ]; then - SB_MODEL=~/.generic.mkSlackBuild -elif [ -e /etc/simplepkg/generic.mkSlackBuild ]; then - SB_MODEL=/etc/simplepkg/generic.mkSlackBuild -else - echo "SlackBuild model (generic.mkSlackBuild) not found" - mk_exit 0 -fi - -# Clear dialog -dialog --clear - -# Load/create personal definitions -if [ ! -e ~/.mkslackbuild ]; then - ( cat << EOF > ~/.mkslackbuild -#!/bin/bash -# mkslackbuild definitions -# -MK_AUTHOR="[[AUTHOR NAME]]" -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 -) -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 - edit_author -fi - -ANS0=7 -while [ $ANS0 -ne 0 ]; do - if [ -z $MK_PKGNAME ]; then - ANS0=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ - --menu "Main Menu:" 0 0 0 \ - "1" "Create New SlackBuild" \ - "2" "Open edited SlackBuild" \ - "0" "Exit"` - EXIT_STATUS=$? - else - ANS0=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ - --menu "Main Menu:" 0 0 0 \ - "1" "Create New SlackBuild" \ - "2" "Open MkSlackBuild" \ - "3" "Save MkSlackBuild" \ - "4" "Make Slackbuild" \ - "5" "Edit setions menu" \ - "0" "Exit"` - EXIT_STATUS=$? - fi - - if [ $EXIT_STATUS -ne 0 ]; then - mk_exit $EXIT_STATUS - fi - - case $ANS0 in - 1) - create_slackbuild - ;; - 2) - open_mkslackbuild - ;; - 3) - save_mkslackbuild - ;; - 4) - mount_slackbuild - ;; - 5) - edit_menu - ;; - *) - true - ;; - esac -done - -if [ ! -z $MK_PKGNAME ]; then - MKSLACKBUILD=$BASEDIR/$MK_PKGNAME.mkslackbuild - if [ ! -e $MKSLACKBUILD ]; then - save_mkslackbuild - fi -fi - -mk_exit 0 -# _________________________________END_______________________________ diff --git a/utils/searchpkg b/utils/searchpkg deleted file mode 100755 index 5f272a3..0000000 --- a/utils/searchpkg +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# -# searchpkg: search packages inside a local slackware-like repository -# this is part of simplepkg -# feedback: rhatto at riseup.net | gpl -# - -# find . -type f -exec ls -l {} \; > FILELIST.TXT - -if [[ $# != 1 && $# != 2 ]]; then - echo "usage: $0 [-1] <repository> [package-name]" - echo "package-name can be either the full package file name, just its prefix or so" - echo "option -1 show just the first matching package" - exit 1 -fi - -FILELIST="$1/FILELIST.TXT" -PACKAGE_FIELD="8" - -if [ -z "$2" ]; then - grep .tgz $FILELIST -else - grep -e "$2" $FILELIST | grep tgz | awk "{ print \$$PACKAGE_FIELD }" -fi |