Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
markdown: upgraded to 2.6
  • Loading branch information
conraid committed Mar 1, 2015
1 parent 72e87af commit e5179df
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 42 deletions.
77 changes: 38 additions & 39 deletions markdown/markdown.SlackBuild
Expand Up @@ -2,7 +2,7 @@
#
# Slackware build script for markdown
#
# Copyright 2013-2014 Corrado Franco (http://conraid.net)
# Copyright 2013-2015 Corrado Franco (http://conraid.net)
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
Expand Down Expand Up @@ -31,78 +31,77 @@ set -eu
CWD=$(pwd)

PRGNAME=${PRGNAME:-Markdown}
PKGNAME=$(echo $PRGNAME | tr A-Z a-z)
VERSION=${VERSION:-2.5.1}
PKGVERSION=$(echo $VERSION | tr - _)
PKGNAME=$(echo ${PRGNAME} | tr A-Z a-z)
VERSION=${VERSION:-2.6}
PKGVERSION=${VERSION/-/_}
BUILD=${BUILD:-1}
TAG=${TAG:-cf}
TMP=${TMP:-/tmp/pkg}
PKG=$TMP/package-$PKGNAME
DOCS="$PKG/usr/doc/$PKGNAME-$PKGVERSION"
PKG=${TMP}/package-${PKGNAME}
DOCDIR="${PKG}/usr/doc/${PKGNAME}-${PKGVERSION}"

# Insert document files in this variable
DOCFILES="docs/ PKG-INFO README.md INSTALL.md LICENSE.md"

ARCH=${ARCH:=""} # Set ARCH or leave blank to determine it automatically
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i686 ;;
arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
if [ -z ${ARCH:=""} ]; then
case "$( uname -m )" in
i?86) ARCH=i686 ;;
arm*) ARCH=arm ;;
# Unless ${ARCH} is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi

# Set compiling FLAGS
case "$ARCH" in
i[3-5]86)
SLKCFLAGS="-O2 -march=${ARCH} -mtune=i686"; CHOST="i486"
case "${ARCH}" in
i[3-5]86)
SLKCFLAGS="-O2 -march=${ARCH} -mtune=i686"; CHOST="i486"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
;;
i686)
;;
i686)
SLKCFLAGS="-O2 -march=i686 -pipe -fomit-frame-pointer"; CHOST="i486"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
;;
x86_64)
;;
x86_64)
SLKCFLAGS="-O2 -fPIC -pipe -fomit-frame-pointer"; CHOST="x86_64"
SLKLDFLAGS="-L/lib64 -L/usr/lib64"; LIBDIRSUFFIX="64"
;;
*)
SLKCFLAGS="-O2"; CHOST=$ARCH
;;
*)
SLKCFLAGS="-O2"; CHOST=${ARCH}
SLKLDFLAGS=""; LIBDIRSUFFIX=""
;;
esac

# Extract source and prepare:
rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
rm -rf $PRGNAME-$VERSION
tar xvf $CWD/$PRGNAME-$VERSION.tar.gz
cd $PRGNAME-$VERSION
rm -rf ${PKG}
mkdir -p ${TMP} ${PKG}
cd ${TMP}
rm -rf ${PRGNAME}-${VERSION}
tar xvf ${CWD}/${PRGNAME}-${VERSION}.tar.gz
cd ${PRGNAME}-${VERSION}

# Make sure ownerships and permissions are sane:
chown -R root:root .
chmod -R u+w,go+r-w,a-s .

# Build and install:
python setup.py install --root=$PKG
python setup.py install --root=${PKG}

# Strip binaries:
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true
find $PKG | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs -r strip -g 2> /dev/null || true
find ${PKG} | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true
find ${PKG} | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs -r strip -g 2> /dev/null || true

# Add a documentation directory:
mkdir -p ${DOCS}
cp -a $DOCFILES $DOCS || true
mkdir -p ${DOCDIR}
cp -a ${DOCFILES} ${DOCDIR} || true

# Add a slackbuild script:
install -Dm644 $CWD/$PKGNAME.SlackBuild $DOCS/$PKGNAME.SlackBuild
install -Dm644 ${CWD}/${PKGNAME}.SlackBuild ${DOCDIR}/${PKGNAME}.SlackBuild

# Add slack-desc
install -Dm644 $CWD/slack-desc $PKG/install/slack-desc
install -Dm644 ${CWD}/slack-desc ${PKG}/install/slack-desc

# Create package:
cd $PKG
/sbin/makepkg -l y -c n $CWD/$PKGNAME-$PKGVERSION-$ARCH-${BUILD}${TAG}.txz
cd ${PKG}
/sbin/makepkg -l y -c n ${CWD}/${PKGNAME}-${PKGVERSION}-${ARCH}-${BUILD}${TAG}.txz
6 changes: 3 additions & 3 deletions markdown/markdown.info
@@ -1,7 +1,7 @@
NAME="markdown"
VERSION="2.5.1"
VERSION="2.6"
HOMEPAGE="https://pypi.python.org/pypi/Markdown/"
DOWNLOAD="https://pypi.python.org/packages/source/M/Markdown/Markdown-2.5.1.tar.gz"
DOWNLOAD="https://pypi.python.org/packages/source/M/Markdown/Markdown-2.6.tar.gz"
FILENAME=""
REQUIRES=""
MD5SUM="9effb2679302efb1ce14265cb9e46f96"
MD5SUM="8667532c78fc3b411be979447ea21be2"

0 comments on commit e5179df

Please sign in to comment.