#!/bin/bash



date_tag=$(date +%Y.%m.%d)
iso_name="Melawy-linux-${date_tag}-x86_64.iso"

cp          "../work/iso/arch/pkglist.x86_64.txt"                                "../boot/txt/Melawy-linux-${date_tag}-pkglist.txt"

echo "Sign ../boot/txt/${iso_name}.sig ../boot/iso/${iso_name}"
gpg --detach-sign --local-user BC8B600E8DDA1F4CB77B10D2BA803A261A5EE6B8 --output "../boot/txt/${iso_name}.sig" "../boot/iso/${iso_name}"


cd "../boot/iso/"

echo "sha1sum ${iso_name}"
sha1sum     "${iso_name}"                                                      > "../../boot/txt/${iso_name}.sha1"

echo "sha256sum ${iso_name}"
sha256sum   "${iso_name}"                                                      > "../../boot/txt/${iso_name}.sha256"

notify-send -a "$(basename $(pwd)): Make" -t 999999999 "finished" "$(date '+%Y.%m.%d %H:%M:%S')"

echo "Ready"
