#!/bin/bash
#########################
REPODIR=.
PACKFILE=Packages
SRCFILE=Sources
RELFILE=Release
#########################

PPD=`pwd`
cd $REPODIR

rm -f PACKFILE* SRCFILE* RELFILE*

# rebuild rsyncable Packages.{gz}
apt-ftparchive packages $REPODIR | gzip --rsyncable > $PACKFILE.gz
zcat $PACKFILE.gz > $PACKFILE

# rebuild rsyncable Sources.{gz}
apt-ftparchive sources  $REPODIR | gzip --rsyncable > $SRCFILE.gz
zcat $SRCFILE.gz  > $SRCFILE

# rebuild Release
apt-ftparchive release  $REPODIR \
-o=APT::FTPArchive::Release::Origin="Bulgarian Debian Users" \
-o=APT::FTPArchive::Release::Label=debian-addons-bg \
-o=APT::FTPArchive::Release::Suite=unstable \
-o=APT::FTPArchive::Release::Date="`date`"\" \
-o=APT::FTPArchive::Release::Architectures="source, i386" \
-o=APT::FTPArchive::Release::Component=main \
-o=APT::FTPArchive::Release::Description="Bulgarian addons to the Debian unstable distribution" \
> $RELFILE

cd $PPD
