diff options
author | rhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4> | 2009-04-01 19:25:14 +0000 |
---|---|---|
committer | rhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4> | 2009-04-01 19:25:14 +0000 |
commit | c962246be6aa3b715e2510d07496c7d8f72ca33a (patch) | |
tree | 213e23ff304fdcf97df84046ed696b2e1e2ab1e1 /www/apps/tracfootnotemacro/TracFootNoteMacro.SlackBuild | |
parent | fd0994f67f0e8e17c1d0323ecb4811a3c836a9f1 (diff) | |
download | slackbuilds-c962246be6aa3b715e2510d07496c7d8f72ca33a.tar.gz slackbuilds-c962246be6aa3b715e2510d07496c7d8f72ca33a.tar.bz2 |
TracFootNoteMacro: adding TracFootNoteMacro and updating dependencies
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@2131 370017ae-e619-0410-ac65-c121f96126d4
Diffstat (limited to 'www/apps/tracfootnotemacro/TracFootNoteMacro.SlackBuild')
-rw-r--r-- | www/apps/tracfootnotemacro/TracFootNoteMacro.SlackBuild | 160 |
1 files changed, 160 insertions, 0 deletions
diff --git a/www/apps/tracfootnotemacro/TracFootNoteMacro.SlackBuild b/www/apps/tracfootnotemacro/TracFootNoteMacro.SlackBuild new file mode 100644 index 00000000..4a42d2d9 --- /dev/null +++ b/www/apps/tracfootnotemacro/TracFootNoteMacro.SlackBuild @@ -0,0 +1,160 @@ +#!/bin/bash +# +# TracFootNoteMacro.SlackBuild is free software; you can redistribute +# it and/or modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the License, +# or any later version. +# +# TracFootNoteMacro.SlackBuild is distributed in the hope that it will +# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +# +# slackbuild for TracFootNoteMacro, by Silvio Rhatto +# requires: +# tested: TracFootNoteMacro-svn_version +# model: generic.mkSlackBuild $Rev: 805 $ +# + +# Look for slackbuildrc +if [ -f ~/.slackbuildrc ]; then + source ~/.slackbuildrc +elif [ -f /etc/slackbuildrc ]; then + source /etc/slackbuildrc +fi + +# Set variables +CWD="$(pwd)" +SRC_NAME="TracFootNoteMacro" +PKG_NAME="TracFootNoteMacro" +ARCH=${ARCH:=i486} +SRC_VERSION=${VERSION:=svn_version} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" +BUILD=${BUILD:=1rha} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME +TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} +REPOS=${REPOS:=$TMP} +SLACKBUILD_PATH=${SLACKBUILD_PATH:="www/apps/tracfootnotemacro"} +PREFIX=${PREFIX:=/usr} +PKG_WORK="$TMP/$SRC_NAME" +CONF_OPTIONS=${CONF_OPTIONS:=""} +NUMJOBS=${NUMJOBS:=""} + +# Set system libraries' path and optmization flags based on $ARCH +LIBDIR="$PREFIX/lib" + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mtune=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIR="$PREFIX/lib64" + LDFLAGS="-L/lib64 -L/usr/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 +ERROR_MANIFEST=43; + +# Clean up any leftovers of previous builds +rm -rf "$PKG_WORK" 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 +mkdir -p "$PKG_WORK" || exit $ERROR_MKDIR + +# Get svn source code +cd "$SRC_DIR" +SND_DIR="`basename http://trac-hacks.org/svn/footnotemacro/0.11`" + +if [ "`find "$SRC_DIR/" -name .svn`" != "" ] && [ -d "$SRC_DIR/$SND_DIR" ]; then + cd $SND_DIR + svn update || exit $ERROR_VCS +else + svn checkout http://trac-hacks.org/svn/footnotemacro/0.11 $SND_DIR || exit $ERROR_VCS + cd $SND_DIR +fi + +PKG_VERSION="`svn info | awk '/Last Changed Rev:/ { print $4 }'`_svn" + +# Copy svn source +cd "$PKG_WORK" +cp -a $SRC_DIR/* . +PKG_SRC="$PWD/$SND_DIR" +cd "$PKG_SRC" + +# Build and install package +python setup.py build install --root=$PKG + +# 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="COPYING README" +mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR +for doc in $DOCS; do + if [ -f "$doc" ]; then + cp -a $doc "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" + fi +done + +# 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--------------------------------------------| +TracFootNoteMacro: TracFootNoteMacro +TracFootNoteMacro: +TracFootNoteMacro: The FootNoteMacro automatically collates and generates +TracFootNoteMacro: footnotes. +TracFootNoteMacro: +TracFootNoteMacro: +TracFootNoteMacro: +TracFootNoteMacro: +TracFootNoteMacro: +TracFootNoteMacro: +TracFootNoteMacro: +EODESC + +# Copy slack-required +mkdir -p "$PKG/install" || exit $ERROR_MKDIR +if [ -f "$CWD/slack-required" ]; then + cp $CWD/slack-required $PKG/install +fi + +# Build the package +cd "$PKG" +mkdir -p $REPOS/$SLACKBUILD_PATH +makepkg -l y -c n "$REPOS/$SLACKBUILD_PATH/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG + +# Delete source and build directories if requested +if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then + rm -rf "$PKG_WORK" "$PKG" +fi |