[OracleOSS] [TitleIndex] [WordIndex]

Sourcebo/ContentFiles

Sourcebo Downloads

Most projects want to offer files for download. These files may be archives of the source tree. They may be binary packages for various systems. They could be data packages for the software. Whatever they are, a CMS should offer a way to make files downloadable.

Sourcebo does this via the files/ subdirectory of the content repository and description files.

Adding Files to a Project

Adding files to a project is a simple exercise in version control. Making them visible on the project download page is the hard part. More on that later.

To add the files to the project, merely copy them to the files/ subdirectory of the content repository and check them into Subversion. They are now a part of the content repository.

$ cp myproject.tar.gz $HOME/projects/myproject-content/files/
$ cd $HOME/projects/myproject-content/files/
$ svn add myproject.tar.gz
$ svn commit -m 'Added latest source archive' myproject.tar.gz

Subdirectories are allowed. You can easily have a files/ tree like so:

files/
    sources/
        myproject.tar.gz
    packages/
        RedHat/
            myproject-0.1.rpm
        SuSE/
            ...

Making Downloads Visible

While the files are checked into the content repository, they are not visible in the "Downloads" section of the project page. To become visible, they must be described to Sourcebo via description files.

To make a file visible, create a description file by taking the file name and adding a .desc extension. So, the file myproject.tar.gz has a description file of myproject.tar.gz.desc. When Sourcebo looks at the files/ directory, it checks every <filename> for a corresponding <filename>.desc. Each valid file and description creates an entry on the "Downloads" page.

The description file for a download has only one stanza:

description:
    title = File Title
    description = Source archive

The descriptiion attribute is mandatory. The title attribute is optional. If there is no title specified, the filename is used as a title. So, for your source archive files/sources/myproject.tar.gz, you may use a description file of files/sources/myprject.tar.gz.desc:

description:
    descriptiion = Latest source archive

Add the description file to the repository and commit it:

$ cd files/sources
$ svn add myproject/sources/myproject.tar.gz
$ svn commit -m "Added the 0.1 sources" myproject.tar.gz

Subdirectories Too

If you want a subdirectory of files/ to appear on the "Downloads" page, make a description file for the subdirectory. For example, files/sources may have have a description files/sources.desc:

description:
    title = Source Files
    description = All source archives for MyProject

The "Downloads" Page

For every visible file, the "Downloads" page displays the title, description, md5sum, and modification date. The title is clickable to download the actual file. The md5sum is calculated by Sourcebo, and can be used by the downloader to verify file contents.


2012-11-08 13:01