Segue o meu script de SlackBuild:

Tenho compilado tudo com ele, apenas altero o nome do programa, versão, url,
arquitetura e, em alguns casos, o /etc.

Ele é um misto dos scripts da Slackbuid.org e do Slackbuild do Alien (peguei
o que julgava melhor em cada um).

##############################################################################################

#!/bin/sh
#
# Copyright: See COPYING file at http://www.slackbuilds.net/COPYING
# Contributed by: mcc
#
# Modified by: Guilherme "Korosso" Gontijo <[email protected]>
# Pqui Linux: http://pquilinux.org
# 10-06-2009
# ------------------------------------------------------------------
# Thanks for Alien Slackbuild scripts (for some small things).
#

CWD=$(pwd)
NAMESRC=xfce4-cellmodem-plugin
NAMEPKG=xfce4-cellmodem-plugin
VERSION=${VERSION:-0.0.5}
TMP=${TMP:-/tmp}
OUT=${OUT:-$TMP/build}
PKG=${PKG:-$TMP/build/$NAMESRC}
EXT=${EXT:-tar.bz2}

# Target
ARCH=${ARCH:-x86_64}        # Insert the Architeture of machine
(i386,i486,i586,i686,x86_64)
TARGET=${TARGET:-x86_64}    # Insert the Architeture again to make a pkg
BUILD=${BUILD:-1_pQ}        # Insert your build
PKGEXT=${PKGEXT:-txz}         # Insert a pkg extension (tgz,txz,tbz,tlz)
SYSDIR=${SYSDIR:-/etc/xfce}    # Where the system (etc) files will be
located

SRCDIR=$(cd $(dirname $0); pwd)                    # Where do we look for
sources?
SOURCE[0]="$NAMESRC-$VERSION.$EXT"                # Location where find a
package.
SRCURL[0]="http://goodies.xfce.org/releases/xfce4-cellmodem-plugin";     #
Insert the url for download if necessary.
MD5[0]=MD5SUMS                            # Name of archive with md5 to be
downloaded.

#########################################################################
##                                    #
## --- with a little luck, you won't have to edit below this point --- ##
##                                    #
#########################################################################

# Stop the script if there's an error:
set -e

# Sanity checks:
if [ "$(id -u)" = "0" ]; then
  echo "Don't run this script as ROOT! Use fakeroot, instead."
  exit 1
fi

if [ ! -d $TMP ]; then
  echo "$TMP doesn't exist or is not a directory."
  exit 1
fi

cd $SRCDIR
# Download the md5 if it's not found:
if [ ! -r $SOURCE.md5 ] ; then
  wget $SRCURL/$MD5;
  cat $MD5 |grep $SOURCE >> $SOURCE.md5;
  rm $MD5
fi

# Download the tarball if it's not found:
if [ ! -r $SOURCE ] ; then
  wget $SRCURL/$SOURCE
fi

# Check if the tarball is not corrupted:
md5sum -c $SOURCE.md5

# Set the needed optimization flags for the current $ARCH:
if [ "$ARCH" = "i386" ]; then
  SLKCFLAGS="-O2 -march=i386 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""
elif [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""
elif [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"; SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64"
fi

# Cleanup:
rm -rf $PKG
mkdir -p $PKG

# Extraction:
cd $TMP
echo -e "\nBuilding $SOURCE...\n"
if [ "$EXT" = "tar.bz2" ]; then
  tar -xjvf $SRCDIR/$SOURCE
elif [ "$EXT" = "tar.gz" ]; then
  tar -xzvf $SRCDIR/$SOURCE
elif [ "$EXT" = "zip" ]; then
  unzip $SRCDIR/$SOURCE
elif [ "$EXT" = "7z" ]; then
  7za -x $SRCDIR/$SOURCE
fi

cd $NAMESRC-$VERSION
# Make sure ownerships and permissions are sane:
chmod -R a-s,u+rw,go-w+r .

if [ ! -r $NAMEPKG.patch ]; then
  cat $CWD/$NAMEPKG.patch | patch -p1
fi
LDFLAGS="$SLKLDFLAGS" \
CFLAGS=$SLKCFLAGS \
CXXFLAGS=$SLKCFLAGS \
./configure \
   --prefix=/usr \
   --libdir=/usr/lib${LIBDIRSUFFIX} \
   --sysconfdir=$SYSDIR \
   --localstatedir=/var \
   --mandir=/usr/man \
   --enable-static=no \
   --enable-debug=no \
   --program-prefix="" \
   --program-suffix="" \
   --build=$TARGET-slackware-linux \
   --host=$TARGET-slackware-linux

# Compilation:
make -j3
# Installation:
make install DESTDIR=$PKG

# Add a documentation directory:
mkdir -p $PKG/usr/doc/$NAMEPKG-$VERSION
install -m 644 \
  AUTHORS ChangeLog COPYING README \
  $PKG/usr/doc/$NAMEPKG-$VERSION

# Add a slack-desc:
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

# Stripping:
find $PKG | xargs file | grep "ELF 32-bit LSB executable" | cut -f 1 -d : |
xargs strip --strip-unneeded 2> /dev/null || echo "No ELF 32-bit LSB
executable to strip"
find $PKG | xargs file | grep "shared object" | cut -f 1 -d : | xargs strip
--strip-unneeded 2> /dev/null || echo "No shared object to strip"
find $PKG | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs
strip -g 2> /dev/null || echo "No ar archive to strip"

# Build the final package:
cd $PKG
PACKAGING="
chown root:root . -R
/sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$PKGEXT
rm -rf $PKG
rm -rf $TMP/$NAMESRC-$VERSION
"
# Use fakeroot if installed, or ask for the root password instead:
if [ $(which fakeroot 2> /dev/null) ]; then
  echo "$PACKAGING" | fakeroot
else
  echo -e "\nInsert the root password to make a .$PKGEXT"
  su -c "$PACKAGING"
fi

# Everything's OK, exit with '0' error status:
exit 0
##############################################################################################
-- 

Guilherme de Lima Gontijo
---------------------------------------
GLG - Informática, Redes e Consultoria
Consultor de Segurança em Redes
Consultor em Redes Wireless

Linux User #472210

Graduando em Redes de Comunicação - IFG
---------------------------------------
Gtalk:  [email protected]
aMSN: [email protected]
Skype: korosso

--~--~---------~--~----~------------~-------~--~----~
GUS-BR - Grupo de Usuários de Slackware Brasil
http://www.slackwarebrasil.org/
http://groups.google.com/group/slack-users-br

Antes de perguntar:
http://www.istf.com.br/perguntas/

Para sair da lista envie um e-mail para:
[email protected]
-~----------~----~----~----~------~----~------~--~---

Responder a