9c9d25136d
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
120 lines
2.9 KiB
Bash
Executable file
120 lines
2.9 KiB
Bash
Executable file
#!/bin/sh
|
|
set -x
|
|
|
|
CWD=$(pwd)
|
|
|
|
PRGNAM=$(basename $CWD)
|
|
VERSION=master_$(date +"%Y.%m.%d_%H.%M")
|
|
|
|
BUILD=1
|
|
|
|
ARCH=$(uname -m)
|
|
#LIBSUFFIX=$(echo $ARCH | grep -o 64)
|
|
|
|
TAG=cyco
|
|
OUTPUT=/tmp
|
|
TMP=/tmp/$TAG
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
|
|
REPOSITORIES=/home/cycojesus/projets/packages/repositories/
|
|
|
|
PREFIX=/usr
|
|
|
|
# Cleaning
|
|
( cd $TMP
|
|
rm -fr $PRGNAM-$VERSION
|
|
rm -fr $PKG
|
|
)
|
|
|
|
# Fetching sources
|
|
( cd $TMP
|
|
if [ ! -e $REPOSITORIES/$PRGNAM ] ; then
|
|
mkdir -p $REPOSITORIES
|
|
cd $REPOSITORIES
|
|
git clone git://gitorious.org/fvkbd/fvkbd.git $PRGNAM
|
|
fi
|
|
|
|
( cd $REPOSITORIES/$PRGNAM
|
|
git pull
|
|
)
|
|
cp -R $REPOSITORIES/$PRGNAM $TMP/$PRGNAM-$VERSION
|
|
|
|
# [ ! -e $CWD/$PRGNAM-$VERSION.tar.?z* ] && \
|
|
# wget -c http://www.complang.tuwien.ac.at/forth/gforth/$PRGNAM-$VERSION.tar.gz -O $CWD/$PRGNAM-$VERSION.tar.gz
|
|
# tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
|
|
)
|
|
|
|
# Preparation
|
|
( cd $TMP/$PRGNAM-$VERSION
|
|
chown -R root:root .
|
|
find . \
|
|
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
|
-exec chmod 755 {} \; -o \
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
-exec chmod 644 {} \;
|
|
)
|
|
|
|
# Configuration
|
|
( cd $TMP/$PRGNAM-$VERSION
|
|
|
|
sed -i "s|lib/|lib$LIBSUFFIX/|g" $(grep -l "lib/" * -r)
|
|
[ ! -e configure ] && ./autogen.sh
|
|
./configure \
|
|
--prefix=$PREFIX \
|
|
--mandir=$PREFIX/man \
|
|
--sysconfdir=/etc \
|
|
--libdir=$PREFIX/lib$(echo $ARCH | grep -o 64) \
|
|
--libexecdir=$PREFIX/libexec
|
|
)
|
|
|
|
# Building
|
|
( cd $TMP/$PRGNAM-$VERSION
|
|
make
|
|
)
|
|
|
|
# Installation
|
|
( cd $TMP/$PRGNAM-$VERSION
|
|
make install DESTDIR=$PKG
|
|
|
|
mkdir -p $PKG$PREFIX/doc/$PRGNAM
|
|
cp -R AUTHORS BUGS COPYING* ChangeLog INSTALL* NEWS* README* TAGS ToDo $PKG$PREFIX/doc/$PRGNAM
|
|
)
|
|
|
|
# Cleaning
|
|
( cd $PKG
|
|
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
|
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
|
|
|
find $PKG$PREFIX/man -type f -name "*.?" -exec gzip -9 {} \;
|
|
find $PKG$PREFIX/info -name "dir" -exec rm {} \;
|
|
find $PKG$PREFIX/info -type f -exec gzip -9 {} \;
|
|
|
|
chown -R root:root .
|
|
find . \
|
|
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
|
-exec chmod 755 {} \; -o \
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
-exec chmod 644 {} \;
|
|
)
|
|
|
|
# Packaging
|
|
( cd $PKG
|
|
mkdir install
|
|
|
|
cat <<EOF > $PKG/install/slack-desc
|
|
$PRGNAM: $PRGNAM (Virtual keyboard)
|
|
$PRGNAM:
|
|
$PRGNAM: Fvkbd is a free and flexible Virtual Keyboard aims to provide fancy UI
|
|
$PRGNAM: and easy to config layouts.
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM: http://gitorious.org/fvkbd
|
|
$PRGNAM:
|
|
EOF
|
|
|
|
makepkg -l n -c n $OUTPUT/$PRGNAM-$(echo $VERSION | tr -d '-')-$ARCH-$BUILD$TAG.txz
|
|
)
|
|
|