67 lines
1.8 KiB
Bash
Executable file
67 lines
1.8 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
CWD=$(pwd)
|
|
|
|
PRGNAM=$(basename $CWD)
|
|
VERSION=${VERSION:-$(date +%Y.%m.%d)}
|
|
ARCH=$(uname -m)
|
|
BUILD=${BUILD:-1}
|
|
TAG=${TAG:-cyco}
|
|
TMP=${TMP:-/tmp/$TAG}
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
PREFIX=/usr
|
|
LIBSUFFIX=$(echo $ARCH | grep -o 64)
|
|
|
|
rm -rf $PKG
|
|
mkdir -p $TMP $PKG/usr $OUTPUT
|
|
cd $TMP || exit 1
|
|
|
|
[ ! -e $CWD/Copy.tgz ] && wget -c https://copy.com/install/linux/Copy.tgz -O $CWD/Copy.tgz
|
|
|
|
tar xvf $CWD/$PRGNAM.tgz || exit 1
|
|
cd copy || exit 1
|
|
chown -R root:root .
|
|
chmod -R u+w,go+r-w,a-s .
|
|
|
|
mkdir -p $PKG$PREFIX/{bin,lib$LIBSUFFIX,doc/$PRGNAM}
|
|
mv README $PKG$PREFIX/doc/$PRGNAM
|
|
if [ "$LIBSUFFIX" == "64" ]; then
|
|
cd x86_64
|
|
else
|
|
cd x86
|
|
fi
|
|
|
|
#This is not actually the version reported in the GUI, so we keep the date
|
|
#VERSION=$(strings CopyAgent | grep -i "Copy version" | grep -o "[0-9.]*" | grep \\\.)
|
|
|
|
mv CopyAgent CopyCmd CopyConsole copyext.rcc $PKG$PREFIX/bin
|
|
mv libBrt.so libCloudMount.so libCloudSync.so libGui.so libcaja-copy.so libnautilus-copy.so $PKG$PREFIX/lib$LIBSUFFIX
|
|
|
|
mkdir -p $PKG/install
|
|
cat <<EOF > $PKG/install/slack-desc
|
|
# HOW TO EDIT THIS FILE:
|
|
# The "handy ruler" below makes it easier to edit a package description. Line
|
|
# up the first '|' above the ':' following the base package name, and the '|'
|
|
# on the right side marks the last column you can put a character in. You must
|
|
# make exactly 11 lines for the formatting to be correct. It's also
|
|
# customary to leave one space after the ':'.
|
|
|
|
|-----handy-ruler------------------------------------------------------|
|
|
$PRGNAM: $PRGNAM (A cloud for people, friends, and companies.)
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM: https://www.copy.com/home/
|
|
$PRGNAM:
|
|
EOF
|
|
|
|
cd $PKG
|
|
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
|