I'll show how to create a repository that serves software in both
binary and source code forms using apt and reprepro.
The apt projects stands for Advanced Packaging Tool and is the tool of
choice for Debian,
Ubuntu, Fink and many
successful others.
apt has powerful features, it has the ability to handle multiple
binary architectures plus source code, uses a topological sorting
algorithm for fast and correct dependency check and is also worth
mentioning that apt uses signed packages with gnupg.
More information about apt can be found
here.
A custom repository can greatly enhances security auditing and quality
assurance of the software you distribute.
Below is a fictitious repository to show the elements of a repository
and how they relate to each other.
cd /tmp
install -d -m0755 \
repos/conf \
repos/override
cat << 'EOF' > repos/conf/distributions
Codename: alpha
Components: comp1 comp2
Architectures: sparc i386 source
Origin: origin-a
Version: 12.3
Description: alpha repository
DscOverride: alpha.src
DebIndices: . .bz2 .gz
UDebIndices: . .bz2 .gz
DscIndices: . .bz2 .gz
Codename: bravo
Components: comp1 comp2
Architectures: sparc i386 source
Origin: origin-b
Version: 23.4
Description: bravo repository
DscOverride: bravo.src
DebIndices: . .bz2 .gz
UDebIndices: . .bz2 .gz
DscIndices: . .bz2 .gz
EOF
cat << 'EOF' > repos/override/alpha.src
git-core Section devel
git-core Priority optional
git-core The Maintainer <the@maintainer>
EOF
cat << 'EOF' > repos/override/bravo.src
EOF