package a fix tag as the master branch often breaks as it's using maven snapshot artifacts :/

This commit is contained in:
Gwenhael Le Moine 2011-07-15 17:21:34 +02:00
parent aebafcb22b
commit 84e707ce3e

View file

@ -1,62 +1,60 @@
#!/bin/sh -x #!/bin/sh -x
# variables # variables
VERSION=master_$(date +"%Y.%m.%d_%H.%M") VERSION=${VERSION:=$(date +"%Y.%m.%d_%H.%M")}
BUILD=1 BUILD=${BUILD:=1}
GIT_TAG=${GIT_TAG:=1.4.0}
TAG=${TAG:=cyco}
TAG=cyco OUTPUT=${OUTPUT:=/tmp}
OUTPUT=/tmp
TMP=/tmp/$TAG TMP=/tmp/$TAG
CWD=$(pwd) CWD=$(pwd)
PRGNAM=$(basename $CWD) PRGNAM=$(basename $CWD)
PKG=$TMP/pkg-$PRGNAM PKG=${PKG:=$TMP/pkg-$PRGNAM}
ARCH=$(uname -m) ARCH=${ARCH:=java}
REPOSITORY=/home/cycojesus/projets/packages/repositories/$PRGNAM REPOSITORY=${REPOSITORY:=/home/cycojesus/projets/packages/repositories/$PRGNAM}
PREFIX=/usr PREFIX=${PREFIX:=/usr}
EMACS=$(basename $(ls /usr/bin/emacs-2*)) EMACS=$(basename $(ls /usr/bin/emacs-2*))
EMACS_VERSION=$(echo "$EMACS" | grep -o "\-[0-9\.]*\-" | tr -d - | head -n1) EMACS_VERSION=$(echo "$EMACS" | grep -o "\-[0-9\.]*\-" | tr -d - | head -n1)
# mise en place
mkdir -p $TMP/
cd $TMP
if [ ! -e $REPOSITORY ] ; then
git clone "http://github.com/espenhw/malabar-mode.git" $REPOSITORY
else
( cd $REPOSITORY
git pull
)
fi
# nettoyage préalable # nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM-$VERSION rm -fr $PKG $TMP/$PRGNAM*
mkdir -p $PKG mkdir -p $PKG
# mise en place
cd $TMP
if [ ! -e $REPOSITORY ] ; then
mkdir -p $(dirname $REPOSITORY)
cd $(dirname $REPOSITORY)
git clone "http://github.com/espenhw/malabar-mode.git" $PRGNAM
fi
( cd $REPOSITORY
git pull
)
mkdir -p $TMP/
cp -R $REPOSITORY $TMP/ cp -R $REPOSITORY $TMP/
( cd $TMP/$PRGNAM cd $TMP/$PRGNAM
mvn package -Dmaven.skip.test=true if [ "x$GIT_TAG" != "x" ]; then
) git checkout malabar-$GIT_TAG
VERSION=$GIT_TAG
fi
mvn package -Dmaven.skip.test=true
mkdir -p $PKG$PREFIX/share/emacs/site-lisp mkdir -p $PKG$PREFIX/share/emacs/site-lisp
( cd $PKG$PREFIX/share/emacs/site-lisp cd $PKG$PREFIX/share/emacs/site-lisp
unzip $TMP/$PRGNAM/target/malabar-*-dist.zip unzip $TMP/$PRGNAM/target/malabar-*-dist.zip
ln -s malabar-* malabar ln -s malabar-* malabar
( cd malabar cd malabar
chmod -x COPYING.txt README.md chmod -x COPYING.txt README.md
)
)
# correction # correction
( cd $PKG cd $PKG
chown -R root:root * chown -R root:root *
)
# embaumement # embaumement
mkdir -p $PKG/install mkdir -p $PKG/install
@ -84,5 +82,4 @@ $PRGNAM:
EOF EOF
# empaquetage # empaquetage
cd $PKG
makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz