Custom ebuild repository
Creating a local repository
See Defining a custom ebuild repository in the Handbook. (Obviously, before a custom repository could pick up ebuilds it needs to exist.)
Optional: Use version history
In order to keep track of all changes done in the custom repository it appears useful to have dev-vcs/git installed. To log all edits from the beginning following steps were needed:
user $
cd /var/db/repos/localrepo/
root #
git init
Initialized empty Git repository in /var/db/repos/localrepo/.git/
root #
git add .
root #
git commit
This also provides the possibility for testing with different version branches.
Adding an ebuild to the repository
Now that the basic layout is in order, an ebuild could be added to the repository. In this example, app-dicts/artha-1.0.2 (available at ). Assumed the ebuild is in the homedir of the user larry, and named artha-1.0.2.ebuild.
root #
mkdir -p /var/db/repos/localrepo/app-dicts/artha
root #
cp ~larry/artha-1.0.2.ebuild /var/db/repos/localrepo/app-dicts/artha/artha-1.0.2.ebuild
root #
chown -R portage:portage /var/db/repos/localrepo
root #
pushd /var/db/repos/localrepo/app-dicts/artha
root #
repoman manifest
root #
popd
It should now be possible to install the package from the ebuild repository with the emerge command:
root #
emerge --ask --verbose app-dicts/artha
Simple version bump of an ebuild in the local repository
In theory one can update an ebuild to the next version number with a "simple version bump". Indicators that this is promising are:
- Upstream fixed only minor bugs
- Dependencies did not change
- Upstream uses semantic version numbers and changed only the minor number [1]
- The ebuild file is short and does not use many patches
For the simplest bump place a copy of the ebuild in the local repository and update the version number in the filename.
We assume you have prepared your local repository in localrepo already and want to bump to a newer version of app-emulation/docker.
user $
mkdir -v /var/db/repos/localrepo/app-emulation
user $
cd /var/db/repos/localrepo/app-emulation
user $
cp -r /var/db/repos/gentoo/app-emulation/docker .
user $
cd docker/
user $
cp docker-1.11.0.ebuild docker-1.12.6.ebuild
user $
repoman --digest=y -d full
Now test the installation:
root #
emerge --ask =app-emulation/docker-1.12.6
Finished ebuilds should be added to the version control system. If using git, consider adding a pull request to GitHub.
Avoid a direct version bump
The direct version bump in the official ebuild repository is often suggested, but should be avoided, because:
- All changes get lost on the next sync of the repository (unless sync-type git is in use, in that case a topic branch could be used)
- User contributions should be separated from the official ebuild repository
Do not do this:
root #
# cd /usr/portage/app-emulation/docker
root #
# cp docker-1.11.0 docker-1.12.6
root #
# repoman --digest=y -d full
Crossdev
sys-devel/crossdev will place the ebuilds/categories it generates into one of four places in this order.
- An overlay specified on the command-line with the
--ov-output (-oO)
option - An overlay named 'cross-${CTARGET}'
- An overlay named 'crossdev'
- Finally, it falls back on the overlay having the lowest priority value in /etc/portage/repos.conf/.
If the overlays have the same priority, it will use the overlay determined to be the first, alphabetically.
Most users will want to prevent crossdev from disturbing layman's overlays or the user's personal per-machine overlay (commonly created at /var/db/repos/localrepo/). The best solution is to create an overlay specifically for crossdev's use:
root #
mkdir -p /var/db/repos/localrepo-crossdev/{profiles,metadata}
root #
echo 'crossdev' > /var/db/repos/localrepo-crossdev/profiles/repo_name
root #
echo 'masters = gentoo' > /var/db/repos/localrepo-crossdev/metadata/layout.conf
root #
chown -R portage:portage /var/db/repos/localrepo-crossdev
If the main Portage tree is synchronized by using Git, or any other method with Manifest files that do not include checksums for ebuilds, prevent "masked by: corruption" errors with:
/var/db/repos/localrepo-crossdev/metadata/layout.conf
<syntaxhighlight lang="ini">masters = gentoo thin-manifests = true</syntaxhighlight>
Then instruct Portage and crossdev to use this overlay:
/etc/portage/repos.conf/crossdev.conf
<syntaxhighlight lang="ini">[crossdev] location = /var/db/repos/localrepo-crossdev priority = 10 masters = gentoo auto-sync = no</syntaxhighlight>
Historical
Older versions of sys-apps/portage included repoman. Starting from portage-2.3.0, repoman has been 'unbundled' into separate package. Be sure it is installed before following this guide:
root #
emerge --ask app-portage/repoman
Alternatively, the ebuild command can still be used to generate manifest/digest files, however it does not include any of the other quality check benefits (such as debug output) included with repoman:
root #
ebuild foo.ebuild digest
>>> Creating Manifest for /usr/local/portage/bar/foo
See also
- See Defining a custom repository (amd64 handbook)
- Repository format — A quick reference to Gentoo ebuild repository (overlay) format.
- GitHub Pull Requests
References
- ↑ one example of semantic version number is described on http://semver.org/