slackbuilds/d/rope/rope.SlackBuild

84 lines
1.8 KiB
Text
Raw Normal View History

2010-04-15 04:46:05 +02:00
#!/bin/sh -x
# variables
CWD=$(pwd)
PRGNAM=$(basename $CWD)
2010-04-15 04:46:05 +02:00
VERSION=0.9.2
ARCH=$(uname -m)
BUILD=1
TAG=cyco
TMP=/tmp/$TAG
PKG=$TMP/pkg-$PRGNAM
2010-04-15 04:46:05 +02:00
OUTPUT=/tmp
PREFIX=/usr
DOCS="COPYING MANIFEST.in PKG-INFO README.txt"
# nettoyage pr<70>alable
rm -fr $PKG $TMP/$PRGNAM-$VERSION
2010-04-15 04:46:05 +02:00
mkdir -p $PKG
# mise en place
( cd $TMP
[ ! -e $CWD/$PRGNAM-$VERSION.tar.?z* ] && \
wget -c http://downloads.sourceforge.net/project/$PRGNAM/$PRGNAM/$VERSION/$PRGNAM-$VERSION.tar.gz?use_mirror=jaist \
-O $CWD/$PRGNAM-$VERSION.tar.gz
tar xf $CWD/$PRGNAM-$VERSION.tar.?z*
2010-04-15 04:46:05 +02:00
)
( cd $TMP/$PRGNAM-$VERSION
2010-04-15 04:46:05 +02:00
# installation
python setup.py install --root=$PKG
)
# correction
chown -R root:root $PKG/*
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
( cd $TMP/$PRGNAM-$VERSION
cp -R $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
2010-04-15 04:46:05 +02:00
)
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
[ -d $PKG/usr/info ] && find $PKG/usr/info -type f -name "*.info*" -exec gzip -9f {} \;
[ -d $PKG/usr/info ] && rm $PKG/usr/info/dir
# Strip binaries
find $PKG | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find $PKG | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
# embaumement
mkdir -p $PKG/install
2011-04-02 15:45:52 +02:00
cat <<EOF > $PKG/install/doinst.sh
cd /usr/info
[ -e dir ] && rm dir
[ -e dir.gz ] && rm dir.gz
[ -e dir.new ] && rm dir.new
for file in \$(ls *.gz | grep -v ".*\-[0-9]\+\.gz")
do
install-info \$file ./dir
done
EOF
2010-04-15 04:46:05 +02:00
cat <<EOF > $PKG/install/slack-desc
$PRGNAM: $PRGNAM (a python refactoring library...)
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: http://rope.sourceforge.net/
$PRGNAM:
2010-04-15 04:46:05 +02:00
EOF
# empaquetage
( cd $PKG
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | tr -d -)-$ARCH-$BUILD$TAG.txz
2010-04-15 04:46:05 +02:00
)