aboutsummaryrefslogtreecommitdiff
path: root/trunk/conf
diff options
context:
space:
mode:
authorrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>2007-02-21 15:59:00 +0000
committerrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>2007-02-21 15:59:00 +0000
commit902b2fe66da2e3f69d5245e78d9b697a87e7e800 (patch)
tree19a92b62b0386e11753cf53afd0addf74a79dc38 /trunk/conf
parentae1ecd24619fda20217113b277f83822296a616d (diff)
downloadsimplepkg-902b2fe66da2e3f69d5245e78d9b697a87e7e800.tar.gz
simplepkg-902b2fe66da2e3f69d5245e78d9b697a87e7e800.tar.bz2
mkslackbuild: atualizando para versão 0.9.3
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@190 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk/conf')
-rw-r--r--trunk/conf/generic.mkSlackBuild.new49
1 files changed, 31 insertions, 18 deletions
diff --git a/trunk/conf/generic.mkSlackBuild.new b/trunk/conf/generic.mkSlackBuild.new
index e8c432a..a97c83a 100644
--- a/trunk/conf/generic.mkSlackBuild.new
+++ b/trunk/conf/generic.mkSlackBuild.new
@@ -1,7 +1,7 @@
###################################################
## Generic template for SlackBuilds
##
-## Version 0.3.3 - Luis ( luis at riseup d0t net)
+## Version 0.7 - Luis ( luis at riseup d0t net)
##
###################################################
<head> all
@@ -25,18 +25,19 @@ fi
<set_variables> all
# Set variables
-CWD=`pwd`
+CWD="`pwd`"
SRC_NAME="[[SOURCE NAME]]"
PKG_NAME="[[PACKAGE NAME]]"
ARCH=${ARCH:=[[ARCH]]}
-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:=[[PREFIX]]}
-PKG_SRC="$SRC_DIR/$SRC_NAME-$VERSION"
+PKG_SRC="$SRC_DIR/$SRC_NAME-$SRC_VERSION"
</set_variables>
<slkflags> all
@@ -70,14 +71,14 @@ ERROR_PATCH=40; ERROR_VCS=41; ERROR_MKDIR=42
rm -rf "$PKG_SRC" 2> /dev/null
rm -rf "$PKG" 2> /dev/null
-# Create directories, if necessary
+# Create directories if necessary
mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
mkdir -p "$PKG" || exit $ERROR_MKDIR
mkdir -p "$REPOS" || exit $ERROR_MKDIR
</start_structure>
<import_gpg_signing> off
-# Import (minimized) signing key from
+# Import minimized signing key from
# [[SIGNING KEY URL]]
gpg --import << EOKEY || exit $ERROR_GPG
[[SIGNING KEY]]
@@ -85,36 +86,46 @@ EOKEY
</import_gpg_signing>
<download_source> on
-# Dowload source and its signature, if necessary
-SRC="$SRC_NAME-$VERSION.tar.[[SOURCE EXTENSION]]"
+# Dowload source if necessary
+SRC="$SRC_NAME-$SRC_VERSION.tar.[[SOURCE EXTENSION]]"
URL="[[DOWNLOAD FOLDER URL]]/$SRC"
-if [ ! -f "$SRC_DIR/$SRC" ] || ! [[DECOMPRESSOR]] [[DECOMPRESSOR TEST FLAG]] "$SRC_DIR/$SRC" 2> /dev/null; then
+if [ ! -s "$SRC_DIR/$SRC" ] || ! [[DECOMPRESSOR]] [[DECOMPRESSOR TEST FLAG]] "$SRC_DIR/$SRC" 2> /dev/null; then
wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
fi
</download_source>
<download_signature_and_check> off
-if [ ! -f "$SRC_DIR/$SRC.sig" ]; then
+# Dowload source's signature if necessary and check it
+if [ ! -s "$SRC_DIR/$SRC.sig" ]; then
wget "$URL.sig" -O "$SRC_DIR/$SRC.sig" || exit $ERROR_WGET
fi
-# Check source's signature
gpg --verify "$SRC_DIR/$SRC.sig" "$SRC_DIR/$SRC" || exit $ERROR_GPG
</download_signature_and_check>
<untar_source> all
-# Untar, patch, configure, compile and install
+# Untar
cd "$SRC_DIR"
tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
-cd "$PKG_SRC"
</untar_source>
<path_source> off
-patch -Np[[NUMBER OF PREFIX SLASHES TO STRIP]] < "$CWD/[[PATCH FILE]]"
+# Patch source
+cd "$PKG_SRC"
+patches="[[PATCH FILES]] $PACKAGE.diff $PACKAGE-$VERSION.diff
+ $PACKAGE-$VERSION-$ARCH.diff $PACKAGE-$ARCH.diff"
+for patch in $patches; do
+ if [ -f "$CWD/$patch" ]; then
+ patch -Np[[NUMBER OF PREFIX SLASHES TO STRIP]] < "$CWD/$patch" || exit $ERROR_PATCH
+ elif [ -f "$CWD/patches/$patch" ]; then
+ patch -Np[[NUMBER OF PREFIX SLASHES TO STRIP]] < "$CWD/patches/$patch" || exit $ERROR_PATCH
+ fi
+done
</path_source>
<configure> on
+# Configure
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
@@ -122,10 +133,12 @@ CFLAGS="$SLKCFLAGS" \
</configure>
<make_package> all
+# Compile
make || exit $ERROR_MAKE
</make_package>
<install_package> all
+# Install
make install DESTDIR="$PKG" || exit $ERROR_INSTALL
</install_package>
@@ -169,8 +182,8 @@ fi
<install_documentation> on
# 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"
</install_documentation>
<slackdesc> on
@@ -213,11 +226,11 @@ EOSCRIPT
<build_package> all
# 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
</build_package>
<clean_builds> on
-# Delete source and build directories, if requested
+# Delete source and build directories if requested
if [ "$CLEANUP" == "yes" ]; then
rm -rf "$PKG_SRC" "$PKG"
fi