]> gitweb.fluxo.info Git - slackbuilds.git/commitdiff
sdl-image: adicionando
authorrudson <rudson@370017ae-e619-0410-ac65-c121f96126d4>
Mon, 9 Apr 2007 21:01:00 +0000 (21:01 +0000)
committerrudson <rudson@370017ae-e619-0410-ac65-c121f96126d4>
Mon, 9 Apr 2007 21:01:00 +0000 (21:01 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@1142 370017ae-e619-0410-ac65-c121f96126d4

15 files changed:
app/cdr/k9copy/k9copy.SlackBuild
app/cdr/k9copy/slack-required
app/editors/kile/kile.SlackBuild
media/libs/libdvdcss/libdvdcss.SlackBuild
media/libs/libdvdplay/libdvdplay.SlackBuild
media/libs/libdvdplay/slack-required
media/libs/libdvdread/libdvdread.SlackBuild
media/libs/libdvdread/slack-required
media/libs/sdl-image/sdl-image.SlackBuild [new file with mode: 0755]
media/libs/sdl-image/slack-required [new file with mode: 0644]
media/sound/lame/lame.SlackBuild
media/video/dvdauthor/dvdauthor.SlackBuild
media/video/dvdauthor/slack-required
sci/visualization/grace/grace.SlackBuild
sci/visualization/grace/slack-required

index 24f749e733c5e603ebd3b417b9fa5e4364d3d6ee..cb87b9754b4f1c1c2bda43be88749c4f2fbeb830 100755 (executable)
 #!/bin/bash
 #
-# slackbuild for k9copy, by Rudson R. Alves
-# requires: vamps
-# tested: k9copy-1.0.4-2, 1.1.0
-
-CWD=`pwd`
+# SlackBuild for k9copy
+# http://downloads.sourceforge.net/k9copy/
+#
+# Author: Rudson R. Alves
+#
 
-# ----  Inicializa variáveis com o slackbuild  ------------
-if [ -e ~/.slackbuildrc ]; then
+# Look for slackbuildrc
+if [ -f ~/.slackbuildrc ]; then
   source ~/.slackbuildrc
-elif [ -e /etc/slackbuildrc ]; then
+elif [ -f /etc/slackbuildrc ]; then
   source /etc/slackbuildrc
 fi
 
-# --------  Variáveis de controle de versão  --------------
-# Nome da fonte para a qual o slackbuild foi construído e
-# o seu md5sum
-SRC_ORIG="k9copy-1.0.4-2.tar.gz"
-MD5_ORIG="5b53658a12192c7832059b56daf23385"
-PACKAGE_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)-(.*)\.(.*\..*)$/\1/'`
-VERSION_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)-(.*)\.(.*\..*)$/\2/'`
-    REVISION=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)-(.*)\.(.*\..*)$/\3/'`
-   EXTENSION=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)-(.*)\.(.*\..*)$/\4/'`
-
-# -------  Códigos de erro para o createpkg  --------------
-ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
-ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
-ERROR_TAR=37;       ERROR_MKPKG=38;     ERROR_GPG=39
-ERROR_PATCH=40;     ERROR_VCS=41
-
-# ---------  Inicializa variáveis de entrada  -------------
-PACKAGE=$PACKAGE_ORIG
-ARCH=${ARCH:=i486}
-SRC_DIR=${SRC:=$CWD}
-if [ "$VERSION" != "" ]; then
-    REVISION=`echo $VERSION | sed -r 's/(.*)-(.*)$/\2/'`
-    VERSION=`echo $VERSION | sed -r 's/(.*)-(.*)$/\1/'`
-else
-    VERSION=$VERSION_ORIG
-fi
-SRC=$PACKAGE-$VERSION-$REVISION.$EXTENSION
-BUILD=${BUILD:=1rud}
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="k9copy"
+PKG_NAME="k9copy"
+ARCH=${ARCH:=i468}
+SRC_VERSION=${VERSION:=1.0.4}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1rra}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
 TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
 REPOS=${REPOS:=$TMP}
-PREFIX=${PREFIX:=/opt/kde}
-OPTCONF=${OPTCONF:=""}
-MD5=${MD5:=$MD5_ORIG}
-URL=${URL:="http://ufpr.dl.sourceforge.net/sourceforge/k9copy/$SRC"}
-
-# ----------------  Download fontes  ----------------------
-# Fonte a ser compilada, com o path
-SOURCE=$SRC_DIR/$PACKAGE/$SRC
-# Verifica existência do pacote em $SRC em $SRC_DIR
-if [ ! -e $SOURCE ]; then
-    wget "$URL" -P "$SRC_DIR/$PACKAGE" || exit $ERROR_WGET
-fi
+PREFIX=${PREFIX:=/usr}
+PKG_SRC="$TMP/$SRC_NAME-$SRC_VERSION-2"
+CONF_OPTIONS=${CONF_OPTIONS:=""}
+NUMJOBS=${NUMJOBS:="-j4"}
 
-# ------------------  Checa md5sum  -----------------------
-if [ "$SRC_ORIG" = "$SRC" -o "$MD5" != "$MD5_ORIG" -a "$MD5" != "no" ]; then
-    SUM=`md5sum $SOURCE | awk '{print $1}'`
-    [ "$SUM" != "$MD5" ] && exit $ERROR_MD5
-fi
+# Set system libraries' path and optmization flags based on $ARCH
+LIBDIR="$PREFIX/lib"
 
-# -----------------  ARCH e LIBDIR  -----------------------
-# Libdir, para arch x86_64
-LIBDIR=$PREFIX/lib
-# Seleciona flags para o compilador
 if [ "$ARCH" = "i386" ]; then
-    SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+  SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
 elif [ "$ARCH" = "i486" ]; then
-    SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
+  SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
 elif [ "$ARCH" = "i686" ]; then
-    SLKCFLAGS="-O2 -march=i686"
+  SLKCFLAGS="-O2 -march=i686"
 elif [ "$ARCH" = "s390" ]; then
-    SLKCFLAGS="-O2"
+  SLKCFLAGS="-O2"
 elif [ "$ARCH" = "x86_64" ]; then
-    SLKCFLAGS="-O2"
-    LIBDIR="$PREFIX/lib64"
+  SLKCFLAGS="-O2"
+  LIBDIR="$PREFIX/lib64"
+fi
+
+# Set error codes (used by createpkg)
+ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
+ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
+ERROR_TAR=37;       ERROR_MKPKG=38;     ERROR_GPG=39
+ERROR_PATCH=40;     ERROR_VCS=41;       ERROR_MKDIR=42
+
+# Clean up any leftovers of previous builds
+rm -rf "$PKG_SRC" 2> /dev/null
+rm -rf "$PKG" 2> /dev/null
+
+# Create directories if necessary
+mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
+mkdir -p "$PKG" || exit $ERROR_MKDIR
+mkdir -p "$REPOS" || exit $ERROR_MKDIR
+
+# Dowload source if necessary
+SRC="$SRC_NAME-$SRC_VERSION-2.tar.gz"
+URL="http://downloads.sourceforge.net/k9copy/$SRC"
+
+if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then
+  wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
 fi
 
-# --------------  Desempacota fontes  ---------------------
-# Desempacota fontes em PKG_SRC=$TMP/$PACKAGE-source
-PKG_SRC=$TMP/$PACKAGE-source
-rm -rf $PKG_SRC 2>/dev/null
-mkdir -p $PKG_SRC
-# Desempacota $SOURCE em $TMP/$PACKAGE-source
-tar xvf $SOURCE -C $PKG_SRC || exit $ERROR_TAR
-
-# Pega o nome do diretório das fontes independente de sua
-# estrutura (package-version...)
-PKG_DIR="$PKG_SRC/$( ls $PKG_SRC/ )"
-cd $PKG_DIR
-
-# --------------  Configura programa  ---------------------
-# Configura programa
-CFLAGS="$SLKCFLAGS" ./configure --prefix=$PREFIX --libdir=$LIBDIR $OPTCONF || exit $ERROR_CONF
-
-# ----------------  Compila programa  ---------------------
-make -j3 || exit $ERROR_MAKE
-
-# -------------  Diretório Temporário  --------------------
-# Cria diretório temporário para construção do pacote
-PKG=$TMP/$PACKAGE
-rm -rf $PKG
-mkdir -p $PKG
-
-# ---------------  Instala programa  ----------------------
-# Instala programa em diretório temporário
-make install DESTDIR=$PKG || exit $ERROR_INSTALL
-
-# -----------------  Stripa código  -----------------------
-cd $PKG
-find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-
-# ----------------  Cria slack-desc  ----------------------
-mkdir $PKG/install
-cat << EOF > install/slack-desc
+# Untar
+cd "$TMP"
+tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
+cd "$PKG_SRC"
+
+# Configure
+CFLAGS="$SLKCFLAGS" \
+  CXXFLAGS="$SLKCFLAGS" \
+  ./configure \
+  --prefix="$PREFIX" --libdir="$LIBDIR" "$CONF_OPTIONS" || exit $ERROR_CONF
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+make install DESTDIR="$PKG" || exit $ERROR_INSTALL
+
+# Strip binaries
+( cd "$PKG"
+  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Install documentation
+DOCS="NEWS TODO README AUTHORS INSTALL ChangeLog COPYING"
+mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+cp -a $DOCS "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+
+# Add package description (slack-desc)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EODESC > "$PKG/install/slack-desc"
 # HOW TO EDIT THIS FILE:
 # The "handy ruler" below makes it easier to edit a package description.  Line
-# up the first '|' above the ':' following the base package name, and the '|' on
-# the right side marks the last column you can put a character in.  You must make
-# exactly 11 lines for the formatting to be correct.  It's also customary to
-# leave one space after the ':'.
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
 
-       |-------handy-ruler------------------------------------------------------|
-k9copy: k9copy.Slackbuild by Rudson R. Alves <rudsonalves[a]yahoo.com.br>
+      |-----handy-ruler------------------------------------------------------|
+k9copy: k9copy.Slackbuild by Slack.Sarava
 k9copy:
 k9copy: K9Copy is a program from Jean-Michel PETIT <jmp@localhost>.
 k9copy: This program is a DVD Shrink clone to GNU/Linux system
@@ -136,18 +121,14 @@ k9copy:
 k9copy:
 k9copy:
 k9copy:
-EOF
+EODESC
 
-# -----------------  Documentações  -----------------------
-# Criar diretório de documentação
-PKG_DOC=$PKG/usr/doc/$PACKAGE-$VERSION
-mkdir -p $PKG_DOC
-cp $PKG_DIR/{AUTHORS,COPYING,ChangeLog,INSTALL,NEWS,README,TODO} $PKG_DOC
+# Build the package
+cd "$PKG"
+makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
 
-# ---------------  Constroi o pacote  ---------------------
-makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG
-
-# -----------  Remove arquivos temporários  ---------------
-if [ "$CLEANUP" = "yes" ]; then
-    rm -rf $PKG $PKG_SRC
+# Delete source and build directories if requested
+if [ "$CLEANUP" == "yes" ]; then
+  rm -rf "$PKG_SRC" "$PKG"
 fi
+
index b104fe922670f51685018c122dd96ad8b3d7f322..9a57346a99aef4f7011bd622504415075cba4030 100644 (file)
@@ -1,3 +1,6 @@
+# Dependency list to k9copy
+# 
+# dependency [condition] [version]]
 vamps
 qt
 kdelibs
index 5111c17406f45ec5a59782e30f5ea830c64170d9..9657e5a88662123c820a0069aa804e9ef5d0dd02 100755 (executable)
 #!/bin/bash
 #
-# slackbuild for kile, by Rudson R. Alves
-# requires: none
-# tested: kile-1.9.3
-
-CWD=`pwd`
+# SlackBuild for kile
+# http://downloads.sourceforge.net/kile/
+#
+# Author: Rudson R. Alves
+#
 
-# ----  Inicializa variáveis com o slackbuild  ------------
-if [ -e ~/.slackbuildrc ]; then
+# Look for slackbuildrc
+if [ -f ~/.slackbuildrc ]; then
   source ~/.slackbuildrc
-elif [ -e /etc/slackbuildrc ]; then
+elif [ -f /etc/slackbuildrc ]; then
   source /etc/slackbuildrc
 fi
 
-# --------  Variáveis de controle de versão  --------------
-# Nome da fonte para a qual o slackbuild foi construído e
-# o seu md5sum
-SRC_ORIG="kile-1.9.3.tar.bz2"
-MD5_ORIG="0404b4be7bced7123111c49918130a1f"
-PACKAGE_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\1/'`
-VERSION_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\2/'`
-   EXTENSION=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\3/'`
-
-# -------  Códigos de erro para o createpkg  --------------
-ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
-ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
-ERROR_TAR=37;       ERROR_MKPKG=38;    ERROR_GPG=39
-ERROR_PATCH=40;     ERROR_VCS=41
-
-# ---------  Inicializa variáveis de entrada  -------------
-PACKAGE=$PACKAGE_ORIG
-ARCH=${ARCH:=i486}
-SRC_DIR=${SRC:=$CWD}
-VERSION=${VERSION:=$VERSION_ORIG}
-SRC=$PACKAGE-$VERSION.$EXTENSION
-BUILD=${BUILD:=1rud}
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="kile"
+PKG_NAME="kile"
+ARCH=${ARCH:=i468}
+SRC_VERSION=${VERSION:=1.9.3}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1rra}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
 TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
 REPOS=${REPOS:=$TMP}
-PREFIX=${PREFIX:=/opt/kde}
-OPTCONF=${OPTCONF:=""}
-MD5=${MD5:=$MD5_ORIG}
-URL=${URL:="http://ufpr.dl.sourceforge.net/sourceforge/kile/$SRC"}
-
-# ----------------  Download fontes  ----------------------
-# Fonte a ser compilada, com o path
-SOURCE=$SRC_DIR/$PACKAGE/$SRC
-# Verifica existência do pacote em $SRC em $SRC_DIR
-if [ ! -e $SOURCE ]; then
-    wget "$URL" -P "$SRC_DIR/$PACKAGE" || exit $ERROR_WGET
-fi
+PREFIX=${PREFIX:=/usr}
+PKG_SRC="$TMP/$SRC_NAME-$SRC_VERSION"
+CONF_OPTIONS=${CONF_OPTIONS:=""}
+NUMJOBS=${NUMJOBS:="-j4"}
 
-# ------------------  Checa md5sum  -----------------------
-if [ "$SRC_ORIG" = "$SRC" -o "$MD5" != "$MD5_ORIG" -a "$MD5" != "no" ]; then
-    SUM=`md5sum $SOURCE | awk '{print $1}'`
-    [ "$SUM" != "$MD5" ] && exit $ERROR_MD5
-fi
+# Set system libraries' path and optmization flags based on $ARCH
+LIBDIR="$PREFIX/lib"
 
-# -----------------  ARCH e LIBDIR  -----------------------
-# Libdir, para arch x86_64
-LIBDIR=$PREFIX/lib
-# Seleciona flags para o compilador
 if [ "$ARCH" = "i386" ]; then
-    SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+  SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
 elif [ "$ARCH" = "i486" ]; then
-    SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
+  SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
 elif [ "$ARCH" = "i686" ]; then
-    SLKCFLAGS="-O2 -march=i686"
+  SLKCFLAGS="-O2 -march=i686"
 elif [ "$ARCH" = "s390" ]; then
-    SLKCFLAGS="-O2"
+  SLKCFLAGS="-O2"
 elif [ "$ARCH" = "x86_64" ]; then
-    SLKCFLAGS="-O2"
-    LIBDIR="$PREFIX/lib64"
+  SLKCFLAGS="-O2"
+  LIBDIR="$PREFIX/lib64"
+fi
+
+# Set error codes (used by createpkg)
+ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
+ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
+ERROR_TAR=37;       ERROR_MKPKG=38;     ERROR_GPG=39
+ERROR_PATCH=40;     ERROR_VCS=41;       ERROR_MKDIR=42
+
+# Clean up any leftovers of previous builds
+rm -rf "$PKG_SRC" 2> /dev/null
+rm -rf "$PKG" 2> /dev/null
+
+# Create directories if necessary
+mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
+mkdir -p "$PKG" || exit $ERROR_MKDIR
+mkdir -p "$REPOS" || exit $ERROR_MKDIR
+
+# Dowload source if necessary
+SRC="$SRC_NAME-$SRC_VERSION.tar.bz2"
+URL="http://downloads.sourceforge.net/kile/$SRC"
+
+if [ ! -s "$SRC_DIR/$SRC" ] || ! bunzip2 -t "$SRC_DIR/$SRC" 2> /dev/null; then
+  wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
 fi
 
-# --------------  Desempacota fontes  ---------------------
-# Desempacota fontes em PKG_SRC=$TMP/$PACKAGE-source
-PKG_SRC=$TMP/$PACKAGE-source
-rm -rf $PKG_SRC 2>/dev/null
-mkdir -p $PKG_SRC
-# Desempacota $SOURCE em $TMP/$PACKAGE-source
-tar xvf $SOURCE -C $PKG_SRC || exit $ERROR_TAR
-
-# Pega o nome do diretório das fontes independente de sua
-# estrutura (package-version...)
-PKG_DIR="$PKG_SRC/$( ls $PKG_SRC/ )"
-cd $PKG_DIR
-
-# --------------  Configura programa  ---------------------
-# Configura programa
-CFLAGS="$SLKCFLAGS" ./configure --prefix=$PREFIX --libdir=$LIBDIR $OPTCONF || exit $ERROR_CONF
-
-# ----------------  Compila programa  ---------------------
-make -j3 || exit $ERROR_MAKE
-
-# -------------  Diretório Temporário  --------------------
-# Cria diretório temporário para construção do pacote
-PKG=$TMP/$PACKAGE
-rm -rf $PKG
-mkdir -p $PKG
-
-# ---------------  Instala programa  ----------------------
-# Instala programa em diretório temporário
-make install DESTDIR=$PKG || exit $ERROR_INSTALL
-
-# -----------------  Stripa código  -----------------------
-cd $PKG
-find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-
-# ----------------  Cria slack-desc  ----------------------
-mkdir $PKG/install
-cat << EOF > install/slack-desc
+# Untar
+cd "$TMP"
+tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
+cd "$PKG_SRC"
+
+# Configure
+CFLAGS="$SLKCFLAGS" \
+  CXXFLAGS="$SLKCFLAGS" \
+  ./configure \
+  --prefix="$PREFIX" --libdir="$LIBDIR" "$CONF_OPTIONS" || exit $ERROR_CONF
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+make install DESTDIR="$PKG" || exit $ERROR_INSTALL
+
+# Strip binaries
+( cd "$PKG"
+  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Install documentation
+DOCS="TODO README AUTHORS INSTALL ChangeLog COPYING"
+mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+cp -a $DOCS "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+
+# Add package description (slack-desc)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EODESC > "$PKG/install/slack-desc"
 # HOW TO EDIT THIS FILE:
 # The "handy ruler" below makes it easier to edit a package description.  Line
-# up the first '|' above the ':' following the base package name, and the '|' on
-# the right side marks the last column you can put a character in.  You must make
-# exactly 11 lines for the formatting to be correct.  It's also customary to
-# leave one space after the ':'.
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
 
-     |--------handy-ruler------------------------------------------------------|
+    |-----handy-ruler--------------------------------------------------------|
 kile: Kile is an integrated LATEX environment for the KDE desktop. Kile gives
 kile: you the ability to use all the functionalities of LATEX in a graphical
 kile: interface, giving you easy, immediate, and customized access to all
@@ -129,18 +120,14 @@ kile:
 kile:
 kile:
 kile:
-EOF
+EODESC
 
-# -----------------  Documentações  -----------------------
-# Criar diretório de documentação
-PKG_DOC=$PKG/usr/doc/$PACKAGE-$VERSION
-mkdir -p $PKG_DOC
-cp $PKG_DIR/{API,COPYING,ChangeLog,DEFINES,HACKING,INSTALL,LICENSE,README,README.WINGTK,STYLEGUIDE,TODO,USAGE} $PKG_DOC
+# Build the package
+cd "$PKG"
+makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
 
-# ---------------  Constroi o pacote  ---------------------
-makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG
-
-# -----------  Remove arquivos temporários  ---------------
-if [ "$CLEANUP" = "yes" ]; then
-    rm -rf $PKG $PKG_SRC
+# Delete source and build directories if requested
+if [ "$CLEANUP" == "yes" ]; then
+  rm -rf "$PKG_SRC" "$PKG"
 fi
+
index bcfa9af49f775319f50a4a7459e11412979cb6db..97a6f2aa688b55e8c13c363ef0e92e9f523ce71e 100755 (executable)
 #!/bin/bash
 #
-# slackbuild for kile, by Rudson R. Alves
-# requires: none
-# tested: libdvdcss-1.2.9
-
-CWD=`pwd`
+# SlackBuild for libdvdcss
+# http://download.videolan.org/pub/libdvdcss/1.2.9/
+#
+# Author: Rudson R. Alves
+#
 
-# ----  Inicializa variáveis com o slackbuild  ------------
-if [ -e ~/.slackbuildrc ]; then
+# Look for slackbuildrc
+if [ -f ~/.slackbuildrc ]; then
   source ~/.slackbuildrc
-elif [ -e /etc/slackbuildrc ]; then
+elif [ -f /etc/slackbuildrc ]; then
   source /etc/slackbuildrc
 fi
 
-# --------  Variáveis de controle de versão  --------------
-# Nome da fonte para a qual o slackbuild foi construído e
-# o seu md5sum
-SRC_ORIG="libdvdcss-1.2.9.tar.bz2"
-MD5_ORIG="553383d898826c285afb2ee453b07868"
-PACKAGE_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\1/'`
-VERSION_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\2/'`
-   EXTENSION=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\3/'`
-
-# -------  Códigos de erro para o createpkg  --------------
-ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
-ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
-ERROR_TAR=37;       ERROR_MKPKG=38;    ERROR_GPG=39
-ERROR_PATCH=40;     ERROR_VCS=41
-
-# ---------  Inicializa variáveis de entrada  -------------
-PACKAGE=$PACKAGE_ORIG
-ARCH=${ARCH:=i486}
-SRC_DIR=${SRC:=$CWD}
-VERSION=${VERSION:=$VERSION_ORIG}
-SRC=$PACKAGE-$VERSION.$EXTENSION
-BUILD=${BUILD:=1rud}
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="libdvdcss"
+PKG_NAME="libdvdcss"
+ARCH=${ARCH:=i468}
+SRC_VERSION=${VERSION:=1.2.9}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1rra}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
 TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
 REPOS=${REPOS:=$TMP}
 PREFIX=${PREFIX:=/usr}
-OPTCONF=${OPTCONF:=""}
-MD5=${MD5:=$MD5_ORIG}
-URL=${URL:="http://download.videolan.org/pub/libdvdcss/$VERSION/$SRC"}
-
-# ----------------  Download fontes  ----------------------
-# Fonte a ser compilada, com o path
-SOURCE=$SRC_DIR/$PACKAGE/$SRC
-# Verifica existência do pacote em $SRC em $SRC_DIR
-if [ ! -e $SOURCE ]; then
-    wget "$URL" -P "$SRC_DIR/$PACKAGE" || exit $ERROR_WGET
-fi
+PKG_SRC="$TMP/$SRC_NAME-$SRC_VERSION"
+CONF_OPTIONS=${CONF_OPTIONS:=""}
+NUMJOBS=${NUMJOBS:="-j4"}
 
-# ------------------  Checa md5sum  -----------------------
-if [ "$SRC_ORIG" = "$SRC" -o "$MD5" != "$MD5_ORIG" -a "$MD5" != "no" ]; then
-    SUM=`md5sum $SOURCE | awk '{print $1}'`
-    [ "$SUM" != "$MD5" ] && exit $ERROR_MD5
-fi
+# Set system libraries' path and optmization flags based on $ARCH
+LIBDIR="$PREFIX/lib"
 
-# -----------------  ARCH e LIBDIR  -----------------------
-# Libdir, para arch x86_64
-LIBDIR=$PREFIX/lib
-# Seleciona flags para o compilador
 if [ "$ARCH" = "i386" ]; then
-    SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+  SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
 elif [ "$ARCH" = "i486" ]; then
-    SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
+  SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
 elif [ "$ARCH" = "i686" ]; then
-    SLKCFLAGS="-O2 -march=i686"
+  SLKCFLAGS="-O2 -march=i686"
 elif [ "$ARCH" = "s390" ]; then
-    SLKCFLAGS="-O2"
+  SLKCFLAGS="-O2"
 elif [ "$ARCH" = "x86_64" ]; then
-    SLKCFLAGS="-O2"
-    LIBDIR="$PREFIX/lib64"
+  SLKCFLAGS="-O2"
+  LIBDIR="$PREFIX/lib64"
+fi
+
+# Set error codes (used by createpkg)
+ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
+ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
+ERROR_TAR=37;       ERROR_MKPKG=38;     ERROR_GPG=39
+ERROR_PATCH=40;     ERROR_VCS=41;       ERROR_MKDIR=42
+
+# Clean up any leftovers of previous builds
+rm -rf "$PKG_SRC" 2> /dev/null
+rm -rf "$PKG" 2> /dev/null
+
+# Create directories if necessary
+mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
+mkdir -p "$PKG" || exit $ERROR_MKDIR
+mkdir -p "$REPOS" || exit $ERROR_MKDIR
+
+# Dowload source if necessary
+SRC="$SRC_NAME-$SRC_VERSION.tar.bz2"
+URL="http://download.videolan.org/pub/libdvdcss/1.2.9/$SRC"
+
+if [ ! -s "$SRC_DIR/$SRC" ] || ! bunzip2 -t "$SRC_DIR/$SRC" 2> /dev/null; then
+  wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
 fi
 
-# --------------  Desempacota fontes  ---------------------
-# Desempacota fontes em PKG_SRC=$TMP/$PACKAGE-source
-PKG_SRC=$TMP/$PACKAGE-source
-rm -rf $PKG_SRC 2>/dev/null
-mkdir -p $PKG_SRC
-# Desempacota $SOURCE em $TMP/$PACKAGE-source
-tar xvf $SOURCE -C $PKG_SRC || exit $ERROR_TAR
-
-# Pega o nome do diretório das fontes independente de sua
-# estrutura (package-version...)
-PKG_DIR="$PKG_SRC/$( ls $PKG_SRC/ )"
-cd $PKG_DIR
-
-# --------------  Configura programa  ---------------------
-# Configura programa
-CFLAGS="$SLKCFLAGS" ./configure --prefix=$PREFIX --libdir=$LIBDIR $OPTCONF || exit $ERROR_CONF
-
-# ----------------  Compila programa  ---------------------
-make -j3 || exit $ERROR_MAKE
-
-# -------------  Diretório Temporário  --------------------
-# Cria diretório temporário para construção do pacote
-PKG=$TMP/$PACKAGE
-rm -rf $PKG
-mkdir -p $PKG
-
-# ---------------  Instala programa  ----------------------
-# Instala programa em diretório temporário
-make install DESTDIR=$PKG || exit $ERROR_INSTALL
-
-# -----------------  Stripa código  -----------------------
-cd $PKG
-find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-
-# ----------------  Cria slack-desc  ----------------------
-mkdir $PKG/install
-cat << EOF > install/slack-desc
+# Untar
+cd "$TMP"
+tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
+cd "$PKG_SRC"
+
+# Configure
+CFLAGS="$SLKCFLAGS" \
+  CXXFLAGS="$SLKCFLAGS" \
+  ./configure \
+  --prefix="$PREFIX" --libdir="$LIBDIR" "$CONF_OPTIONS" || exit $ERROR_CONF
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+make install DESTDIR="$PKG" || exit $ERROR_INSTALL
+
+# Strip binaries
+( cd "$PKG"
+  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Install documentation
+DOCS="NEWS README AUTHORS INSTALL ChangeLog COPYING"
+mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+cp -a $DOCS "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+
+# Add package description (slack-desc)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EODESC > "$PKG/install/slack-desc"
 # HOW TO EDIT THIS FILE:
 # The "handy ruler" below makes it easier to edit a package description.  Line
-# up the first '|' above the ':' following the base package name, and the '|' on
-# the right side marks the last column you can put a character in.  You must make
-# exactly 11 lines for the formatting to be correct.  It's also customary to
-# leave one space after the ':'.
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
 
-          |----handy-ruler------------------------------------------------------|
+         |-----handy-ruler---------------------------------------------------|
 libdvdcss: Libdvdcss.SlackBuild by Rudson R. Alves
 libdvdcss:
-libdvdcss: libdvdcss is part of the VideoLAN project, a full MPEG2 client/server
-libdvdcss: solution. The VideoLAN Client can also be used as a standalone program
-libdvdcss: to play MPEG2 streams from a hard disk or a DVD.
-libdvdcss:
+libdvdcss: libdvdcss is part of the VideoLAN project, a full MPEG2 client/
+libdvdcss: server solution. The VideoLAN Client can also be used as a 
+libdvdcss: standalone program to play MPEG2 streams from a hard disk or a 
+libdvdcss: DVD.
 libdvdcss:
 libdvdcss:
 libdvdcss:
 libdvdcss:
-EOF
-
-# -----------------  Documentações  -----------------------
-# Criar diretório de documentação
-PKG_DOC=$PKG/usr/doc/$PACKAGE-$VERSION
-mkdir -p $PKG_DOC
-cp $PKG_DIR/{AUTHORS,COPYING,ChangeLog,INSTALL,NEWS,README,doc/latex/refman.ps} $PKG_DOC
-mkdir $PKG_DOC/html
-cp $PKG_DIR/doc/html/* $PKG_DOC/html/
-
-# ---------------  Constroi o pacote  ---------------------
-makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG
-
-# -----------  Remove arquivos temporários  ---------------
-if [ "$CLEANUP" = "yes" ]; then
-    rm -rf $PKG $PKG_SRC
+EODESC
+
+# Build the package
+cd "$PKG"
+makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
+
+# Delete source and build directories if requested
+if [ "$CLEANUP" == "yes" ]; then
+  rm -rf "$PKG_SRC" "$PKG"
 fi
+
index f0e2143ed72e2c92b376906b1dbaa679c8e514c1..1c0c44c6e4f83b7922c8786baf1825bb2111ac6c 100755 (executable)
 #!/bin/bash
 #
-# slackbuild for libdvdplay, by Rudson R. Alves
-# requires: none
-# tested: libdvdplay-1.0.1
-
-CWD=`pwd`
+# SlackBuild for libdvdplay
+# http://download.videolan.org/pub/libdvdplay/1.0.1/
+#
+# Author: Rudson R. Alves
+#
 
-# ----  Inicializa variáveis com o slackbuild  ------------
-if [ -e ~/.slackbuildrc ]; then
+# Look for slackbuildrc
+if [ -f ~/.slackbuildrc ]; then
   source ~/.slackbuildrc
-elif [ -e /etc/slackbuildrc ]; then
+elif [ -f /etc/slackbuildrc ]; then
   source /etc/slackbuildrc
 fi
 
-# --------  Variáveis de controle de versão  --------------
-# Nome da fonte para a qual o slackbuild foi construído e
-# o seu md5sum
-SRC_ORIG="libdvdplay-1.0.1.tar.bz2"
-MD5_ORIG="602bca4ef78d79aa87e5e8920d958a78"
-PACKAGE_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\1/'`
-VERSION_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\2/'`
-   EXTENSION=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\3/'`
-
-# -------  Códigos de erro para o createpkg  --------------
-ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
-ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
-ERROR_TAR=37;       ERROR_MKPKG=38;    ERROR_GPG=39
-ERROR_PATCH=40;     ERROR_VCS=41
-
-# ---------  Inicializa variáveis de entrada  -------------
-PACKAGE=$PACKAGE_ORIG
-ARCH=${ARCH:=i486}
-SRC_DIR=${SRC:=$CWD}
-VERSION=${VERSION:=$VERSION_ORIG}
-SRC=$PACKAGE-$VERSION.$EXTENSION
-BUILD=${BUILD:=1rud}
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="libdvdplay"
+PKG_NAME="libdvdplay"
+ARCH=${ARCH:=i468}
+SRC_VERSION=${VERSION:=1.0.1}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1rra}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
 TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
 REPOS=${REPOS:=$TMP}
 PREFIX=${PREFIX:=/usr}
-OPTCONF=${OPTCONF:=""}
-MD5=${MD5:=$MD5_ORIG}
-URL=${URL:="http://download.videolan.org/pub/libdvdplay/$VERSION/$SRC"}
-
-# ----------------  Download fontes  ----------------------
-# Fonte a ser compilada, com o path
-SOURCE=$SRC_DIR/$PACKAGE/$SRC
-# Verifica existência do pacote em $SRC em $SRC_DIR
-if [ ! -e $SOURCE ]; then
-    wget "$URL" -P "$SRC_DIR/$PACKAGE" || exit $ERROR_WGET
-fi
+PKG_SRC="$TMP/$SRC_NAME-$SRC_VERSION"
+CONF_OPTIONS=${CONF_OPTIONS:=""}
+NUMJOBS=${NUMJOBS:="-j4"}
 
-# ------------------  Checa md5sum  -----------------------
-if [ "$SRC_ORIG" = "$SRC" -o "$MD5" != "$MD5_ORIG" -a "$MD5" != "no" ]; then
-    SUM=`md5sum $SOURCE | awk '{print $1}'`
-    [ "$SUM" != "$MD5" ] && exit $ERROR_MD5
-fi
+# Set system libraries' path and optmization flags based on $ARCH
+LIBDIR="$PREFIX/lib"
 
-# -----------------  ARCH e LIBDIR  -----------------------
-# Libdir, para arch x86_64
-LIBDIR=$PREFIX/lib
-# Seleciona flags para o compilador
 if [ "$ARCH" = "i386" ]; then
-    SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+  SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
 elif [ "$ARCH" = "i486" ]; then
-    SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
+  SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
 elif [ "$ARCH" = "i686" ]; then
-    SLKCFLAGS="-O2 -march=i686"
+  SLKCFLAGS="-O2 -march=i686"
 elif [ "$ARCH" = "s390" ]; then
-    SLKCFLAGS="-O2"
+  SLKCFLAGS="-O2"
 elif [ "$ARCH" = "x86_64" ]; then
-    SLKCFLAGS="-O2"
-    LIBDIR="$PREFIX/lib64"
+  SLKCFLAGS="-O2"
+  LIBDIR="$PREFIX/lib64"
 fi
 
-# --------------  Desempacota fontes  ---------------------
-# Desempacota fontes em PKG_SRC=$TMP/$PACKAGE-source
-PKG_SRC=$TMP/$PACKAGE-source
-rm -rf $PKG_SRC 2>/dev/null
-mkdir -p $PKG_SRC
-# Desempacota $SOURCE em $TMP/$PACKAGE-source
-tar xvf $SOURCE -C $PKG_SRC || exit $ERROR_TAR
-
-# Pega o nome do diretório das fontes independente de sua
-# estrutura (package-version...)
-PKG_DIR="$PKG_SRC/$( ls $PKG_SRC/ )"
-cd $PKG_DIR
-
-# --------------  Configura programa  ---------------------
-# Configura programa
-CFLAGS="$SLKCFLAGS" ./configure --prefix=$PREFIX --libdir=$LIBDIR $OPTCONF || exit $ERROR_CONF
-
-# ----------------  Compila programa  ---------------------
-make -j3 || exit $ERROR_MAKE
-
-# -------------  Diretório Temporário  --------------------
-# Cria diretório temporário para construção do pacote
-PKG=$TMP/$PACKAGE
-rm -rf $PKG
-mkdir -p $PKG
-
-# ---------------  Instala programa  ----------------------
-# Instala programa em diretório temporário
-make install DESTDIR=$PKG || exit $ERROR_INSTALL
-
-# -----------------  Stripa código  -----------------------
-cd $PKG
-find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-
-# ----------------  Cria slack-desc  ----------------------
-mkdir $PKG/install
-cat << EOF > install/slack-desc
+# Set error codes (used by createpkg)
+ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
+ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
+ERROR_TAR=37;       ERROR_MKPKG=38;     ERROR_GPG=39
+ERROR_PATCH=40;     ERROR_VCS=41;       ERROR_MKDIR=42
+
+# Clean up any leftovers of previous builds
+rm -rf "$PKG_SRC" 2> /dev/null
+rm -rf "$PKG" 2> /dev/null
+
+# Create directories if necessary
+mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
+mkdir -p "$PKG" || exit $ERROR_MKDIR
+mkdir -p "$REPOS" || exit $ERROR_MKDIR
+
+# Dowload source if necessary
+SRC="$SRC_NAME-$SRC_VERSION.tar.bz2"
+URL="http://download.videolan.org/pub/libdvdplay/1.0.1/$SRC"
+
+if [ ! -s "$SRC_DIR/$SRC" ] || ! bunzip2 -t "$SRC_DIR/$SRC" 2> /dev/null; then
+  wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
+fi
+
+# Untar
+cd "$TMP"
+tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
+cd "$PKG_SRC"
+
+# Configure
+CFLAGS="$SLKCFLAGS" \
+  CXXFLAGS="$SLKCFLAGS" \
+  ./configure \
+  --prefix="$PREFIX" --libdir="$LIBDIR" "$CONF_OPTIONS" || exit $ERROR_CONF
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+make install DESTDIR="$PKG" || exit $ERROR_INSTALL
+
+# Strip binaries
+( cd "$PKG"
+  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Install documentation
+DOCS="NEWS TODO README THANKS AUTHORS INSTALL ChangeLog COPYING"
+mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+cp -a $DOCS "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+
+# Add package description (slack-desc)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EODESC > "$PKG/install/slack-desc"
 # HOW TO EDIT THIS FILE:
 # The "handy ruler" below makes it easier to edit a package description.  Line
-# up the first '|' above the ':' following the base package name, and the '|' on
-# the right side marks the last column you can put a character in.  You must make
-# exactly 11 lines for the formatting to be correct.  It's also customary to
-# leave one space after the ':'.
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
 
-          |----handy-ruler------------------------------------------------------|
-libdvdplay: libdvdplay.SlackBuild by Rudson R. Alves
+          |-----handy-ruler--------------------------------------------------|
+libdvdplay: libdvdplay.SlackBuild by Slack.Sarava
 libdvdplay:
-libdvdplay: libdvdplay is an attempt to make a library from ogle dvd navigation
-libdvdplay: code so that a simple API provides access to both DVD Video data
-libdvdplay: and DVD information to a reader application.
+libdvdplay: libdvdplay is an attempt to make a library from ogle dvd 
+libdvdplay: navigation code so that a simple API provides access to both DVD
+libdvdplay: Video data and DVD information to a reader application.
 libdvdplay:
-libdvdplay: libdvdplay is a layer over libdvdread. As a consequence it provides
-libdvdplay: read, seek for DVD media. But it also provides the client
-libdvdplay: application with a set of access functions needed to create an
-libdvdplay: interface for the DVD reader (audio, subtitles, titles ...).
-EOF
-
-# -----------------  Documentações  -----------------------
-# Criar diretório de documentação
-PKG_DOC=$PKG/usr/doc/$PACKAGE-$VERSION
-mkdir -p $PKG_DOC
-cp $PKG_DIR/{AUTHORS,COPYING,ChangeLog,INSTALL,NEWS,README,THANKS,TODO} $PKG_DOC
-
-# ---------------  Constroi o pacote  ---------------------
-makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG
-
-# -----------  Remove arquivos temporários  ---------------
-if [ "$CLEANUP" = "yes" ]; then
-    echo -e "\n\n\033[01;32m Remove files... \n\033[m"
-    rm -rf $PKG $PKG_SRC
+libdvdplay: libdvdplay is a layer over libdvdread. As a consequence it
+libdvdplay: provides read, seek for DVD media. But it also provides the 
+libdvdplay: client application with a set of access functions needed to 
+libdvdplay: create an interface for the DVD reader (audio, subtitles, ...).
+EODESC
+
+# Build the package
+cd "$PKG"
+makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
+
+# Delete source and build directories if requested
+if [ "$CLEANUP" == "yes" ]; then
+  rm -rf "$PKG_SRC" "$PKG"
 fi
+
index 2539ecbda257aed0253acd08cdd1dda1e607129a..a8a677628cfcd68b873f77581e99904b92257815 100644 (file)
@@ -1 +1,4 @@
+# Dependency list to libdvdplay
+# 
+# dependency [condition] [version]]
 libdvdread
index 741f85b26b4b33e22c6dd89e91b0387b8d678335..96de4932045b7af1db18a1159894f4119590ed91 100755 (executable)
 #!/bin/bash
 #
-# slackbuild for libdvdread, by Rudson R. Alves
-# requires: none
-# tested: libdvdread-0.9.7
-
-CWD=`pwd`
+# SlackBuild for libdvdread
+# http://freshmeat.net/redir/libdvdread/17926/url_tgz/
+#
+# Author: Rudson R. Alves
+#
 
-# ----  Inicializa variáveis com o slackbuild  ------------
-if [ -e ~/.slackbuildrc ]; then
+# Look for slackbuildrc
+if [ -f ~/.slackbuildrc ]; then
   source ~/.slackbuildrc
-elif [ -e /etc/slackbuildrc ]; then
+elif [ -f /etc/slackbuildrc ]; then
   source /etc/slackbuildrc
 fi
 
-# --------  Variáveis de controle de versão  --------------
-# Nome da fonte para a qual o slackbuild foi construído e
-# o seu md5sum
-SRC_ORIG="libdvdread-0.9.7.tar.gz"
-MD5_ORIG="078788c9241ae16763529e1235502337"
-PACKAGE_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\1/'`
-VERSION_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\2/'`
-   EXTENSION=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\3/'`
-
-# -------  Códigos de erro para o createpkg  --------------
-ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
-ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
-ERROR_TAR=37;       ERROR_MKPKG=38;     ERROR_GPG=39
-ERROR_PATCH=40;     ERROR_VCS=41
-
-# ---------  Inicializa variáveis de entrada  -------------
-PACKAGE=$PACKAGE_ORIG
-ARCH=${ARCH:=i486}
-SRC_DIR=${SRC:=$CWD}
-VERSION=${VERSION:=$VERSION_ORIG}
-SRC=$PACKAGE-$VERSION.$EXTENSION
-BUILD=${BUILD:=1rud}
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="libdvdread"
+PKG_NAME="libdvdread"
+ARCH=${ARCH:=i468}
+SRC_VERSION=${VERSION:=0.9.7}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1rra}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
 TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
 REPOS=${REPOS:=$TMP}
 PREFIX=${PREFIX:=/usr}
-OPTCONF=${OPTCONF:=""}
-MD5=${MD5:=$MD5_ORIG}
-URL=${URL:="http://freshmeat.net/redir/libdvdread/17926/url_tgz/$SRC"}
-
-# ----------------  Download fontes  ----------------------
-# Fonte a ser compilada, com o path
-SOURCE=$SRC_DIR/$PACKAGE/$SRC
-# Verifica existência do pacote em $SRC em $SRC_DIR
-if [ ! -e $SOURCE ]; then
-    wget "$URL" -P "$SRC_DIR/$PACKAGE" || exit $ERROR_WGET
-fi
+PKG_SRC="$TMP/$SRC_NAME-$SRC_VERSION"
+CONF_OPTIONS=${CONF_OPTIONS:=""}
+NUMJOBS=${NUMJOBS:="-j4"}
 
-# ------------------  Checa md5sum  -----------------------
-if [ "$SRC_ORIG" = "$SRC" -o "$MD5" != "$MD5_ORIG" -a "$MD5" != "no" ]; then
-    SUM=`md5sum $SOURCE | awk '{print $1}'`
-    [ "$SUM" != "$MD5" ] && exit $ERROR_MD5
-fi
+# Set system libraries' path and optmization flags based on $ARCH
+LIBDIR="$PREFIX/lib"
 
-# -----------------  ARCH e LIBDIR  -----------------------
-# Libdir, para arch x86_64
-LIBDIR=$PREFIX/lib
-# Seleciona flags para o compilador
 if [ "$ARCH" = "i386" ]; then
-    SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+  SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
 elif [ "$ARCH" = "i486" ]; then
-    SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
+  SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
 elif [ "$ARCH" = "i686" ]; then
-    SLKCFLAGS="-O2 -march=i686"
+  SLKCFLAGS="-O2 -march=i686"
 elif [ "$ARCH" = "s390" ]; then
-    SLKCFLAGS="-O2"
+  SLKCFLAGS="-O2"
 elif [ "$ARCH" = "x86_64" ]; then
-    SLKCFLAGS="-O2"
-    LIBDIR="$PREFIX/lib64"
+  SLKCFLAGS="-O2"
+  LIBDIR="$PREFIX/lib64"
+fi
+
+# Set error codes (used by createpkg)
+ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
+ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
+ERROR_TAR=37;       ERROR_MKPKG=38;     ERROR_GPG=39
+ERROR_PATCH=40;     ERROR_VCS=41;       ERROR_MKDIR=42
+
+# Clean up any leftovers of previous builds
+rm -rf "$PKG_SRC" 2> /dev/null
+rm -rf "$PKG" 2> /dev/null
+
+# Create directories if necessary
+mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
+mkdir -p "$PKG" || exit $ERROR_MKDIR
+mkdir -p "$REPOS" || exit $ERROR_MKDIR
+
+# Dowload source if necessary
+SRC="$SRC_NAME-$SRC_VERSION.tar.gz"
+URL="http://freshmeat.net/redir/libdvdread/17926/url_tgz/$SRC"
+
+if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then
+  wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
 fi
 
-# --------------  Desempacota fontes  ---------------------
-# Desempacota fontes em PKG_SRC=$TMP/$PACKAGE-source
-PKG_SRC=$TMP/$PACKAGE-source
-rm -rf $PKG_SRC 2>/dev/null
-mkdir -p $PKG_SRC
-# Desempacota $SOURCE em $TMP/$PACKAGE-source
-tar xvf $SOURCE -C $PKG_SRC || exit $ERROR_TAR
-
-# Pega o nome do diretório das fontes independente de sua
-# estrutura (package-version...)
-PKG_DIR="$PKG_SRC/$( ls $PKG_SRC/ )"
-cd $PKG_DIR
-
-# --------------  Configura programa  ---------------------
-# Configura programa
-CFLAGS="$SLKCFLAGS" ./configure --prefix=$PREFIX --libdir=$LIBDIR $OPTCONF --with-libdvdcss || exit $ERROR_CONF
-
-# ----------------  Compila programa  ---------------------
-make -j3 || exit $ERROR_MAKE
-
-# -------------  Diretório Temporário  --------------------
-# Cria diretório temporário para construção do pacote
-PKG=$TMP/$PACKAGE
-rm -rf $PKG
-mkdir -p $PKG
-
-# ---------------  Instala programa  ----------------------
-# Instala programa em diretório temporário
-make install DESTDIR=$PKG || exit $ERROR_INSTALL
-
-# -----------------  Stripa código  -----------------------
-cd $PKG
-find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-
-# ----------------  Cria slack-desc  ----------------------
-mkdir $PKG/install
-cat << EOF > install/slack-desc
+# Untar
+cd "$TMP"
+tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
+cd "$PKG_SRC"
+
+# Configure
+CFLAGS="$SLKCFLAGS" \
+  CXXFLAGS="$SLKCFLAGS" \
+  ./configure \
+  --prefix="$PREFIX" --libdir="$LIBDIR" "$CONF_OPTIONS" || exit $ERROR_CONF
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+make install DESTDIR="$PKG" || exit $ERROR_INSTALL
+
+# Strip binaries
+( cd "$PKG"
+  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Install documentation
+DOCS="NEWS TODO README AUTHORS INSTALL ChangeLog COPYING"
+mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+cp -a $DOCS "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+
+# Add package description (slack-desc)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EODESC > "$PKG/install/slack-desc"
 # HOW TO EDIT THIS FILE:
 # The "handy ruler" below makes it easier to edit a package description.  Line
-# up the first '|' above the ':' following the base package name, and the '|' on
-# the right side marks the last column you can put a character in.  You must make
-# exactly 11 lines for the formatting to be correct.  It's also customary to
-# leave one space after the ':'.
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
 
-          |----handy-ruler------------------------------------------------------|
-libdvdread: libdvdread.SlackBuild by Rudson R. Alves
+          |-----handy-ruler--------------------------------------------------|
+libdvdread: libdvdread.SlackBuild by Slack.Sarava
 libdvdread:
 libdvdread: libdvdread provides a simple foundation for reading DVD-Video
 libdvdread: images. It offers DVD applications:
@@ -129,19 +120,14 @@ libdvdread: 3. A simple library for parsing the navigation (NAV) packets
 libdvdread:
 libdvdread: This allows application designers to access some of the more
 libdvdread: advanced features of the DVD format.
-EOF
+EODESC
 
-# -----------------  Documentações  -----------------------
-# Criar diretório de documentação
-PKG_DOC=$PKG/usr/doc/$PACKAGE-$VERSION
-mkdir -p $PKG_DOC
-cp $PKG_DIR/{AUTHORS,COPYING,ChangeLog,INSTALL,NEWS,README,TODO} $PKG_DOC
+# Build the package
+cd "$PKG"
+makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
 
-# ---------------  Constroi o pacote  ---------------------
-makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG
-
-# -----------  Remove arquivos temporários  ---------------
-if [ "$CLEANUP" = "yes" ]; then
-    echo -e "\n\n\033[01;32m Remove files... \n\033[m"
-    rm -rf $PKG $PKG_SRC
+# Delete source and build directories if requested
+if [ "$CLEANUP" == "yes" ]; then
+  rm -rf "$PKG_SRC" "$PKG"
 fi
+
index 2a9cfbbcc8d16ed216161df8a6988698210367d9..222538773bfe4f74ae8ec2e88cc2f1dd3c5d9575 100644 (file)
@@ -1 +1,4 @@
+# Dependency list to libdvdread
+# 
+# dependency [condition] [version]]
 libdvdcss
diff --git a/media/libs/sdl-image/sdl-image.SlackBuild b/media/libs/sdl-image/sdl-image.SlackBuild
new file mode 100755 (executable)
index 0000000..f7c88da
--- /dev/null
@@ -0,0 +1,134 @@
+#!/bin/bash
+#
+# SlackBuild for sdl_image
+# http://www.libsdl.org/projects/SDL_image/release/
+#
+# Author: Rudson R. Alves
+#
+
+# Look for slackbuildrc
+if [ -f ~/.slackbuildrc ]; then
+  source ~/.slackbuildrc
+elif [ -f /etc/slackbuildrc ]; then
+  source /etc/slackbuildrc
+fi
+
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="SDL_image"
+PKG_NAME="sdl_image"
+ARCH=${ARCH:=i468}
+SRC_VERSION=${VERSION:=1.2.5}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1rra}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
+TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
+REPOS=${REPOS:=$TMP}
+PREFIX=${PREFIX:=/usr}
+PKG_SRC="$TMP/$SRC_NAME-$SRC_VERSION"
+CONF_OPTIONS=${CONF_OPTIONS:=""}
+NUMJOBS=${NUMJOBS:="-j4"}
+
+# Set system libraries' path and optmization flags based on $ARCH
+LIBDIR="$PREFIX/lib"
+
+if [ "$ARCH" = "i386" ]; then
+  SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+elif [ "$ARCH" = "i486" ]; then
+  SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
+elif [ "$ARCH" = "i686" ]; then
+  SLKCFLAGS="-O2 -march=i686"
+elif [ "$ARCH" = "s390" ]; then
+  SLKCFLAGS="-O2"
+elif [ "$ARCH" = "x86_64" ]; then
+  SLKCFLAGS="-O2"
+  LIBDIR="$PREFIX/lib64"
+fi
+
+# Set error codes (used by createpkg)
+ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
+ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
+ERROR_TAR=37;       ERROR_MKPKG=38;     ERROR_GPG=39
+ERROR_PATCH=40;     ERROR_VCS=41;       ERROR_MKDIR=42
+
+# Clean up any leftovers of previous builds
+rm -rf "$PKG_SRC" 2> /dev/null
+rm -rf "$PKG" 2> /dev/null
+
+# Create directories if necessary
+mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
+mkdir -p "$PKG" || exit $ERROR_MKDIR
+mkdir -p "$REPOS" || exit $ERROR_MKDIR
+
+# Dowload source if necessary
+SRC="$SRC_NAME-$SRC_VERSION.tar.gz"
+URL="http://www.libsdl.org/projects/SDL_image/release/$SRC"
+
+if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then
+  wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
+fi
+
+# Untar
+cd "$TMP"
+tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
+cd "$PKG_SRC"
+
+# Configure
+CFLAGS="$SLKCFLAGS" \
+  CXXFLAGS="$SLKCFLAGS" \
+  ./configure \
+  --prefix="$PREFIX" --libdir="$LIBDIR" "$CONF_OPTIONS" || exit $ERROR_CONF
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+make install DESTDIR="$PKG" || exit $ERROR_INSTALL
+
+# Strip binaries
+( cd "$PKG"
+  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Install documentation
+DOCS="README COPYING"
+mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+cp -a $DOCS "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+
+# Add package description (slack-desc)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EODESC > "$PKG/install/slack-desc"
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+   _     |-----handy-ruler---------------------------------------------------|
+sdl_image: SDL_image 1.2 by Slack.Sarava
+sdl_image: 
+sdl_image: This is a simple library to load images of various formats as SDL 
+sdl_image: surfaces.
+sdl_image: 
+sdl_image: This library supports BMP, PNM (PPM/PGM/PBM), XPM, LBM, PCX, GIF,
+sdl_image: JPEG, PNG, TGA, and TIFF formats.
+sdl_image: 
+sdl_image: 
+sdl_image: 
+sdl_image: 
+EODESC
+
+# Build the package
+cd "$PKG"
+makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
+
+# Delete source and build directories if requested
+if [ "$CLEANUP" == "yes" ]; then
+  rm -rf "$PKG_SRC" "$PKG"
+fi
+
diff --git a/media/libs/sdl-image/slack-required b/media/libs/sdl-image/slack-required
new file mode 100644 (file)
index 0000000..fe5707e
--- /dev/null
@@ -0,0 +1,5 @@
+# Dependency list to sdl_image
+# 
+# dependency [condition] [version]]
+sdl
+
index c258709978164c48f3a6197375f4f395555136fb..ccb4f0294d6728a7463a01e39cf9992d2ceed9c8 100755 (executable)
 #!/bin/bash
 #
-# slackbuild for lame, by Rudson R. Alves
-# requires: none
-# tested: lame-3.97b3
-
-CWD=`pwd`
+# SlackBuild for lame
+# http://downloads.sourceforge.net/lame/
+#
+# Author: Rudson R. Alves
+#
 
-if [ -e ~/.slackbuildrc ]; then
+# Look for slackbuildrc
+if [ -f ~/.slackbuildrc ]; then
   source ~/.slackbuildrc
-elif [ -e /etc/slackbuildrc ]; then
+elif [ -f /etc/slackbuildrc ]; then
   source /etc/slackbuildrc
 fi
 
-# --------  Variáveis de controle de versão  --------------
-# Nome da fonte para a qual o slackbuild foi construído e
-# o seu md5sum
-SRC_ORIG="lame-3.97.tar.gz"
-#MD5_ORIG=""
-PACKAGE_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\1/'`
-VERSION_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\2/'`
-   EXTENSION=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\3/'`
-# Correçar para VERSION beta...
-VERSION_ORIG=`echo ${VERSION_ORIG/b*}`
-
-# -------  Códigos de erro para o createpkg  --------------
-ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
-ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
-ERROR_TAR=37;       ERROR_MKPKG=38;     ERROR_GPG=39
-ERROR_PATCH=40;     ERROR_VCS=41
-
-# ---------  Inicializa variáveis de entrada  -------------
-PACKAGE=$PACKAGE_ORIG
-ARCH=${ARCH:=i486}
-SRC_DIR=${SRC:=$CWD}
-if [ "$VERSION" != "" ]; then
-    # Constroi nome do pacote
-    SRC=$PACKAGE"/root-$VERSION.$EXTENSION"
-else
-    # Remove nome e versão do pacote
-    SRC=$SRC_ORIG
-    VERSION=$VERSION_ORIG
-fi
-BUILD=${BUILD:=1rud}
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="lame"
+PKG_NAME="lame"
+ARCH=${ARCH:=i468}
+SRC_VERSION=${VERSION:=3.97}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1rra}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
 TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
 REPOS=${REPOS:=$TMP}
 PREFIX=${PREFIX:=/usr}
-OPTCONF=${OPTCONF:=""}
-MD5=${MD5:=$MD5_ORIG}
-URL=${URL:="http://superb-west.dl.sourceforge.net/sourceforge/lame/$SRC"}
-
-# ----------------  Download fontes  ----------------------
-# Fonte a ser compilada, com o path
-SOURCE=$SRC_DIR/$PACKAGE/$SRC
-# Verifica existência do pacote $SRC em $SRC_DIR
-if [ ! -e $SOURCE ]; then
-    wget "$URL" -P "$SRC_DIR/$PACKAGE/" || exit $ERROR_WGET
-fi
+PKG_SRC="$TMP/$SRC_NAME-$SRC_VERSION"
+CONF_OPTIONS=${CONF_OPTIONS:=""}
+NUMJOBS=${NUMJOBS:="-j4"}
 
-# ------------------  Checa md5sum  -----------------------
-#if [ "$SRC_ORIG" = "$SRC" -o "$MD5" != "$MD5_ORIG" -a "$MD5" != "no" ]; then
-#    SUM=`md5sum $SOURCE | awk '{print $1}'`
-#    [ "$SUM" != "$MD5" ] && exit $ERROR_MD5
-#fi
+# Set system libraries' path and optmization flags based on $ARCH
+LIBDIR="$PREFIX/lib"
 
-# -----------------  ARCH e LIBDIR  -----------------------
-# Libdir, para arch x86_64
-LIBDIR=$PREFIX/lib
-# Seleciona flags para o compilador
 if [ "$ARCH" = "i386" ]; then
-    SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+  SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
 elif [ "$ARCH" = "i486" ]; then
-    SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
+  SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
 elif [ "$ARCH" = "i686" ]; then
-    SLKCFLAGS="-O2 -march=i686"
+  SLKCFLAGS="-O2 -march=i686"
 elif [ "$ARCH" = "s390" ]; then
-    SLKCFLAGS="-O2"
+  SLKCFLAGS="-O2"
 elif [ "$ARCH" = "x86_64" ]; then
-    SLKCFLAGS="-O2"
-    LIBDIR="$PREFIX/lib64"
+  SLKCFLAGS="-O2"
+  LIBDIR="$PREFIX/lib64"
 fi
 
-# --------------  Desempacota fontes  ---------------------
-# Desempacota fontes em PKG_SRC=$TMP/$PACKAGE-source
-PKG_SRC=$TMP/$PACKAGE-source
-rm -rf $PKG_SRC 2>/dev/null
-mkdir -p $PKG_SRC
-# Desempacota $SOURCE em $TMP/$PACKAGE-source
-tar xvf $SOURCE -C $PKG_SRC || exit $ERROR_TAR
-
-# Pega o nome do diretório das fontes independente de sua
-# estrutura (package-version...)
-PKG_DIR="$PKG_SRC/$( ls $PKG_SRC/ )"
-cd $PKG_DIR
-
-# --------------  Configura programa  ---------------------
-# Configura programa
-CFLAGS="$SLKCFLAGS" ./configure --prefix=$PREFIX --libdir=$LIBDIR $OPTCONF || exit $ERROR_CONF
-
-# ----------------  Compila programa  ---------------------
-make || exit $ERROR_MAKE
-
-# -------------  Diretório Temporário  --------------------
-# Cria diretório temporário para construção do pacote
-PKG=$TMP/$PACKAGE
-rm -rf $PKG
-mkdir -p $PKG
-
-# ---------------  Instala programa  ----------------------
-# Instala programa em diretório temporário
-make install DESTDIR=$PKG || exit $ERROR_INSTALL
-
-# ------------------- gzip manuais ------------------------
-gzip -r $PKG/$PREFIX/man/*
-
-# -----------------  Stripa código  -----------------------
-cd $PKG
-find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-
-# ----------------  Cria slack-desc  ----------------------
-mkdir $PKG/install
-cat << EOF > $PKG/install/slack-desc
+# Set error codes (used by createpkg)
+ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
+ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
+ERROR_TAR=37;       ERROR_MKPKG=38;     ERROR_GPG=39
+ERROR_PATCH=40;     ERROR_VCS=41;       ERROR_MKDIR=42
+
+# Clean up any leftovers of previous builds
+rm -rf "$PKG_SRC" 2> /dev/null
+rm -rf "$PKG" 2> /dev/null
+
+# Create directories if necessary
+mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
+mkdir -p "$PKG" || exit $ERROR_MKDIR
+mkdir -p "$REPOS" || exit $ERROR_MKDIR
+
+# Dowload source if necessary
+SRC="$SRC_NAME-$SRC_VERSION.tar.gz"
+URL="http://downloads.sourceforge.net/lame/$SRC"
+
+if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then
+  wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
+fi
+
+# Untar
+cd "$TMP"
+tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
+cd "$PKG_SRC"
+
+# Configure
+CFLAGS="$SLKCFLAGS" \
+  CXXFLAGS="$SLKCFLAGS" \
+  ./configure \
+  --prefix="$PREFIX" --libdir="$LIBDIR" "$CONF_OPTIONS" || exit $ERROR_CONF
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+make install DESTDIR="$PKG" || exit $ERROR_INSTALL
+
+# Strip binaries
+( cd "$PKG"
+  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Install documentation
+DOCS="API TODO USAGE LICENSE README HACKING INSTALL.configure INSTALL README.WINGTK ChangeLog DEFINES COPYING STYLEGUIDE"
+mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+cp -a $DOCS "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+
+# Add package description (slack-desc)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EODESC > "$PKG/install/slack-desc"
 # HOW TO EDIT THIS FILE:
 # The "handy ruler" below makes it easier to edit a package description.  Line
-# up the first '|' above the ':' following the base package name, and the '|' on
-# the right side marks the last column you can put a character in.  You must make
-# exactly 11 lines for the formatting to be correct.  It's also customary to
-# leave one space after the ':'.
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
 
-     |--------handy-ruler-----------------------------------------------------|
+    |-----handy-ruler--------------------------------------------------------|
 lame: LAME package by Rudson R. Alves <rudsonalves[a]yahoo.com.br>
 lame:
 lame: LAME is an LGPL MP3 encoder. The Open source development model allowed
@@ -140,18 +121,14 @@ lame: LAME is able to encode your music using one of its 3 encoding modes:
 lame: constant  bitrate  (CBR),  average  bitrate (ABR) and variable bitrate
 lame: (VBR).
 lame:
-EOF
+EODESC
 
-# -----------------  Documentações  -----------------------
-# Criar diretório de documentação
-PKG_DOC=$PKG/usr/doc/$PACKAGE-$VERSION
-mkdir -p $PKG_DOC
-cp $PKG_DIR/{API,COPYING,ChangeLog,DEFINES,HACKING,INSTALL,LICENSE,README,README.WINGTK,STYLEGUIDE,TODO,USAGE} $PKG_DOC
+# Build the package
+cd "$PKG"
+makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
 
-# ---------------  Constroi o pacote  ---------------------
-makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG
-
-# -----------  Remove arquivos temporários  ---------------
-if [ "$CLEANUP" = "yes" ]; then
-    rm -rf $PKG $PKG_SRC
+# Delete source and build directories if requested
+if [ "$CLEANUP" == "yes" ]; then
+  rm -rf "$PKG_SRC" "$PKG"
 fi
+
index 14d3b44c585bb3a680165fd4f6b98b867ec9a3f9..d25db5227021c47c7190a3c9c1de5f4da783c222 100755 (executable)
 #!/bin/bash
 #
-# slackbuild for dvdauthor, by Rudson R. Alves
-# requires: none
-# tested: dvdauthor-0.6.13, 0.6.14
-
-CWD=`pwd`
+# SlackBuild for dvdauthor
+# http://downloads.sourceforge.net/dvdauthor/
+#
+# Author: Rudson R. Alves
+#
 
-# ----  Inicializa variáveis com o slackbuild  ------------
-if [ -e ~/.slackbuildrc ]; then
+# Look for slackbuildrc
+if [ -f ~/.slackbuildrc ]; then
   source ~/.slackbuildrc
-elif [ -e /etc/slackbuildrc ]; then
+elif [ -f /etc/slackbuildrc ]; then
   source /etc/slackbuildrc
 fi
 
-# --------  Variáveis de controle de versão  --------------
-# Nome da fonte para a qual o slackbuild foi construído e
-# o seu md5sum
-SRC_ORIG="dvdauthor-0.6.14.tar.gz"
-#MD5_ORIG=""
-PACKAGE_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\1/'`
-VERSION_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\2/'`
-   EXTENSION=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\3/'`
-
-# -------  Códigos de erro para o createpkg  --------------
-ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
-ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
-ERROR_TAR=37;       ERROR_MKPKG=38;    ERROR_GPG=39
-ERROR_PATCH=40;     ERROR_VCS=41
-
-# ---------  Inicializa variáveis de entrada  -------------
-PACKAGE=$PACKAGE_ORIG
-ARCH=${ARCH:=i486}
-SRC_DIR=${SRC:=$CWD}
-VERSION=${VERSION:=$VERSION_ORIG}
-SRC=$PACKAGE-$VERSION.$EXTENSION
-BUILD=${BUILD:=1rud}
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="dvdauthor"
+PKG_NAME="dvdauthor"
+ARCH=${ARCH:=i468}
+SRC_VERSION=${VERSION:=0.6.14}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1rra}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
 TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
 REPOS=${REPOS:=$TMP}
 PREFIX=${PREFIX:=/usr}
-OPTCONF=${OPTCONF:=""}
-MD5=${MD5:=$MD5_ORIG}
-URL=${URL:="http://superb-west.dl.sourceforge.net/sourceforge/dvdauthor/$SRC"}
-
-# ----------------  Download fontes  ----------------------
-# Fonte a ser compilada, com o path
-SOURCE=$SRC_DIR/$PACKAGE/$SRC
-# Verifica existência do pacote em $SRC em $SRC_DIR
-if [ ! -e $SOURCE ]; then
-    wget "$URL" -P "$SRC_DIR/$PACKAGE" || exit $ERROR_WGET
-fi
+PKG_SRC="$TMP/$SRC_NAME-$SRC_VERSION"
+CONF_OPTIONS=${CONF_OPTIONS:=""}
+NUMJOBS=${NUMJOBS:="-j4"}
 
-# ------------------  Checa md5sum  -----------------------
-#if [ "$SRC_ORIG" = "$SRC" -o "$MD5" != "$MD5_ORIG" -a "$MD5" != "no" ]; then
-#    SUM=`md5sum $SOURCE | awk '{print $1}'`
-#    [ "$SUM" != "$MD5" ] && exit $ERROR_MD5
-#fi
+# Set system libraries' path and optmization flags based on $ARCH
+LIBDIR="$PREFIX/lib"
 
-# -----------------  ARCH e LIBDIR  -----------------------
-# Libdir, para arch x86_64
-LIBDIR=$PREFIX/lib
-# Seleciona flags para o compilador
 if [ "$ARCH" = "i386" ]; then
-    SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+  SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
 elif [ "$ARCH" = "i486" ]; then
-    SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
+  SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
 elif [ "$ARCH" = "i686" ]; then
-    SLKCFLAGS="-O2 -march=i686"
+  SLKCFLAGS="-O2 -march=i686"
 elif [ "$ARCH" = "s390" ]; then
-    SLKCFLAGS="-O2"
+  SLKCFLAGS="-O2"
 elif [ "$ARCH" = "x86_64" ]; then
-    SLKCFLAGS="-O2"
-    LIBDIR="$PREFIX/lib64"
+  SLKCFLAGS="-O2"
+  LIBDIR="$PREFIX/lib64"
 fi
 
-# --------------  Desempacota fontes  ---------------------
-# Desempacota fontes em PKG_SRC=$TMP/$PACKAGE-source
-PKG_SRC=$TMP/$PACKAGE-source
-rm -rf $PKG_SRC 2>/dev/null
-mkdir -p $PKG_SRC
-# Desempacota $SOURCE em $TMP/$PACKAGE-source
-tar xvf $SOURCE -C $PKG_SRC || exit $ERROR_TAR
-
-# Pega o nome do diretório das fontes independente de sua
-# estrutura (package-version...)
-PKG_DIR="$PKG_SRC/$( ls $PKG_SRC/ )"
-cd $PKG_DIR
-
-# --------------  Configura programa  ---------------------
-# Configura programa
-CFLAGS="$SLKCFLAGS" ./configure --prefix=$PREFIX --libdir=$LIBDIR $OPTCONF || exit $ERROR_CONF
-
-# ----------------  Compila programa  ---------------------
-make -j3 || exit $ERROR_MAKE
-
-# -------------  Diretório Temporário  --------------------
-# Cria diretório temporário para construção do pacote
-PKG=$TMP/$PACKAGE
-rm -rf $PKG
-mkdir -p $PKG
-
-# ---------------  Instala programa  ----------------------
-# Instala programa em diretório temporário
-make install DESTDIR=$PKG || exit $ERROR_INSTALL
-
-# ------------------- gzip manuais ------------------------
-gzip -r $PKG/$PREFIX/man/*
-
-# -----------------  Stripa código  -----------------------
-cd $PKG
-find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-
-# ----------------  Cria slack-desc  ----------------------
-mkdir $PKG/install
-cat << EOF > install/slack-desc
+# Set error codes (used by createpkg)
+ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
+ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
+ERROR_TAR=37;       ERROR_MKPKG=38;     ERROR_GPG=39
+ERROR_PATCH=40;     ERROR_VCS=41;       ERROR_MKDIR=42
+
+# Clean up any leftovers of previous builds
+rm -rf "$PKG_SRC" 2> /dev/null
+rm -rf "$PKG" 2> /dev/null
+
+# Create directories if necessary
+mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
+mkdir -p "$PKG" || exit $ERROR_MKDIR
+mkdir -p "$REPOS" || exit $ERROR_MKDIR
+
+# Dowload source if necessary
+SRC="$SRC_NAME-$SRC_VERSION.tar.gz"
+URL="http://downloads.sourceforge.net/dvdauthor/$SRC"
+
+if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then
+  wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
+fi
+
+# Untar
+cd "$TMP"
+tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
+cd "$PKG_SRC"
+
+# Configure
+CFLAGS="$SLKCFLAGS" \
+  CXXFLAGS="$SLKCFLAGS" \
+  ./configure \
+  --prefix="$PREFIX" --libdir="$LIBDIR" "$CONF_OPTIONS" || exit $ERROR_CONF
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+make install DESTDIR="$PKG" || exit $ERROR_INSTALL
+
+# Strip binaries
+( cd "$PKG"
+  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Install documentation
+DOCS="NEWS TODO README AUTHORS INSTALL ChangeLog COPYING"
+mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+cp -a $DOCS "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+
+# Add package description (slack-desc)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EODESC > "$PKG/install/slack-desc"
 # HOW TO EDIT THIS FILE:
 # The "handy ruler" below makes it easier to edit a package description.  Line
-# up the first '|' above the ':' following the base package name, and the '|' on
-# the right side marks the last column you can put a character in.  You must make
-# exactly 11 lines for the formatting to be correct.  It's also customary to
-# leave one space after the ':'.
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
 
-          |----handy-ruler------------------------------------------------------|
+         |-----handy-ruler---------------------------------------------------|
 dvdauthor: dvdauthor.SlackBuild by Rudson R. Alves
 dvdauthor:
 dvdauthor: dvdauthor is a program that will generate a DVD movie from a valid
@@ -132,18 +120,14 @@ dvdauthor: packets.  These can be generated by passing '-f 8' to mplex.  See
 dvdauthor: the included utility makevob.
 dvdauthor:
 dvdauthor:
-EOF
+EODESC
 
-# -----------------  Documentações  -----------------------
-# Criar diretório de documentação
-PKG_DOC=$PKG/usr/doc/$PACKAGE-$VERSION
-mkdir -p $PKG_DOC
-cp $PKG_DIR/{AUTHORS,COPYING,ChangeLog,INSTALL,NEWS,README,TODO} $PKG_DOC
+# Build the package
+cd "$PKG"
+makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
 
-# ---------------  Constroi o pacote  ---------------------
-makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG
-
-# -----------  Remove arquivos temporários  ---------------
-if [ "$CLEANUP" = "yes" ]; then
-    rm -rf $PKG $PKG_SRC
+# Delete source and build directories if requested
+if [ "$CLEANUP" == "yes" ]; then
+  rm -rf "$PKG_SRC" "$PKG"
 fi
+
index 2539ecbda257aed0253acd08cdd1dda1e607129a..d7075b538280f8af21261adf9c5c5aa6bd3ebcb5 100644 (file)
@@ -1 +1,4 @@
+# Dependency list to dvdauthor
+# 
+# dependency [condition] [version]]
 libdvdread
index a84acbb11bf1205a359280a5df40dd461a98fa82..f2294b405429cd7a60cb437cbe1ae17a1ad55976 100755 (executable)
 #!/bin/bash
 #
-# slackbuild for lame, by Rudson R. Alves
-# requires: none
-# tested: grace-5.1.20
-
-CWD=`pwd`
+# SlackBuild for grace
+# ftp://plasma-gate.weizmann.ac.il/pub/grace/src/grace5/
+#
+# Author: Rudson R. Alves
+#
 
-if [ -e ~/.slackbuildrc ]; then
+# Look for slackbuildrc
+if [ -f ~/.slackbuildrc ]; then
   source ~/.slackbuildrc
-elif [ -e /etc/slackbuildrc ]; then
+elif [ -f /etc/slackbuildrc ]; then
   source /etc/slackbuildrc
 fi
 
-# --------  Variáveis de controle de versão  --------------
-# Nome da fonte para a qual o slackbuild foi construído e
-# o seu md5sum
-SRC_ORIG="grace-5.1.20.tar.gz"
-MD5_ORIG="37bdb28b9e30b8e5061ed3f8e0ab9168"
-PACKAGE_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\1/'`
-VERSION_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\2/'`
-   EXTENSION=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)\.(.*\..*)$/\3/'`
-
-# -------  Códigos de erro para o createpkg  --------------
-ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
-ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
-ERROR_TAR=37;       ERROR_MKPKG=38;     ERROR_GPG=39
-ERROR_PATCH=40;     ERROR_VCS=41
-
-# ---------  Inicializa variáveis de entrada  -------------
-PACKAGE=$PACKAGE_ORIG
-ARCH=${ARCH:=i486}
-VERSION=$VERSION_ORIG
-SRC_DIR=${SRC:=$CWD}
-SRC=$PACKAGE-$VERSION.$EXTENSION
-BUILD=${BUILD:=1rud}
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="grace"
+PKG_NAME="grace"
+ARCH=${ARCH:=i468}
+SRC_VERSION=${VERSION:=5.1.20}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1rra}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
 TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
 REPOS=${REPOS:=$TMP}
-PREFIX=${PREFIX:=/opt}
-OPTCONF=${OPTCONF:=""}
-MD5=${MD5:=$MD5_ORIG}
-URL=${URL:="ftp://plasma-gate.weizmann.ac.il/pub/grace/src/grace5/$SRC"}
-
-# ----------------  Download fontes  ----------------------
-# Fonte a ser compilada, com o path
-SOURCE=$SRC_DIR/$PACKAGE/$SRC
-# Verifica existência do pacote $SRC em $SRC_DIR
-if [ ! -e $SOURCE ]; then
-    wget "$URL" -P "$SRC_DIR/$PACKAGE/" || exit $ERROR_WGET
-fi
+PREFIX=${PREFIX:=/usr/local}
+PKG_SRC="$TMP/$SRC_NAME-$SRC_VERSION"
+CONF_OPTIONS=${CONF_OPTIONS:=""}
+NUMJOBS=${NUMJOBS:="-j4"}
 
-# ------------------  Checa md5sum  -----------------------
-if [ "$SRC_ORIG" = "$SRC" -o "$MD5" != "$MD5_ORIG" -a "$MD5" != "no" ]; then
-    SUM=`md5sum $SOURCE | awk '{print $1}'`
-    [ "$SUM" != "$MD5" ] && exit $ERROR_MD5
-fi
+# Set system libraries' path and optmization flags based on $ARCH
+LIBDIR="$PREFIX/lib"
 
-# -----------------  ARCH e LIBDIR  -----------------------
-# Libdir, para arch x86_64
-LIBDIR=$PREFIX/lib
-# Seleciona flags para o compilador
 if [ "$ARCH" = "i386" ]; then
-    SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+  SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
 elif [ "$ARCH" = "i486" ]; then
-    SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
+  SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
 elif [ "$ARCH" = "i686" ]; then
-    SLKCFLAGS="-O2 -march=i686"
+  SLKCFLAGS="-O2 -march=i686"
 elif [ "$ARCH" = "s390" ]; then
-    SLKCFLAGS="-O2"
+  SLKCFLAGS="-O2"
 elif [ "$ARCH" = "x86_64" ]; then
-    SLKCFLAGS="-O2"
-    LIBDIR="$PREFIX/lib64"
+  SLKCFLAGS="-O2"
+  LIBDIR="$PREFIX/lib64"
 fi
 
-# --------------  Desempacota fontes  ---------------------
-# Desempacota fontes em PKG_SRC=$TMP/$PACKAGE-source
-PKG_SRC=$TMP/$PACKAGE-source
-rm -rf $PKG_SRC 2>/dev/null
-mkdir -p $PKG_SRC
-# Desempacota $SOURCE em $TMP/$PACKAGE-source
-tar xvf $SOURCE -C $PKG_SRC || exit $ERROR_TAR
-
-# Pega o nome do diretório das fontes independente de sua
-# estrutura (package-version...)
-PKG_DIR="$PKG_SRC/$( ls $PKG_SRC/ )"
-cd $PKG_DIR
-
-# --------------  Configura programa  ---------------------
-# Configura programa
-CFLAGS="$SLKCFLAGS" ./configure --prefix=$PREFIX --libdir=$LIBDIR $OPTCONF || exit $ERROR_CONF
-
-# ----------------  Compila programa  ---------------------
-make || exit $ERROR_MAKE
-
-# -------------  Diretório Temporário  --------------------
-# Cria diretório temporário para construção do pacote
-PKG=$TMP/$PACKAGE
-rm -rf $PKG
-mkdir -p $PKG
-
-# ---------------  Instala programa  ----------------------
-# Instala programa em diretório temporário
-make install DESTDIR=$PKG || exit $ERROR_INSTALL
-
-# ------------  Cria links e instala manuais  -------------
+# Set error codes (used by createpkg)
+ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
+ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
+ERROR_TAR=37;       ERROR_MKPKG=38;     ERROR_GPG=39
+ERROR_PATCH=40;     ERROR_VCS=41;       ERROR_MKDIR=42
+
+# Clean up any leftovers of previous builds
+rm -rf "$PKG_SRC" 2> /dev/null
+rm -rf "$PKG" 2> /dev/null
+
+# Create directories if necessary
+mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
+mkdir -p "$PKG" || exit $ERROR_MKDIR
+mkdir -p "$REPOS" || exit $ERROR_MKDIR
+
+# Dowload source if necessary
+SRC="$SRC_NAME-$SRC_VERSION.tar.gz"
+URL="ftp://plasma-gate.weizmann.ac.il/pub/grace/src/grace5/$SRC"
+
+if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then
+  wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
+fi
+
+# Untar
+cd "$TMP"
+tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
+cd "$PKG_SRC"
+
+# Configure
+CFLAGS="$SLKCFLAGS" \
+  CXXFLAGS="$SLKCFLAGS" \
+  ./configure \
+  --prefix="$PREFIX" --libdir="$LIBDIR" "$CONF_OPTIONS" || exit $ERROR_CONF
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+make install DESTDIR="$PKG" || exit $ERROR_INSTALL
+
 # Links
-mkdir -p $PKG/usr/bin
+mkdir -p $PKG/$PREFIX/bin
+cd $PKG/$PREFIX/bin
 for i in convcal fdf2fit grconvert xmgrace; do
-    ln -s $PREFIX/$PACKAGE/bin/$i /usr/bin/$i
+  ln -s ../$PKG_NAME/bin/$i $i
 done
+cd -
 
-# Manuais
+# Manual pages
 mkdir -p $PKG/usr/man/man1
-cp $PKG_DIR/doc/*.1 $PKG/usr/man/man1/
+cp $PKG_SRC/doc/*.1 $PKG/usr/man/man1/
 gzip $PKG/usr/man/man1/*
 
-# Cria grace.desktop
+# Make grace.desktop
 mkdir -p $PKG/usr/share/applications
 cat << EOF_KDE > $PKG/usr/share/applications/Grace.desktop
 [Desktop Entry]
 Encoding=UTF-8
 Categories=Graphics;
 Exec=xmgrace
-Icon=$PREFIX/$PACKAGE/doc/mygraph.png
+Icon=$PREFIX/$PKG_NAME/doc/mygraph.png
 StartupNotify=true
 Terminal=false
 Type=Application
@@ -130,23 +115,31 @@ GenericName=Grace
 Comment=
 EOF_KDE
 
-# -----------------  Stripa código  -----------------------
-cd $PKG
-find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-
-# ----------------  Cria slack-desc  ----------------------
-mkdir $PKG/install
-cat << EOF > $PKG/install/slack-desc
+# Strip binaries
+( cd "$PKG"
+  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+    xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Install documentation
+DOCS="LICENSE README CHANGES DEVELOPERS ChangeLog COPYRIGHT"
+mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+cp -a $DOCS "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+
+# Add package description (slack-desc)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EODESC > "$PKG/install/slack-desc"
 # HOW TO EDIT THIS FILE:
 # The "handy ruler" below makes it easier to edit a package description.  Line
-# up the first '|' above the ':' following the base package name, and the '|' on
-# the right side marks the last column you can put a character in.  You must make
-# exactly 11 lines for the formatting to be correct.  It's also customary to
-# leave one space after the ':'.
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
 
-     |--------handy-ruler-----------------------------------------------------|
-grace: Package Grace $VERSION, by Rudson R. Alves
+     |-----handy-ruler-------------------------------------------------------|
+grace: Package Grace $VERSION, by Slack.Sarava
 grace:
 grace: Grace is a WYSIWYG 2D plotting tool for the X Window System and M*tif.
 grace: Grace runs on practically any version of Unix-like OS. As well, it has
@@ -157,18 +150,14 @@ grace: Grace is a descendant of ACE/gr, also known as Xmgr.
 grace:
 grace:
 grace:
-EOF
-
-# -----------------  Documentações  -----------------------
-# Criar diretório de documentação
-PKG_DOC=$PKG/usr/doc/$PACKAGE-$VERSION
-mkdir -p $PKG_DOC
-cp $PKG_DIR/{CHANGES,COPYRIGHT,ChangeLog,DEVELOPERS,LICENSE,README} $PKG_DOC
+EODESC
 
-# ---------------  Constroi o pacote  ---------------------
-makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG
+# Build the package
+cd "$PKG"
+makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
 
-# -----------  Remove arquivos temporários  ---------------
-if [ "$CLEANUP" = "yes" ]; then
-    rm -rf $PKG $PKG_SRC
+# Delete source and build directories if requested
+if [ "$CLEANUP" == "yes" ]; then
+  rm -rf "$PKG_SRC" "$PKG"
 fi
+
index 3b527da4e950213ebd0fc1e5d91a201d0a7a74c9..deb0efb8ad8640480fb2c2fe02e5418057e3be0c 100644 (file)
@@ -1,2 +1,6 @@
+# Dependency list to dvdauthor
+# 
+# dependency [condition] [version]]
 libpng
 fftw
+