#!/bin/bash
version=1.4.1
pkgname=cowrie

#Do not change dis directory
build_dir=/usr/share/$pkgname
work_dir=$(pwd)
tmp_dir=$work_dir/debian/$pkgname-tmp
rm -rf $build_dir
rm -rf $work_dir/cowrie-env
mkdir -p $build_dir $tmp_dir
cd $build_dir

virtualenv cowrie-env
. cowrie-env/bin/activate
pip install -r $work_dir/requirements.txt
deactivate

echo ""
echo -n "File compression started. Please wait..."
tar -cJf $tmp_dir/${pkgname}.tar.xz cowrie-env
echo "done"

cd $work_dir

rm -rf $build_dir

