Package: reprepro
Version: 0.3-1
Severity: wishlist
Tags: patch

Hi, I have written a small extension to the existing how-to. It describes how 
to set up a virtual debian/ directory with apache2 in a clean way.

Please apply the attached patch, thanks!

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12p2
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
1c1
< This is a short how to setup a repository.
---
> This short HOW-TO describes how to setup a repository using reprepro.
3c3,4
< First choose some directory you want your things in.
---
> First choose a directory where you want store your repository,
> for example: /srv/reprepro/
5c6
< 1) Config
---
> 1) Configuration
7,9c8,13
< Generate a directory named conf/
< Place a file named "distributions" there.
< There add things like:
---
> Create a directory named conf/
> 
> mkdir -p /srv/reprepro/conf/
> 
> Create a file named "distributions" there.
> Add entries such as:
38c42
< Multiple such entries are seperated with an empty line.
---
> Multiple entries are separated with an empty line.
40c44
< the Update line is described later, when SignWith is there,
---
> the Update line is described later, if SignWith is set,
43c47
< The other fields are copies into the appropiate Release files
---
> The other fields are copied into the appropriate Release files
47c51
< 2) Add files
---
> 2) Adding files to the repository
60c64
< fitting, only "Architecture: all" packages are placed exactly in theese
---
> fitting, only "Architecture: all" packages are placed exactly in these
64c68
< 3) to remove files:
---
> 3) Removing files from the repository
68c72
< to only delete in a specific component or architecture:
---
> to only remove from a specific component or architecture:
72c76
< 4) getting informations:
---
> 4) Getting information about a package:
79c83
< the applicaple override file from the distribution it is placed
---
> the applicable override file from the distribution it is placed
87a92
> 
91c96
< 6) importing from upstream represetories
---
> 6) importing from upstream repositories
93c98
< In conf/updates can be entries like this:     
---
> The file /srv/reprepro/conf/updates can contain entries like this:
117c122
< (Place some irreal component like "none" there if you want
---
> (Place a not existing component like "none" there if you want
124c129
< "Method:" describes a apt-method, for which the programs
---
> "Method:" describes an apt-method, for which the programs
138c143
< The value for VerifyRelease can be get by 
---
> The value for VerifyRelease can be retrieved using:
140a146,202
> 
> ===============================================================================
> 
> Using reprepro with apache2 (sarge, etch, sid)
> 
> This example assumes the reprepro repository is under /srv/reprepro/ and that
> apache2 has been correctly installed and configured
> 
> The first step is to create a virtual directory called debian/.
> Assuming your server runs the host http://www.example.com/, the web repository
> will be placed at http://www.example.com/debian/
> 
> Create an apache2 config file in the conf dir of your reprepro repository, 
> using the following command:
> 
> cat > /srv/reprepro/conf/apache.conf << EOF
> Alias /debian /srv/reprepro/
> <Directory /srv/reprepro>
>         Options +Indexes
>         AllowOverride All
>         order allow,deny
>         allow from all
> </Directory>
> EOF
> 
> 
> To enable this virtual directory, a symlink has to be created. This can be 
> done 
> using the following command:
> 
> ln -s /srv/reprepro/conf/apache.conf /etc/apache2/conf.d/reprepro.conf
> 
> The second step is setting the permissions in such a way that web users can 
> browse the repository, but cannot view the reprepro specific configuration.
> This can be done using the following commands:
> 
> chown -R root:root /srv/reprepro/
> chmod 755 /srv/reprepro/
> chown -R root:www-data /srv/reprepro/dists/ /srv/reprepro/pool/
> chmod 750 /srv/reprepro/*
> 
> Reload apache2:
> 
> /etc/init.d/apache2 reload
> 
> Check if the repository is viewable by web-users, by pointing your browser to
> 
> http://www.example.com/debian/
> 
> If there are no problems with your reprepro repository and the apache2 
> configuration, you should see two directories, dists/ and pool/.
> 
> The last step is to add this new repository to your sources.list
> This is as easy as:
> 
> echo "deb http://www.example.com/debian pcpool main non-free contrib" >> 
> /etc/apt/sources.list
> 
> 
This short HOW-TO describes how to setup a repository using reprepro.

First choose a directory where you want store your repository,
for example: /srv/reprepro/

1) Configuration

Create a directory named conf/

mkdir -p /srv/reprepro/conf/

Create a file named "distributions" there.
Add entries such as:

Origin: Debian
Label: Debian-All
Suite: stable
Codename: woody
Version: 3.0
Architectures: i386 sparc mips source
Components: main non-free contrib
Description: Debian woody + woody/non-US + woody/updates
#Update: debian non-US security
#SignWith: yes

or: 

Origin: PCPool
Label: PCPool
Suite: stable
Codename: pcpool
Version: 3.0
Architectures: i386 source
Components: main non-free contrib bad protected server
UDebComponents: main
Description: PCPool specific (or backported) packages
SignWith: yes
DebOverride: override
UDebOverride: override
DscOverride: srcoverride

Multiple entries are separated with an empty line.
The codename is used to determine the directory to create,
the Update line is described later, if SignWith is set,
it will try to sign it. (It cannot yet be used to tell which
key to use).
The other fields are copied into the appropriate Release files
generated.


2) Adding files to the repository

To add a .deb manually:

reprepro -Vb . includedeb pcpool 
/var/cache/apt/archives/libc6_2.2.5-11.8_i386.deb

to add a .changes file:

reprepro -Vb . include pcpool test.changes

Hint: you can add -C component, -A architecture, -S section, -P priority
to give additional hints where it should go. (Note -A will not overwrite
something to go into another architecture, but simply ignore those not
fitting, only "Architecture: all" packages are placed exactly in these
architecture. (Helps when it is not available for all architectures and
each binary version needs a fitting version of the Arch:all package))

3) Removing files from the repository
        
reprepro -Vb . remove pcpool libc6

to only remove from a specific component or architecture:

reprepro -Vb . -C main -A i386 remove pcpool libc6

4) Getting information about a package:
To see in which architectures/components a packages exists and which version it 
uses.

reprepro -b . list pcpool libc6

5) Override-Files
When including packages via includedeb, includedsc or include
the applicable override file from the distribution it is placed
into is used. The file given by DebOverride for ".deb"s, the
file given by UDebOverride for ".udeb"s and the file given by 
DscOverride for ".dsc"s. If the filename starts with
a slash (/) it is not relative to the override directory given
with --override (Default is basedir + "override"). 

Note that the Format is those of apt-ftparchive's ExtraOverride, not the old 
format.
An (stupid) example line for that file would be:

libc6 Priority extra


6) importing from upstream repositories

The file /srv/reprepro/conf/updates can contain entries like this:

Name: debian
Method: http://ftp.debian.de/debian 
VerifyRelease: F1D53D8C4F368D5D

Name: non-US
Method: http://ftp.debian.de/debian-non-US 
Suite: */non-US
Architectures: i386 sparc mips source
Components: main>main non-free>non-free contrib>contrib
UDebComponents: none
VerifyRelease: B629A24C38C6029A

Name: security
Method: http://security.debian.org/debian-security 
Suite: */updates 
UDebComponents: none
VerifyRelease: F1D53D8C4F368D5D

Which of those are used is determined by the "Update:" line
in the description in conf/distributions. When "Suite:",
"Architecture:", "Components" or "UDebComponents" are not given
or empty, those of the distribution to be added are used.
(Place a not existing component like "none" there if you want
 only the other of Components or UDebComponents). The suite of 
the target can be used as "*" in the Suite here. "VerifyRelease:" 
tells which gpgkey to use checking the Release.gpg. 
(Add a "IgnoreRelease: yes" to ignore any Release files)
To import components in other components, use the source>target
syntax.
"Method:" describes an apt-method, for which the programs
from /usr/lib/apt/methods are used...

To update everything possible do:

reprepro -b . update

To only update some distributions do:

reprepro -b . update woody

(There is no support for updating a distribution from only specific
 upstreams yet. You will have to edit conf/distributions for that)

The value for VerifyRelease can be retrieved using:

gpg --with-colons --list-keys <whatever>

===============================================================================

Using reprepro with apache2 (sarge, etch, sid)

This example assumes the reprepro repository is under /srv/reprepro/ and that
apache2 has been correctly installed and configured

The first step is to create a virtual directory called debian/.
Assuming your server runs the host http://www.example.com/, the web repository
will be placed at http://www.example.com/debian/

Create an apache2 config file in the conf dir of your reprepro repository, 
using the following command:

cat > /srv/reprepro/conf/apache.conf << EOF
Alias /debian /srv/reprepro/
<Directory /srv/reprepro>
        Options +Indexes
        AllowOverride All
        order allow,deny
        allow from all
</Directory>
EOF


To enable this virtual directory, a symlink has to be created. This can be done 
using the following command:

ln -s /srv/reprepro/conf/apache.conf /etc/apache2/conf.d/reprepro.conf

The second step is setting the permissions in such a way that web users can 
browse the repository, but cannot view the reprepro specific configuration.
This can be done using the following commands:

chown -R root:root /srv/reprepro/
chmod 755 /srv/reprepro/
chown -R root:www-data /srv/reprepro/dists/ /srv/reprepro/pool/
chmod 750 /srv/reprepro/*

Reload apache2:

/etc/init.d/apache2 reload

Check if the repository is viewable by web-users, by pointing your browser to

http://www.example.com/debian/

If there are no problems with your reprepro repository and the apache2 
configuration, you should see two directories, dists/ and pool/.

The last step is to add this new repository to your sources.list
This is as easy as:

echo "deb http://www.example.com/debian pcpool main non-free contrib" >> 
/etc/apt/sources.list


Reply via email to