summaryrefslogtreecommitdiffstats
path: root/docs/short-howto
blob: bf55bce7e8edaaa68a0d31b135eb5caf6a462b32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
This short HOW-TO describes how to setup a repository using reprepro.

First choose a directory where you want to store your repository,

1) Configuration:

Generate a directory named 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 of the distribution is specified with Codename:.
It is the primary name of a distribution and e.g. used to determine the
directory to create and put the index files into.

Update: is described later.

If SignWith: is there, it will try to sign it: either use "yes" or give
something gpg can use to identify the key you want 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" and "-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 "Architecture: 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 package 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 conf directory given
with --conf, defaulting to "conf" in the current directory (or in the
directory specified with --basedir, if that is given).

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 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:
VerifyRelease: B629A24C38C6029A

Name: security
Method: http://security.debian.org/debian-security
Suite: */updates
UDebComponents:
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,
those of the distribution to be added are used.
The suite of the target can be used as "*" in the Suite: here.
VerifyRelease: tells which GPG key 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>

===============================================================================
The following is from V. Stanley Jaddoe <debian@terabytemusic.cjb.net>.
Make sure to include all sources when allowing everyone access to software
only available under GPL to you. Well, you should always supply sources,
but in some cases not doing so might cause you trouble.

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 None
        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