aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xapp/cdr/k9copy/k9copy.SlackBuild219
-rw-r--r--app/cdr/k9copy/slack-required3
-rwxr-xr-xapp/editors/kile/kile.SlackBuild211
-rwxr-xr-xmedia/libs/libdvdcss/libdvdcss.SlackBuild223
-rwxr-xr-xmedia/libs/libdvdplay/libdvdplay.SlackBuild230
-rw-r--r--media/libs/libdvdplay/slack-required3
-rwxr-xr-xmedia/libs/libdvdread/libdvdread.SlackBuild212
-rw-r--r--media/libs/libdvdread/slack-required3
-rwxr-xr-xmedia/libs/sdl-image/sdl-image.SlackBuild134
-rw-r--r--media/libs/sdl-image/slack-required5
-rwxr-xr-xmedia/sound/lame/lame.SlackBuild219
-rwxr-xr-xmedia/video/dvdauthor/dvdauthor.SlackBuild212
-rw-r--r--media/video/dvdauthor/slack-required3
-rwxr-xr-xsci/visualization/grace/grace.SlackBuild227
-rw-r--r--sci/visualization/grace/slack-required4
15 files changed, 969 insertions, 939 deletions
diff --git a/app/cdr/k9copy/k9copy.SlackBuild b/app/cdr/k9copy/k9copy.SlackBuild
index 24f749e7..cb87b975 100755
--- a/app/cdr/k9copy/k9copy.SlackBuild
+++ b/app/cdr/k9copy/k9copy.SlackBuild
@@ -1,131 +1,116 @@
#!/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
+
diff --git a/app/cdr/k9copy/slack-required b/app/cdr/k9copy/slack-required
index b104fe92..9a57346a 100644
--- a/app/cdr/k9copy/slack-required
+++ b/app/cdr/k9copy/slack-required
@@ -1,3 +1,6 @@
+# Dependency list to k9copy
+#
+# dependency [condition] [version]]
vamps
qt
kdelibs
diff --git a/app/editors/kile/kile.SlackBuild b/app/editors/kile/kile.SlackBuild
index 5111c174..9657e5a8 100755
--- a/app/editors/kile/kile.SlackBuild
+++ b/app/editors/kile/kile.SlackBuild
@@ -1,124 +1,115 @@
#!/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
+
diff --git a/media/libs/libdvdcss/libdvdcss.SlackBuild b/media/libs/libdvdcss/libdvdcss.SlackBuild
index bcfa9af4..97a6f2aa 100755
--- a/media/libs/libdvdcss/libdvdcss.SlackBuild
+++ b/media/libs/libdvdcss/libdvdcss.SlackBuild
@@ -1,148 +1,133 @@
#!/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
+
diff --git a/media/libs/libdvdplay/libdvdplay.SlackBuild b/media/libs/libdvdplay/libdvdplay.SlackBuild
index f0e2143e..1c0c44c6 100755
--- a/media/libs/libdvdplay/libdvdplay.SlackBuild
+++ b/media/libs/libdvdplay/libdvdplay.SlackBuild
@@ -1,147 +1,133 @@
#!/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
+
diff --git a/media/libs/libdvdplay/slack-required b/media/libs/libdvdplay/slack-required
index 2539ecbd..a8a67762 100644
--- a/media/libs/libdvdplay/slack-required
+++ b/media/libs/libdvdplay/slack-required
@@ -1 +1,4 @@
+# Dependency list to libdvdplay
+#
+# dependency [condition] [version]]
libdvdread
diff --git a/media/libs/libdvdread/libdvdread.SlackBuild b/media/libs/libdvdread/libdvdread.SlackBuild
index 741f85b2..96de4932 100755
--- a/media/libs/libdvdread/libdvdread.SlackBuild
+++ b/media/libs/libdvdread/libdvdread.SlackBuild
@@ -1,125 +1,116 @@
#!/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
+
diff --git a/media/libs/libdvdread/slack-required b/media/libs/libdvdread/slack-required
index 2a9cfbbc..22253877 100644
--- a/media/libs/libdvdread/slack-required
+++ b/media/libs/libdvdread/slack-required
@@ -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
index 00000000..f7c88da0
--- /dev/null
+++ b/media/libs/sdl-image/sdl-image.SlackBuild
@@ -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
index 00000000..fe5707ee
--- /dev/null
+++ b/media/libs/sdl-image/slack-required
@@ -0,0 +1,5 @@
+# Dependency list to sdl_image
+#
+# dependency [condition] [version]]
+sdl
+
diff --git a/media/sound/lame/lame.SlackBuild b/media/sound/lame/lame.SlackBuild
index c2587099..ccb4f029 100755
--- a/media/sound/lame/lame.SlackBuild
+++ b/media/sound/lame/lame.SlackBuild
@@ -1,134 +1,115 @@
#!/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
+
diff --git a/media/video/dvdauthor/dvdauthor.SlackBuild b/media/video/dvdauthor/dvdauthor.SlackBuild
index 14d3b44c..d25db522 100755
--- a/media/video/dvdauthor/dvdauthor.SlackBuild
+++ b/media/video/dvdauthor/dvdauthor.SlackBuild
@@ -1,127 +1,115 @@
#!/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
+
diff --git a/media/video/dvdauthor/slack-required b/media/video/dvdauthor/slack-required
index 2539ecbd..d7075b53 100644
--- a/media/video/dvdauthor/slack-required
+++ b/media/video/dvdauthor/slack-required
@@ -1 +1,4 @@
+# Dependency list to dvdauthor
+#
+# dependency [condition] [version]]
libdvdread
diff --git a/sci/visualization/grace/grace.SlackBuild b/sci/visualization/grace/grace.SlackBuild
index a84acbb1..f2294b40 100755
--- a/sci/visualization/grace/grace.SlackBuild
+++ b/sci/visualization/grace/grace.SlackBuild
@@ -1,127 +1,112 @@
#!/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
+
diff --git a/sci/visualization/grace/slack-required b/sci/visualization/grace/slack-required
index 3b527da4..deb0efb8 100644
--- a/sci/visualization/grace/slack-required
+++ b/sci/visualization/grace/slack-required
@@ -1,2 +1,6 @@
+# Dependency list to dvdauthor
+#
+# dependency [condition] [version]]
libpng
fftw
+