User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
gentoo:repositories [2024/02/05 10:56] willygentoo:repositories [2024/02/06 06:59] (current) willy
Line 1: Line 1:
-Reference [[https://wiki.gentoo.org/wiki/Creating_an_ebuild_repository]] and [[https://wiki.gentoo.org/wiki/Handbook:AMD64/Portage/CustomTree#Defining_a_custom_ebuild_repository]]+====== Custom Repositories ======
  
-<code bash+Portage (Gentoo's package manager) is based on package repositories. It might happen that you need some software which has not been packaged on official Gentoo repository yet or maybe you want to thinker with a newer release that did not hit the official repo yet.  
 + 
 +Another great point of Gentoo is that it's really simple to create your own package repository and use it alongside the official one. 
 + 
 +The following links are exhaustive information that you should read carefully and are the source of this page info: 
 +  * [[https://wiki.gentoo.org/wiki/Creating_an_ebuild_repository|Creating an ebuild repository]] 
 +  * [[https://wiki.gentoo.org/wiki/Handbook:AMD64/Portage/CustomTree#Defining_a_custom_ebuild_repository|The Gentoo Handbook]] 
 + 
 +You can create it manually, but i think it's better to leverage the **eselect-repository** tools. Emerge the following packages if you odn't have them yet: 
 +<code bash>
  > emerge app-eselect/eselect-repository pkgdev  > emerge app-eselect/eselect-repository pkgdev
 +</code>
 +
 +Then use the //eselect repository// to create your new repo, let's call it **myrepo**:
 +<code bash>
  > eselect repository create myrepo  > eselect repository create myrepo
 +</code>
 +
 +The repo will be created under **/var/db/repos/local** and i storngly suggest you treat it like a GIT repository:
 +<code bash>
  > cd /var/db/repos/local/  > cd /var/db/repos/local/
  > git init  > git init
Line 10: Line 27:
 </code> </code>
  
-Add a new eubild (es: app-containers/podman-compose)+I have encountered a bug in the repo creation that will not populare correctly the **/etc/portage/repos.conf/eselect-repo.conf** file, check that you have the official repo in the list. You need to have the following section in that file: 
 +<code> 
 +[gentoo] 
 +location = /var/db/repos/gentoo 
 +</code> 
 + 
 +Add it, if missing. 
 + 
 +Here you can also move your **myrepo** somewhere else if you prefer different location than default. 
 + 
 +Now, Gentoo package manager is based on **ebuild** files which are recipes to download and build your packages. You need to create (or download) an ebuild to add to your repository. [[https://wiki.gentoo.org/wiki/Basic_guide_to_write_Gentoo_Ebuilds|This guide]] will teach you how to write ebuilds yourself. 
 + 
 +I will assume you have your ebuild called //myapp// under the //app-misc// category, this ebuild will have version 1.0.0, so it's filename will be: **myapp-1.0.0.ebuild** and you will need to copy it to **/var/db/repos/myrepo/app-misc/myapp/myapp.ebuild**. 
 + 
 +At this point, you need to create the manifest for the ebuild, which includes downloading the associated sources/binaries/patches and calculate checksums:
 <code bash> <code bash>
- > mkdir -p /var/db/repos/myrepo/app-containers/podman-compose + > cd /var/db/repos/myrepo/app-misc/myapp 
- > vi /var/db/repos/myrepo/app-containers/podman-compose/podman-compose-1.0.6.ebuild +
- > cd /var/db/repos/myrepo/app-containers/podman-compose+
  > pkgdev manifest  > pkgdev manifest
  > chown -R portage:portage /var/db/repos/myrepo  > chown -R portage:portage /var/db/repos/myrepo
 </code> </code>
 +And don't forget to properly apply permissions to the entire repo: it needs to be owned by user and group //portage//.
  
- +That's it, you can now simply: 
-add  +<code bash
-<file - /etc/portage/repos.conf/eselect-repo.conf+ > emerge myapp 
- +</code>
-[gentoo] +
-location = /var/db/repos/gentoo +
-</file>+
  

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information