Slack (Application)

From campisano.org
Jump to navigation Jump to search

Slack

Install

# shared/opt install schema v1.5.5

#### as common user ####
# define applications vars
export SOFTWARE_PATH="/home/shared/opt/software"
export NAME="slack"
export VERSION="4.0.2" # last working version without suid
export URL="https://downloads.slack-edge.com/linux_releases/slack-desktop-${VERSION}-amd64.deb"
su - -w SOFTWARE_PATH,NAME,VERSION

#### as root ####
# install packages and prepare destination path
apt-get -qq -y install wget coreutils findutils tar xz-utils binutils gconf2 gconf-service libgtk2.0-0 libudev1 libgcrypt20 libnotify4 libxtst6 libnss3 python gvfs-bin xdg-utils apt-transport-https libxss1 libappindicator1 libcurl3-gnutls libsecret-1-0
mkdir -m 777 "${SOFTWARE_PATH}/tmp_install/" "${SOFTWARE_PATH}/${NAME}_${VERSION}/"
exit

#### as common user ####
umask 0027
cd "${SOFTWARE_PATH}/tmp_install"
wget -c --no-check-certificate "${URL}"
ar -x "slack-desktop-${VERSION}-amd64.deb"
tar --no-overwrite-dir -xmJf data.tar.xz -C "${SOFTWARE_PATH}/${NAME}_${VERSION}"
cd
su - -w SOFTWARE_PATH,NAME,VERSION

#### as root ####
# ensure permissions to destination path
cd "${SOFTWARE_PATH}"
chown -R root:users "${NAME}_${VERSION}"
find "${NAME}_${VERSION}" -type d -exec chmod a-s,u+rwx,g+rx,g-w,o-rwx {} \;
find "${NAME}_${VERSION}" -type f -exec chmod a-s,u+rw,g+r,g-w,o-rwx {} \;
rm -rf tmp_install
ln -s -f -T "${NAME}_${VERSION}" "${NAME}"
exit

#### as common user ####
# test the application
"${SOFTWARE_PATH}/${NAME}/usr/bin/slack"