2017-03-01 11:56:49 +01:00
|
|
|
#!/bin/sh
|
2014-03-16 07:20:55 +01:00
|
|
|
|
|
|
|
# variables
|
|
|
|
CWD=$(pwd)
|
|
|
|
|
|
|
|
PRGNAM=$(basename $CWD)
|
|
|
|
VERSION=${VERSION:-$(date +"%Y.%m.%d_%H.%M")}
|
2015-01-08 09:43:10 +01:00
|
|
|
STABLE=${STABLE:-"NO"}
|
2014-03-16 07:20:55 +01:00
|
|
|
ARCH=${ARCH:-$(uname -m)}
|
|
|
|
BUILD=1
|
|
|
|
|
|
|
|
TAG=cyco
|
|
|
|
TMP=/tmp/$TAG
|
|
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
|
|
OUTPUT=/tmp
|
|
|
|
|
|
|
|
REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM
|
|
|
|
|
|
|
|
PREFIX=/usr
|
|
|
|
|
|
|
|
SLCKFLAGS=" -O "
|
|
|
|
|
|
|
|
# nettoyage préalable
|
|
|
|
rm -fr $PKG $TMP/$PRGNAM
|
|
|
|
|
|
|
|
mkdir -p $PKG
|
|
|
|
|
|
|
|
# mise en place
|
|
|
|
cd $TMP
|
2015-01-08 09:43:10 +01:00
|
|
|
if [ "x$STABLE" == "xYES" ]; then
|
2015-10-23 14:42:44 +02:00
|
|
|
wget -c https://download.owncloud.com/desktop/stable/$PRGNAM-$VERSION.tar.xz -O $CWD/$PRGNAM-$VERSION.tar.xz
|
|
|
|
tar xf $CWD/$PRGNAM-$VERSION.tar.xz
|
2014-03-16 07:20:55 +01:00
|
|
|
else
|
2016-09-18 22:28:40 +02:00
|
|
|
[ ! -e $REPOSITORY ] && git clone https://github.com/nextcloud/client_theming.git $REPOSITORY
|
|
|
|
|
2016-08-25 19:12:27 +02:00
|
|
|
( cd $REPOSITORY
|
|
|
|
git pull
|
2016-11-13 16:32:57 +01:00
|
|
|
git submodule update --init --recursive )
|
2016-08-25 19:12:27 +02:00
|
|
|
|
2016-09-18 22:28:40 +02:00
|
|
|
VERSION="$( cd $REPOSITORY && git log -1 --format=%h_%ad --date=format:%Y.%m.%d )"
|
2014-04-04 08:25:25 +02:00
|
|
|
cp -R $REPOSITORY $TMP/$PRGNAM-$VERSION
|
2014-03-16 07:20:55 +01:00
|
|
|
fi
|
|
|
|
|
2016-11-13 16:32:57 +01:00
|
|
|
cd $TMP/$PRGNAM-$VERSION/client
|
2014-03-16 07:20:55 +01:00
|
|
|
|
|
|
|
# configuration
|
|
|
|
cmake \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=$PREFIX \
|
|
|
|
-DSYSCONFDIR=/etc \
|
2016-08-25 19:12:27 +02:00
|
|
|
-D OEM_THEME_DIR=`pwd`/../nextcloudtheme \
|
2016-11-13 16:32:57 +01:00
|
|
|
.
|
2014-03-16 07:20:55 +01:00
|
|
|
|
|
|
|
# compilation
|
|
|
|
make -j3
|
|
|
|
|
|
|
|
# installation
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
|
|
|
# correction
|
|
|
|
cd $PKG
|
|
|
|
chown -R root:root *
|
|
|
|
|
|
|
|
find $PKG -name \.git\* -exec rm -fr {} \;
|
|
|
|
|
|
|
|
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
|
|
|
|
|
|
|
|
# Strip binaries
|
2016-11-13 16:32:57 +01:00
|
|
|
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
|
2014-03-16 07:20:55 +01:00
|
|
|
|
|
|
|
# embaumement
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat <<EOF > $PKG/install/slack-desc
|
2016-08-25 19:12:27 +02:00
|
|
|
$PRGNAM: $PRGNAM (NextCloud Desktop Syncing Client)
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM: nextcloud themed desktop client
|
2014-03-16 07:20:55 +01:00
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
2016-08-25 19:12:27 +02:00
|
|
|
$PRGNAM: https://github.com/nextcloud/client_theming
|
2014-03-16 07:20:55 +01:00
|
|
|
$PRGNAM:
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# empaquetage
|
|
|
|
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz
|