Nov. 24th, 2009

The below steps are to set up a local Debian repository which would be available through APT with the following lines in /etc/apt/sources.list:
deb http://localhost/debian codedot main #Codedot Repository
deb-src http://localhost/debian codedot main #Codedot Repository
1 Installing `apache2' and `reprepro' packages, and creating directories /var/www/debian/{incoming,conf,temp}. Then, setting mode 777 for /var/www/debian/incoming to upload new packages there using method `local'.

2 Creating /var/www/debian/conf/distributions as follows:
Origin: Anton Salikhmetov
Label: Codedot
Suite: unstable
Codename: codedot
Version: 3.1
Architectures: amd64 source
Components: main
Description: Codedot Repository
SignWith: default
Tracking: all includechanges keepsources
DebIndices: Packages Release . .gz
DscIndices: Sources Release . .gz
3 Creating /var/www/debian/conf/incoming as follows:
Name: codedot
IncomingDir: /var/www/debian/incoming
TempDir: /var/www/debian/temp
Allow: codedot unstable
Default: codedot
4 Putting the GPG keys (~/.gnupg directory) with empty passphrase into root's home directory to allow `reprepro' program to sign the Release files in the repository automatically.

5 Creating crontab file /etc/cron.d/reprepro to automatically process the incoming directory every minute:
* * * * * root /usr/bin/reprepro -b /var/www/debian processincoming codedot
6 Editing the dput(1) configuration file /etc/dput.cf, section `local', as follows:
[local]
method                  = local
incoming                = /var/www/debian/incoming
run_dinstall            = 0
After the above steps have been done, new packages can be uploaded into to the local repository using the command `dput local *.changes'.
After `sbuild' and `debootstrap' packages and their dependencies, including schroot(1) software, had been installed, schroot(1) environment was prepared using the steps described below.

1 Adding the following configuration to /etc/schroot/schroot.conf:
[lenny]
type=directory
description=Debian Lenny (stable)
priority=1
root-groups=sbuild
location=/srv/chroot/lenny
aliases=stable,default
2 Running the following command to create the environment for schroot(1) which can be also used with sbuild(1):
sudo debootstrap --include=fakeroot --variant=buildd lenny /srv/chroot/lenny
3 Appending the file /srv/chroot/lenny/etc/apt/sources.list with the following line allowing sbuild(1) to retrieve the source packages from the local Debian repository inside schroot(1) environment, and build them:
deb-src http://localhost/debian codedot main
4 Adding the current user $username to `sbuild' group, e.g. using `sudo usermod -a -G sbuild $username' command.

5 Creating sbuild(1) configuration as follows:
$distribution = "lenny";
$chroot = "lenny";
$sbuild_mode = "user";
$log_dir = "logs";
$stats_dir = "stats";
1;
After the above steps have been done, the user (if re-logged in the system to get included into the `sbuild' group) is able to enter schroot(1) session just typing `schroot' command. /proc filesystem and home directory will be automatically mounted by schroot(1) into the guest system from the host one.

debootstrap(8) used above is also useful to install Debian userspace for those targets where Debian installers are hard to start for some reasons.

Finally, the schroot(1) environment created similarly to the above is a good way to build Debian packages using sbuild(1) to check dependency correctness. To build a source package that is available in the local repository (`schroot -u root apt-get update' is recommended before this step), the command `sbuild $package_$version' can easily be issued. It will then build the package and save the build logs and the resulting binary packages in the current directory.

Profile

Anton Salikhmetov

November 2018

S M T W T F S
    123
45678 910
11121314151617
18192021222324
252627282930 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 13th, 2025 06:14 pm
Powered by Dreamwidth Studios