#! /bin/bash

script_dir=`dirname $BASH_SOURCE`

control_file="$script_dir/control"
version=`cat $script_dir/../VERSION`

tmpdir=`mktemp -d`
mkdir "$tmpdir/DEBIAN"
cp "$control_file" "$tmpdir/DEBIAN/control"
sed -i s/'{VERSION}'/"$version"/ "$tmpdir/DEBIAN/control"

(cd "$script_dir/../.."; python3 setup.py install --root="$tmpdir")

dpkg-deb --build "$tmpdir" "fbmessenger-$version.deb"

#! /bin/bash

script_dir=`dirname $BASH_SOURCE`

control_file="$script_dir/control"
version=`cat $script_dir/../VERSION`

tmpdir=`mktemp -d`
mkdir "$tmpdir/DEBIAN"
cp "$control_file" "$tmpdir/DEBIAN/control"
sed -i s/'{VERSION}'/"$version"/ "$tmpdir/DEBIAN/control"

(cd "$script_dir/../.."; python3 setup.py install --root="$tmpdir")

fakeroot dpkg-deb --build "$tmpdir" "fbmessenger-$version.deb"

Fix permissions in Debian packages
Fix permissions in Debian packages

All files in the package should be owned by root (UID: 0), not by the user who created the package (according to the Debian policies).