#!/bin/sh


rm -f Packages Sources Packages.gz Sources.gz Release Release.gpg

dpkg-scanpackages . > Packages
dpkg-scansources . > Sources

(
cat << EOF
Suite: .
Codename: .
Date: `date -R`
Architectures: all
Components: .
SHA256:
 $(sha256sum < Packages | cut -d' ' -f 1) $(stat --printf '%s' Packages) Packages
 $(sha256sum < Sources | cut -d' ' -f 1) $(stat --printf '%s' Sources) Sources
EOF
) | tee Release
gzip -9 Packages Sources
gpg --detach-sign -o Release.gpg Release