Following the Eric S. Raymond philosophy of Release early, release often, you are visiting a real bazaar. This website is a work in progress!
11 Sep

Howto create your own Ubuntu repository

Ubuntu and Debian packages are all bundled in something what is called a repository. Some people, like me, create their own:

Note:

My repository links with the Jaunty distribution (that is Ubuntu 9.04). Your can connect yours to any other, like Debians experimental repository.

First create your own repository.

My repository is accessible over the web, so I installed it on my web server:

::::console
[email protected]:~$ cd /var/www/
[email protected]:/var/www$ sudo mkdir packages
[email protected]:/var/www$ cd packages/

In this /var/www/packages we will create a pool, the 'jaunty' distribution and the cache directories:

::::console
[email protected]:/var/www/packages$ sudo mkdir -p pool/main
[email protected]:/var/www/packages$ sudo mkdir -p dists/jaunty/main/binary-i386
[email protected]:/var/www/packages$ sudo mkdir .cache

Now two files need to be created. The first one is the apt-release.conf. Make sure that it looks like:

::::console
APT::FTPArchive::Release::Codename "jaunty";
APT::FTPArchive::Release::Origin "elevenbits.com";
APT::FTPArchive::Release::Components "main";
APT::FTPArchive::Release::Label "ElevenBits Ubuntu Repository";
APT::FTPArchive::Release::Architectures "i386";
APT::FTPArchive::Release::Suite "jaunty;

The second file is called apt-ftparchive.conf. This one should look like:

::::console
Dir {
     ArchiveDir ".";
     CacheDir "./.cache";
};

Default {
     Packages::Compress ". gzip bzip2";
     Contents::Compress ". gzip bzip2";
};

TreeDefault {
     BinCacheDB "packages-$(SECTION)-$(ARCH).db";
     Directory "pool/$(SECTION)";
     Packages "$(DIST)/$(SECTION)/binary-$(ARCH)/Packages";
     Contents "$(DIST)/Contents-$(ARCH)";
};

Tree "dists/jaunty" {
     Sections "main";
     Architectures "i386";
}

After you'd created these file your system should look like this:

::::console
[email protected]:/var/www/packages$ ls -al
total 28
drwxr-xr-x 5 root root 4096 Aug 14 13:32 .
drwxr-xr-x 3 root root 4096 Aug 14 13:22 ..
drwxr-xr-x 2 root root 4096 Aug 14 13:26 .cache
-rw-r--r-- 1 root root  427 Aug 14 13:32 apt-ftparchive.conf
-rw-r--r-- 1 root root  282 Aug 14 13:30 apt-release.conf
drwxr-xr-x 3 root root 4096 Aug 14 13:26 dists
drwxr-xr-x 3 root root 4096 Aug 14 13:26 pool

Add your own packages and update the repository.

Here the yourpackage package version 1.0 is copied into the new (empty) repository:

::::console
[email protected]:~$ cd /var/www/packages/pool/main
[email protected]:/var/www/packages/pool/main$ sudo cp ~/yourpackage_1.0_all.deb .

Now the repo needs to be initialized. This you can do using these commands:

::::console
[email protected]:~$ cd /var/www/packages
[email protected]:/var/www/packages$ sudo apt-ftparchive generate apt-ftparchive.conf
 pool/main: 1 files 9900B 0s
Done Packages, Starting contents.
 dists/jaunty/Contents-i386: 1 files 9900B 0s
Done. 9900B in 1 archives. Took 0s
[email protected]:/var/www/packages$ apt-ftparchive -c apt-release.conf release dists/jaunty | sudo tee dists/jaunty/Release
Architectures: i386
Codename: jaunty
Components: main
Date: Mon, 17 Aug 2009 14:16:41 UTC
Label: ElevenBits Ubuntu Repository
Origin: elevenbits.com
Suite: jaunty
MD5Sum:
 1d25efc884e5bbfc32eeba74771e322e              536 main/binary-i386/Packages
 574c2e304fb14272b8f70355e93fbe80              416 main/binary-i386/Packages.bz2
 3a0cbc2e4a38e40c8182451c85de1251              390 main/binary-i386/Packages.gz
SHA1:
 949b9e9045f7698cd64abd4c1fa2261eb5d22f82              536 main/binary-i386/Packages
 6d5d5c841a8890b4491650f4f360d53158d16cc0              416 main/binary-i386/Packages.bz2
 eda59ba70dc9e9d65cf92076e33cb589a07de564              390 main/binary-i386/Packages.gz
SHA256:
 b30b4e68d8928785d132dbdc6bb4158e75e907e07f00a3b8d206030236b8f94a              536 main/binary-i386/Packages
 38b855ab6e0ce3111f986f26347871827e5e461af9b29b8ccf12773560f63caf              416 main/binary-i386/Packages.bz2
 1d1aec4f2cff1a3b71212083aabfc3f2003c88b70f1f0a2ef32bfbb94c2aa879              390 main/binary-i386/Packages.gz

After this, the repository is ready to be used. See http://localhost/packages to make sure.

Note:

Remember to re-initialize the repo each time the /var/www/packages is altered.

Enable the repository on your client machines.

On the Ubuntu machines that need access to your repository, use

::::console
sudo vim /etc/apt/sources.list

to add in the repository address:

::::sources.list
deb http://ww.xx.yy.zz/packages jaunty main

where ww.xx.yy.zz is the address where your server lives.

From now on the system has access to our own private repository. Cool, no?

21 Jul

Eclipse and Django development setup

To develop Django applications, I use Eclipse with the Pydev plugin with some other extras. Here is a small how-to on my setup:

Download and install these different components:

  • ####Django

    I'm using Django 1.0.2 final but I guess that Django's 1.1 beta or the development release would also work fine.

  • ####Eclipse

    Just download the eclipse platform release and install it.

  • ####Pydev

    Then download the Python IDE plugin and install it through the update manager, using these guidelines. Then you can use this page to configure the Python interpreter.

  • ####Subversion

    A project is never complete when it is not version controlled. So install Subversion and the Subversion plugin. When installing the plugin, take care to select the correct features. The SVN Team Provider is required, together with at least one SVN Connector. I selected the SVNKit as my connector.

Then create your own Django projects. This can be done using the Eclipse Run -> Run configurations. Here are the settings to start the lightweight development web server through the manage.py:

alt code

Then specify runserver as program argument:

alt code

Happy coding!

26 Jun

My first own blog!

This is my first blog entry ever :-)