2014-01-21 17:20:20 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2015-01-30 14:52:15 +01:00
|
|
|
# Slackware build script for "pydio-sync".
|
2014-01-21 17:20:20 +01:00
|
|
|
|
2016-03-31 22:33:28 +02:00
|
|
|
# Copyright 2013-2016 Marcel Saegebarth <marc@mos6581.de>
|
2014-01-21 17:20:20 +01:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions are
|
|
|
|
# met:
|
|
|
|
#
|
|
|
|
# * Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
PRGNAM=pydio-sync
|
2016-07-24 15:05:00 +02:00
|
|
|
VERSION=${VERSION:-1.2.6}
|
2017-07-02 16:35:54 +02:00
|
|
|
BUILD=${BUILD:-2}
|
2014-01-21 17:20:20 +01:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2016-03-31 22:33:28 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2017-07-02 16:35:54 +02:00
|
|
|
i?86) ARCH=i586 ;;
|
2016-03-31 22:33:28 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
2014-01-21 17:20:20 +01:00
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2017-07-02 16:35:54 +02:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2016-03-31 22:33:28 +02:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2014-01-21 17:20:20 +01:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
2016-03-31 22:33:28 +02:00
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2014-01-21 17:20:20 +01:00
|
|
|
else
|
2016-03-31 22:33:28 +02:00
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2014-01-21 17:20:20 +01:00
|
|
|
fi
|
|
|
|
|
2016-07-24 15:05:00 +02:00
|
|
|
set -e
|
2014-01-21 17:20:20 +01:00
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
2016-03-31 22:33:28 +02:00
|
|
|
rm -rf $PRGNAM-$VERSION
|
2016-07-24 15:05:00 +02:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
|
2016-03-31 22:33:28 +02:00
|
|
|
cd $PRGNAM-$VERSION
|
2014-01-21 17:20:20 +01:00
|
|
|
chown -R root:root .
|
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
|
|
|
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
2015-01-30 14:52:15 +01:00
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
2014-01-21 17:20:20 +01:00
|
|
|
|
2016-07-24 15:05:00 +02:00
|
|
|
PYTHONVER=$(python -c 'import sys; print sys.version[:3]')
|
2014-01-21 17:20:20 +01:00
|
|
|
|
2016-03-31 22:33:28 +02:00
|
|
|
(
|
2016-07-24 15:05:00 +02:00
|
|
|
cd src/systray
|
|
|
|
|
|
|
|
# fix destination path
|
|
|
|
sed -i "/^ target.path = \.\//c\ target.path = $PKG\/usr\/bin" systray.pro
|
|
|
|
|
|
|
|
qmake-qt5 systray.pro
|
|
|
|
|
|
|
|
# fix compiler flags
|
|
|
|
sed -i "/^CFLAGS/c\CFLAGS=$SLKCFLAGS" Makefile
|
2017-07-02 16:35:54 +02:00
|
|
|
sed -i "/^CXXFLAGS/c\CXXFLAGS=$SLKCFLAGS -std=c++11" Makefile
|
2016-07-24 15:05:00 +02:00
|
|
|
|
|
|
|
make
|
|
|
|
make install
|
2016-03-31 22:33:28 +02:00
|
|
|
)
|
|
|
|
|
2016-07-24 15:05:00 +02:00
|
|
|
cat << EOF > $PKG/usr/bin/$PRGNAM
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
export PYTHONPATH=/opt/pydio-agent/usr/lib${LIBDIRSUFFIX}/python${PYTHONVER}/site-packages
|
|
|
|
python -m pydio.main &> /dev/null &
|
|
|
|
/usr/bin/pydio-ui &> /dev/null &
|
|
|
|
EOF
|
|
|
|
chmod 0755 $PKG/usr/bin/$PRGNAM
|
2014-01-21 17:20:20 +01:00
|
|
|
|
2016-07-24 15:05:00 +02:00
|
|
|
install -D -m 644 \
|
|
|
|
$CWD/$PRGNAM.desktop $PKG/usr/share/applications/$PRGNAM.desktop
|
|
|
|
install -D -m 644 \
|
|
|
|
$CWD/${PRGNAM}_128x128.png $PKG/usr/share/pixmaps/${PRGNAM}_128x128.png
|
2014-01-21 17:20:20 +01:00
|
|
|
|
2016-03-31 22:33:28 +02:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2016-07-24 15:05:00 +02:00
|
|
|
cp -a LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION
|
2014-01-21 17:20:20 +01:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|