# the first time use:
#  git clone https://github.com/OpenShot/openshot-qt.git

# once you have cloned the repository you can use
cd openshot-qt
git stash
git pull

VERSION=$( wget http://www.openshot.org/version/json/ -qO- | sed -es/^.*:\s*// | sed -es/^.\"//  | sed -es/\".*$// )

PKG=/tmp/openshot-${VERSION}

python3 setup.py install --root=$PKG

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

mkdir -p $PKG/usr/doc/openshot-$VERSION
wget https://slackbuilds.org/slackbuilds/14.2/multimedia/openshot/README -O $PKG/usr/doc/openshot-${VERSION}/README
mkdir -p $PKG/install
wget https://slackbuilds.org/slackbuilds/14.2/multimedia/openshot/slack-desc -O $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n /tmp/openshot-$VERSION-x86_64-1airaghi.txz




