|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
#!/bin/bash |
|
|
|
|
# Build script for Slackware |
|
|
|
|
# Copyright (C) 2008,2009 Damien Goutte-Gattat |
|
|
|
|
# Copyright (C) 2008,2009,2011 Damien Goutte-Gattat |
|
|
|
|
# |
|
|
|
|
# Redistribution and use of this script, with or without modifications, |
|
|
|
|
# is permitted provided that the following conditions are met: |
|
|
|
@ -27,14 +27,14 @@
|
|
|
|
|
|
|
|
|
|
# Source package infos |
|
|
|
|
NAMESRC=${NAMESRC:-Pmw} |
|
|
|
|
VERSION=${VERSION:-1.2} |
|
|
|
|
VERSION=${VERSION:-1.3.2} |
|
|
|
|
ARCHIVE=${ARCHIVE:-$NAMESRC.$VERSION.tar.gz} |
|
|
|
|
WGET=${WGET:-http://kent.dl.sourceforge.net/sourceforge/pmw/$ARCHIVE} |
|
|
|
|
WGET=${WGET:-http://downloads.sourceforge.net/pmw/$ARCHIVE} |
|
|
|
|
|
|
|
|
|
# Built package infos |
|
|
|
|
NAMEPKG=${NAMEPKG:-pmw} |
|
|
|
|
BUILD=${BUILD:-2GGD} |
|
|
|
|
ARCH=${ARCH:-i486} |
|
|
|
|
BUILD=${BUILD:-1GGD} |
|
|
|
|
ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')} |
|
|
|
|
EXT=${EXT:-txz} |
|
|
|
|
|
|
|
|
|
# Directories |
|
|
|
@ -42,14 +42,6 @@ TMP=${TMP:-/tmp}
|
|
|
|
|
OUT=${OUT:-$TMP/build} |
|
|
|
|
PKG=${PKG:-$OUT/$NAMEPKG} |
|
|
|
|
CWD=$(pwd) |
|
|
|
|
# Get the 'site-packages' directory in the Python installation |
|
|
|
|
SITEPKG=$(python <<EOF |
|
|
|
|
#!/usr/bin/python |
|
|
|
|
import sys |
|
|
|
|
for p in sys.path: |
|
|
|
|
if p[-13:] == 'site-packages': |
|
|
|
|
print p |
|
|
|
|
EOF) |
|
|
|
|
|
|
|
|
|
set -e # Quit if a command returns non-zero |
|
|
|
|
|
|
|
|
@ -65,14 +57,19 @@ fi
|
|
|
|
|
|
|
|
|
|
# Get and verify the source archive |
|
|
|
|
if [ ! -r $ARCHIVE ]; then |
|
|
|
|
wget "$WGET" |
|
|
|
|
wget -c -O $ARCHIVE.part "$WGET" |
|
|
|
|
mv $ARCHIVE.part $ARCHIVE |
|
|
|
|
fi |
|
|
|
|
sha1sum -c $ARCHIVE.sha1 |
|
|
|
|
NAME=$(tar ft $ARCHIVE | head -n 1 | cut -d / -f 1) |
|
|
|
|
|
|
|
|
|
# Prepare the package tree |
|
|
|
|
# Build |
|
|
|
|
cd $TMP |
|
|
|
|
echo "Building $ARCHIVE..." |
|
|
|
|
mkdir -p $PKG/$SITEPKG |
|
|
|
|
tar xf $ARCHIVE -C $PKG/$SITEPKG |
|
|
|
|
tar xf $CWD/$ARCHIVE |
|
|
|
|
cd $NAME/src |
|
|
|
|
python setup.py build |
|
|
|
|
python setup.py install --root=$PKG |
|
|
|
|
|
|
|
|
|
# Copy slack-desc file |
|
|
|
|
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc |
|
|
|
@ -84,6 +81,7 @@ PACKAGING="
|
|
|
|
|
chown root:root . -R |
|
|
|
|
/sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$EXT |
|
|
|
|
rm -rf $PKG |
|
|
|
|
rm -rf $TMP/$NAME |
|
|
|
|
" |
|
|
|
|
if type -p fakeroot ; then |
|
|
|
|
echo "$PACKAGING" | fakeroot |
|
|
|
|