En:HOWTO: Set Up A Community Repository
- 1 Why?
- 2 Basic Requirements
- 3 Setting up your own repository
- 4 Initialising the Repository
- 5 Compiling and Adding Packages
If you want different USE flags on packages or you want that new version you've just found in an overlay or just want to play with something cool then setting up a commnity repo is for you. It allows you to compile portage ebuilds into entropy packages and upload them up to a ftp, ssh or even http or https WebDAV site.
More information can be found on the En:Community Repositories Page.
Here is a list of the requisites you need to satisfy before starting your own repository:
- Portage or any Portage-compatible Source Package Manager (to compile packages)
- sys-apps/entropy-server package. The tutorial was tested using Entropy version 175.
- Remote server to upload packages - can use FTP, SSH or WebDAV. Note that entropy-server does not support client SSL certificates for HTTPS.
- HTTP, HTTPS or anonymous FTP to allow client downloads
- A basic Portage terminology knowledge.
- Optionally: some knowledge about Layman overlay manager.
Setting up your own repository
In order to set up your repository you need to create and modify a configuration file first, then use eit to push and commit the packages.
The first stage is setting up your server.conf file located in /etc/entropy.
Copy it and begin to edit with your editor of choice..
# cp /etc/entropy/server.conf.example /etc/entropy/server.conf
There are only a few parameters truly necessary to set in this file.
This option means that your repository is an overlay over one of the complete repositories, e.g. sabayonlinux.org or sabayon-weekly. Set this to enabled unless you want to upload all packages your newly built ones depend on, even if they're in the main repositories.
Only set this to disabled if you're trying to fork Sabayon, which nobody really wants.
community-mode = enable
The option default-repository contains the name of the default repository you will be adding packages to with En:Eit repository manager. The name can contains ASCII characters, dot (.), hyphen (-) and underscore (_) only.
This is an example for the Nirvana Community Repository
default-repository = nirvana
This is the main configuration string of for your repository. It consists of the following fields:
- Repository Identifier (see above) - This is the repository name in the same form as in the default-repository field.
- Repository Description - A more verbose description of your repository.
- Repository URI(s) - URI to your remote server. The format depends on the type of server.
In case of FTP and HTTP(S) WebDAV, it's simple: ftp://user:[email protected]/some/folders.
In case of SSH, it is slightly different: ssh:[email protected]:some/folders. It is recommended to set up ssh-agent, as otherwise entropy-server will be asking many times about the password.
You can also use file:// URIs for truly local repositories.
If you need the repository URI to be package only (no way to run entropy sync), you can prefix the URI with <p>. If you want the URI to contain only repository information (no package download), you can prefix the URI with <r>.
See the examples below:
repository = astralstorm|AstralStorm's Sabayon General Repository|file:///home/astralstorm/sabayon/ ssh:[email protected]:~/public_html/sabayon/
repository|nirvana|Nirvana Sabayon Linux Community Repository|ftp://danysk:[email protected]/public/nirvana/
You can enter more than one repository, just append more repository = ... lines.
You can put a file similar to /etc/entropy/repositories.conf with your chosen name and .conf suffix. Files starting with _ are considered inactive repositories. These files are only used for downloading, syncing, upgrading and installing packages and not for pushing packages. You will share this file to give other users access to your repository.
Example from Nirvana:
[nirvana] desc = Nirvana Sabayon Linux Community Repository repo = http://www.ols18.com/danysk/nirvana#bz2 enabled = true pkg = http://www.ols18.com/danysk/nirvana
Initialising the Repository
You can start with:
# eit init reponame
Entropy will find that your shiny new repository is empty and asked you to initialize it. Do it!
It will then connect to your FTP, setup the directory and database structure. Initally, the process could take a while, especially the FTP directory listing, we've noticed that if it's empty, Python ftplib takes a while.
Compiling and Adding Packages
The next step (the fun bit) is filling it with some packages.
Before starting, we must be sure that our Entropy installed packages database is in sync with Portage. When you install a package using Entropy, the Portage database gets updated too. The command to merge your Portage-updated packages in Entropy is this:
# equo rescue spmsync
Now to add a package, its Compile time! The first step is to compile something using any Portage-compabile source package manager (Portage itself, Paludis, Pkgcore - anything that writes /var/db/pkg properly). Let's say we want to compile our own media-sound/amarok perhaps with "postgres" support or with different CFLAGS. Then, we spawn Portage:
# emerge -av media-sound/amarok
Note, if you get Equo called by Portage, you need to select "no". This because of a Portage behavioral change in the latest release (apparently it pulls into its xpak metadata equo's bashrc).
Adding the Package to Your Repository
Once you have compiled and installed the application using portage its time to tell Entropy to push this package into our repository. You can do it calling:
# eit add "package-name"
To specify one or more packages.
# eit commit
To add every packages compiled locally in your remote repository.
The package will be created and stored locally. Once done, it is time to push it remotely!
# eit push --quick
We have now pushed media-sound/amarok into our repository database!