aboutsummaryrefslogtreecommitdiff
path: root/others
diff options
context:
space:
mode:
authorluis <luis@370017ae-e619-0410-ac65-c121f96126d4>2007-02-08 05:17:11 +0000
committerluis <luis@370017ae-e619-0410-ac65-c121f96126d4>2007-02-08 05:17:11 +0000
commit56cb5405f875dfea7f26f884a49457a2e1e40070 (patch)
tree1941d817aef609235000d91295ccbbfa11b7127d /others
parenta5209c02619b5c1f95a9a473070b192624cffb89 (diff)
downloadslackbuilds-56cb5405f875dfea7f26f884a49457a2e1e40070.tar.gz
slackbuilds-56cb5405f875dfea7f26f884a49457a2e1e40070.tar.bz2
generic.SlackBuild v0.4
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@1010 370017ae-e619-0410-ac65-c121f96126d4
Diffstat (limited to 'others')
-rwxr-xr-xothers/generic/generic.SlackBuild17
1 files changed, 9 insertions, 8 deletions
diff --git a/others/generic/generic.SlackBuild b/others/generic/generic.SlackBuild
index f48f154c..29c44548 100755
--- a/others/generic/generic.SlackBuild
+++ b/others/generic/generic.SlackBuild
@@ -1,7 +1,7 @@
###################################################
## Generic template for SlackBuilds
##
-## Version 0.3.4 - Luis ( luis at riseup d0t net)
+## Version 0.4 - Luis ( luis at riseup d0t net)
##
###################################################
#!/bin/bash
@@ -25,14 +25,15 @@ fi
SRC_NAME="[[SOURCE NAME]]"
PKG_NAME="[[PACKAGE NAME]]"
ARCH=${ARCH:=i486}
-VERSION=${VERSION:=[[VERSION]]}
+SRC_VERSION=${VERSION:=[[VERSION]]}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
BUILD=${BUILD:=1[[SLACKBUILD AUTHOR INITIALS]]}
SRC_DIR=${SRC_DIR:=$CWD}
TMP=${TMP:=/tmp}
PKG=${PKG:=$TMP/package-$PKG_NAME}
REPOS=${REPOS:=$TMP}
-PREFIX=${PREFIX:=/usr}
-PKG_SRC="$SRC_DIR/$SRC_NAME-$VERSION"
+PREFIX=${PREFIX:=[[PREFIX]]}
+PKG_SRC="$SRC_DIR/$SRC_NAME-$SRC_VERSION"
# Set system libraries' path and optmization flags based on $ARCH
LIBDIR="$PREFIX/lib"
@@ -72,7 +73,7 @@ gpg --import << EOKEY || exit $ERROR_GPG
EOKEY
# Dowload source and its signature, if necessary
-SRC="$SRC_NAME-$VERSION.tar.[[SOURCE EXTENSION]]"
+SRC="$SRC_NAME-$SRC_VERSION.tar.[[SOURCE EXTENSION]]"
URL="[[DOWNLOAD FOLDER URL]]/$SRC"
if [ ! -s "$SRC_DIR/$SRC" ] || ! [[DECOMPRESSOR]] [[DECOMPRESSOR TEST FLAG]] "$SRC_DIR/$SRC" 2> /dev/null; then
@@ -130,8 +131,8 @@ fi
# Install documentation
DOCS="[[DOCUMENTATION FILES]]"
-mkdir -p "$PKG/$PREFIX/doc/$PKG_NAME-$VERSION" || exit $ERROR_MKDIR
-cp -a $DOCS "$PKG/$PREFIX/doc/$PKG_NAME-$VERSION"
+mkdir -p "$PKG/$PREFIX/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+cp -a $DOCS "$PKG/$PREFIX/doc/$PKG_NAME-$PKG_VERSION"
# Add package description (slack-desc)
mkdir -p "$PKG/install" || exit $ERROR_MKDIR
@@ -168,7 +169,7 @@ EOSCRIPT
# Build the package
cd "$PKG"
-makepkg -l y -c n "$REPOS/$PKG_NAME-$VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
+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