package maker para o slackware

Publicado por underguiz 23/01/2004

[ Hits: 5.545 ]

Download mktgz




Cria pacotes para slackware a partir do source (.tar.gz). O
script ira compilar o fonte, criar o pacote (.tgz) e se
requisitado instala-lo.

  



Esconder código-fonte

#!/bin/bash

# Copyright 2004  Guilherme Fran?a Vieira, Uberl?ndia, Minas Gerais Brazil
# All rights reserved.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

if [ `id -u` = 0 ] ; then
  if [ "$1" != "" ] ; then
    if [ "$2" != "" ] ; then
      case "$1" in
       *tar.gz)
         cmd="tar xfz"
       ;;
       *tar.bz2)
         cmd="tar xfj"
       ;;
       *tar)
         cmd="tar xf"
       ;;
       *)
        echo ""$1": Unknow file type"
   echo "Suported are: tar.gz, tar.bz2, tar"
       ;;
      esac
      if [ -a "$1" ] ; then
        workdir=`pwd`
        echo "Creating temporary directory..."
   mkdir /tmp/"$1".src
   echo "Extracting files..."
   $cmd "$1" -C /tmp/"$1".src
   cd /tmp/"$1".src
   cd `ls`
   mkdir "$2"
   if [ -a configure ] ; then
            echo "Compiling the sources..."
     ./configure --prefix=`pwd`/"$2" 1> /dev/null
     make 1> /dev/null
     make install 1> /dev/null
     cd "$2"
     echo "Creating package..."
     makepkg -c y "$2" 1> /dev/null
     cp "$2" "$workdir"
     cd "$workdir"
     echo "Removing Temporary files..."
     rm -rf /tmp/"$1".src
     echo "Install the package now? [yes|no]" ; read answer
     case $answer in
      yes)
       installpkg $2
      ;;
      no)
      ;;
      *)
       echo "what a hell is $aswer?"
      ;;
     esac
    else
     cd "$workdir"
     rm -rf /tmp/"$1".src
     echo ""$1": not a source file, exiting"
   fi  
       else
        echo ""$1": file not found, exiting"
      fi
     else
      echo "Package name missing"
      echo "Usage: "$0" [source file] [package name]"
    fi
   else
    echo "Source file missing"
    echo "Usage: "$0" [source file] [package name]"
  fi
 else
  echo "You must be root to run this program"
fi

Scripts recomendados

Album de fotografias

CBQ Script

Envio de email via console

Firewall - IPTABLES

Validar memória RAM e swap


  

Comentários
[1] Comentário enviado por lordello em 23/01/2004 - 21:34h

Muito maneiro, esse vou guardar no meu bloquinho!
Falow!


Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts