mirror of
https://codeberg.org/gwh/slackbuilds.git
synced 2024-11-16 19:51:19 +01:00
83 lines
2.5 KiB
Bash
Executable file
83 lines
2.5 KiB
Bash
Executable file
#!/bin/sh -x
|
|
|
|
# variables
|
|
CWD=$(pwd)
|
|
|
|
APP_NAME=$(basename $CWD)
|
|
VERSION=0.24-beta1
|
|
ARCH=$(uname -m)
|
|
BUILD=1
|
|
PACKAGER=cyco
|
|
|
|
TMP=/tmp/$PACKAGER
|
|
PKG=$TMP/pkg-$APP_NAME
|
|
OUTPUT=/tmp
|
|
|
|
PREFIX=/usr
|
|
DOCS="ChangeLog COPYING PKG-INFO README THANKS TODO"
|
|
|
|
EMACS=$(basename $(ls /usr/bin/emacs-2*))
|
|
|
|
# nettoyage préalable
|
|
rm -fr $PKG $TMP/$APP_NAME-$VERSION
|
|
|
|
mkdir -p $PKG
|
|
|
|
# mise en place
|
|
( cd $TMP
|
|
[ ! -e $CWD/$APP_NAME-$VERSION.tar.?z* ] && \
|
|
wget -c http://pymacs.progiciels-bpi.ca/archives/$APP_NAME-$VERSION.tar.gz \
|
|
-O $CWD/$APP_NAME-$VERSION.tar.gz
|
|
tar xf $CWD/$APP_NAME-$VERSION.tar.?z*
|
|
)
|
|
|
|
( cd $TMP/$APP_NAME-$VERSION
|
|
# installation
|
|
python setup.py install --root=$PKG
|
|
|
|
mkdir -p $PKG$PREFIX/share/emacs/site-lisp/
|
|
cp pymacs.el $PKG$PREFIX/share/emacs/site-lisp/
|
|
)
|
|
|
|
# correction
|
|
chown -R root:root $PKG/*
|
|
|
|
mkdir -p $PKG/usr/doc/$APP_NAME-$VERSION
|
|
( cd $TMP/$APP_NAME-$VERSION
|
|
cp -R $DOCS $PKG/usr/doc/$APP_NAME-$VERSION
|
|
[ ! -e $CWD/pymacs.html ] && \
|
|
wget -c http://pymacs.progiciels-bpi.ca/pymacs.html -O $CWD/pymacs.html
|
|
cp -R $CWD/pymacs.html $PKG/usr/doc/$APP_NAME-$VERSION
|
|
[ ! -e $CWD/pymacs.pdf ] && \
|
|
wget -c http://pymacs.progiciels-bpi.ca/pymacs.pdf -O $CWD/pymacs.pdf
|
|
cp -R $CWD/pymacs.pdf $PKG/usr/doc/$APP_NAME-$VERSION
|
|
)
|
|
|
|
[ -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
|
|
cat <<EOF > $PKG/install/slack-desc
|
|
$APP_NAME: $APP_NAME (Emacs-lisp <-> Python)
|
|
$APP_NAME:
|
|
$APP_NAME: Pymacs is a powerful tool which, once started from Emacs, allows both-way
|
|
$APP_NAME: communication between Emacs Lisp and Python. Pymacs aims Python as an
|
|
$APP_NAME: extension language for Emacs rather than the other way around, and this
|
|
$APP_NAME: asymmetry is reflected in some design choices. Within Emacs Lisp code, one
|
|
$APP_NAME: may load and use Python modules. Python functions may themselves use Emacs
|
|
$APP_NAME: services, and handle Emacs Lisp objects kept in Emacs Lisp space.
|
|
$APP_NAME:
|
|
$APP_NAME: http://pymacs.progiciels-bpi.ca/
|
|
$APP_NAME:
|
|
EOF
|
|
|
|
# empaquetage
|
|
( cd $PKG
|
|
makepkg -l y -c n $OUTPUT/$APP_NAME-$(echo $VERSION | tr -d -)-$ARCH-$BUILD$PACKAGER.txz
|
|
)
|