# Start from ~/src
mkdir -p -m 0700 ~/src
cd ~/src
# If it's there already, clean it up and update it
test -d ./pcloudcc &&
( cd pcloudcc
test -f Makefile && make distclean
git fetch )
# If it's not there already, get it via 'git clone'
test ! -d ./pcloudcc &&
git clone https://github.com/pcloudcom/console-client.git ./pcloudcc/
cd pcloudcc
test $UID = 0 && chown -R root:root .
# Build this part
cd pCloudCC/lib/pclsync
make clean
make fs
# And now build this part
cd ../mbedtls
rm -f CMakeCache.txt
cmake .
make clean
make
# Configure the build of pcloudcc
cd ../..
rm -f CMakeCache.txt
cmake .
# If you're 64-bit, change lib to lib64
cat cmake_install.cmake |
sed 's%CMAKE_INSTALL_PREFIX}/lib%CMAKE_INSTALL_PREFIX}/lib64%g' \
> cmake_install.cmake.new
test -s cmake_install.cmake.new &&
( mv -f cmake_install.cmake cmake_install.cmake.old
mv -f cmake_install.cmake.new cmake_install.cmake )
# Build it
make
# Become root
su
# Install it
make install
ldconfig
# Become your non-root user again
exit
# Run it in the foreground, -s will save your password in a database
# (username = pCloud username, not local Linux username)
pcloudcc -u username -p -s
# Run it as a daemon in the background, having previously run it with -s
# (-m defaults to /home/username/pCloudDrive)
pcloudcc -u username -d