introduction

I'll show how to create a repository that serves software in both binary and source code forms using apt and reprepro.

what is apt

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.

why create a custom repository?

A custom repository can greatly enhances security auditing and quality assurance of the software you distribute.

repository creation

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

adding packages to repository

binaries

reprepro -b repos -C comp1 includedeb \
  alpha ~/gij_4%3a4.2.1-6_i386.deb
reprepro -b repos -C comp2 includedeb \
  alpha ~/python-uno_2.2.1-8_i386.deb

sources

reprepro -b repos -C comp1 includedsc \
  alpha ~/git-core_1.5.3.1-1.dsc
reprepro -b repos -C comp1 -P required -S admin \
  includedsc alpha ~/runit_1.7.2-1.dsc

query

reprepro -b repos list alpha gij
reprepro -b repos list alpha python-uno
reprepro -b repos list alpha git-core
reprepro -b repos list alpha runit

references

© 2007-2008 Alexandre Girão