2010-08-06 06:40:22 +02:00
|
|
|
#!/bin/sh -x
|
|
|
|
|
|
|
|
# variables
|
2011-07-15 17:21:34 +02:00
|
|
|
VERSION=${VERSION:=$(date +"%Y.%m.%d_%H.%M")}
|
|
|
|
BUILD=${BUILD:=1}
|
2011-07-15 18:03:13 +02:00
|
|
|
GIT_TAG=${GIT_TAG:=latest}
|
2010-08-06 06:40:22 +02:00
|
|
|
|
2011-07-15 17:21:34 +02:00
|
|
|
TAG=${TAG:=cyco}
|
|
|
|
OUTPUT=${OUTPUT:=/tmp}
|
2011-02-17 05:58:04 +01:00
|
|
|
TMP=/tmp/$TAG
|
2010-08-06 06:40:22 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
|
|
|
|
PRGNAM=$(basename $CWD)
|
2011-07-15 17:21:34 +02:00
|
|
|
PKG=${PKG:=$TMP/pkg-$PRGNAM}
|
2010-08-06 06:40:22 +02:00
|
|
|
|
2011-07-15 17:21:34 +02:00
|
|
|
ARCH=${ARCH:=java}
|
2010-08-06 06:40:22 +02:00
|
|
|
|
2011-07-22 08:41:46 +02:00
|
|
|
REPOSITORY=${REPOSITORY:=/home/installs/SlackBuilds/repositories/$PRGNAM}
|
2011-07-15 17:21:34 +02:00
|
|
|
PREFIX=${PREFIX:=/usr}
|
2010-08-06 06:40:22 +02:00
|
|
|
|
|
|
|
EMACS=$(basename $(ls /usr/bin/emacs-2*))
|
|
|
|
EMACS_VERSION=$(echo "$EMACS" | grep -o "\-[0-9\.]*\-" | tr -d - | head -n1)
|
|
|
|
|
|
|
|
# mise en place
|
2011-07-15 17:21:34 +02:00
|
|
|
mkdir -p $TMP/
|
2010-08-06 06:40:22 +02:00
|
|
|
cd $TMP
|
|
|
|
if [ ! -e $REPOSITORY ] ; then
|
2011-07-15 17:21:34 +02:00
|
|
|
git clone "http://github.com/espenhw/malabar-mode.git" $REPOSITORY
|
|
|
|
else
|
|
|
|
( cd $REPOSITORY
|
|
|
|
git pull
|
|
|
|
)
|
2010-08-06 06:40:22 +02:00
|
|
|
fi
|
|
|
|
|
2011-07-15 17:21:34 +02:00
|
|
|
# nettoyage préalable
|
|
|
|
rm -fr $PKG $TMP/$PRGNAM*
|
|
|
|
|
|
|
|
mkdir -p $PKG
|
2010-08-06 06:40:22 +02:00
|
|
|
|
2011-02-17 05:58:04 +01:00
|
|
|
cp -R $REPOSITORY $TMP/
|
2011-07-15 17:21:34 +02:00
|
|
|
cd $TMP/$PRGNAM
|
|
|
|
if [ "x$GIT_TAG" != "x" ]; then
|
2011-07-15 18:03:13 +02:00
|
|
|
if [ "x$GIT_TAG" == "xlatest" ]; then
|
|
|
|
GIT_TAG=$(git tag | tail -n1 | grep -o "[0-9\.]*")
|
|
|
|
fi
|
2011-07-15 17:21:34 +02:00
|
|
|
git checkout malabar-$GIT_TAG
|
|
|
|
VERSION=$GIT_TAG
|
|
|
|
fi
|
|
|
|
mvn package -Dmaven.skip.test=true
|
2010-08-06 06:40:22 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG$PREFIX/share/emacs/site-lisp
|
2011-07-15 17:21:34 +02:00
|
|
|
cd $PKG$PREFIX/share/emacs/site-lisp
|
|
|
|
unzip $TMP/$PRGNAM/target/malabar-*-dist.zip
|
|
|
|
ln -s malabar-* malabar
|
|
|
|
cd malabar
|
|
|
|
chmod -x COPYING.txt README.md
|
2010-08-06 06:40:22 +02:00
|
|
|
|
|
|
|
# correction
|
2011-07-15 17:21:34 +02:00
|
|
|
cd $PKG
|
|
|
|
chown -R root:root *
|
2010-08-06 06:40:22 +02:00
|
|
|
|
|
|
|
# embaumement
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
|
|
|
|
cat <<EOF > $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------------------------------------------------------|
|
|
|
|
$PRGNAM: $PRGNAM (A better Java mode for Emacs)
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM: http://github.com/espenhw/malabar-mode/
|
|
|
|
$PRGNAM:
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# empaquetage
|
2011-02-17 05:54:04 +01:00
|
|
|
makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
|