9c9d25136d
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
88 lines
1.9 KiB
Bash
Executable file
88 lines
1.9 KiB
Bash
Executable file
#!/bin/sh -x
|
|
|
|
# variables
|
|
TAG=cyco
|
|
OUTPUT=/tmp
|
|
TMP=/tmp/$TAG
|
|
CWD=$(pwd)
|
|
|
|
PRGNAM=textroom
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
|
|
VERSION=0.6.5
|
|
|
|
EXT=tar.gz
|
|
|
|
DOCS="AUTHORS ChangeLog COPYING INSTALL NEWS README TODO"
|
|
|
|
ARCH=x86_64
|
|
BUILD=1
|
|
|
|
|
|
PREFIX=/usr
|
|
|
|
SLCKFLAGS="-fPIC -O2"
|
|
|
|
# nettoyage préalable
|
|
rm -fr $PKG $TMP/$PRGNAM-$VERSION
|
|
|
|
mkdir -p $PKG
|
|
|
|
# mise en place
|
|
cd $TMP
|
|
[ ! -e $CWD/$PRGNAM-$VERSION.$EXT ] && wget -c http://textroom.googlecode.com/files/$PRGNAM-$VERSION.$EXT -O $CWD/$PRGNAM-$VERSION.$EXT
|
|
tar xf $CWD/$PRGNAM-$VERSION.$EXT
|
|
cd $PRGNAM-$VERSION
|
|
|
|
# configuration
|
|
sed -i "s|/usr/local/textroom/doc|/usr/doc/$PRGNAM-$VERSION|" textroom.pro
|
|
sed -i "s|usr/local|usr|g" textroom.pro
|
|
sed -i 's|lhunspell|lhunspell-1.2|g' textroom.pro
|
|
qmake
|
|
|
|
# compilation
|
|
make -j3 PREFIX=$PREFIX
|
|
|
|
# installation
|
|
make install INSTALL_ROOT=$PKG
|
|
mv $PKG/root/.local/applications $PKG/usr/share/
|
|
rm -fr $PKG/root
|
|
#no need for this
|
|
rm -f $PKG/usr/bin/textroom-uninstall
|
|
|
|
# correction
|
|
cd $PKG
|
|
chown -R root:root *
|
|
|
|
# mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
# cd $TMP/$PRGNAM-$VERSION
|
|
# cp -R $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
|
|
|
|
# Strip binaries
|
|
( 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
|
|
)
|
|
|
|
|
|
# embaumement
|
|
mkdir -p $PKG/install
|
|
cat <<EOF > $PKG/install/slack-desc
|
|
$PRGNAM: $PRGNAM (Anti-distraction text editor)
|
|
$PRGNAM:
|
|
$PRGNAM: TextRoom is a pretty basic full-screen text editor, heavily inspired
|
|
$PRGNAM: by similar text editors such as Q10, JDarkRoom and so on.
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM: see /usr/doc/$PRGNAM-$VERSION for more details
|
|
$PRGNAM:
|
|
EOF
|
|
|
|
# empaquetage
|
|
cd $PKG
|
|
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz
|