Skip to content

Instantly share code, notes, and snippets.

@spahl
Created November 1, 2012 23:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spahl/3997721 to your computer and use it in GitHub Desktop.
Save spahl/3997721 to your computer and use it in GitHub Desktop.
generate a local deb repo for testing
#!/bin/bash
set -e
set -x
cd /var/www
mkdir -p packages
cd packages/
mkdir -p pool/main
mkdir -p dists/squeeze/main/binary-amd64
mkdir -p .cache
cat > apt-release.conf <<"EOF"
APT::FTPArchive::Release::Codename "squeeze";
APT::FTPArchive::Release::Origin "debvm.local";
APT::FTPArchive::Release::Components "main";
APT::FTPArchive::Release::Label "Test Repo";
APT::FTPArchive::Release::Architectures "amd64";
APT::FTPArchive::Release::Suite "squeeze";
EOF
cat > apt-ftparchive.conf <<"EOF"
Dir {
ArchiveDir ".";
CacheDir "./.cache";
};
Default {
Packages::Compress ". gzip bzip2";
Contents::Compress ". gzip bzip2";
};
TreeDefault {
BinCacheDB "packages-$(SECTION)-$(ARCH).db";
Directory "pool/$(SECTION)";
Packages "$(DIST)/$(SECTION)/binary-$(ARCH)/Packages";
Contents "$(DIST)/Contents-$(ARCH)";
};
Tree "dists/squeeze" {
Sections "main";
Architectures "amd64";
}
EOF
cp /tmp/*.deb pool/main/
apt-ftparchive generate apt-ftparchive.conf
apt-ftparchive -c apt-release.conf release dists/squeeze > dists/squeeze/Release
gpg --yes -abs -u aptrepo -o dists/squeeze/Release.gpg dists/squeeze/Release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment