Difference between revisions of "Creating Profiles"

From Funtoo
Jump to navigation Jump to search
(Eselect has been removed from funtoo. "An Example" not working with epro.)
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{note |'''Eselect has been removed from Funtoo. "The example in the Creating Profiles guide to add a mix-in for an overlay no longer works."'''}}
Want to create your own custom profiles? Thought up a mix-in that's not currently in the Funtoo profiles? Have an overlay with profiles and want to make it easy for people to use them? Well you've come to the right place. This article will show you how to easily add you own profiles. No more ugly hacking of parent files and other nonsense. Once you follow this guide, not only will portage easily recognize your profiles, they will also show up in eselect right along with the ones from the main tree.
Want to create your own custom profiles? Thought up a mix-in that's not currently in the Funtoo profiles? Have an overlay with profiles and want to make it easy for people to use them? Well you've come to the right place. This article will show you how to easily add you own profiles. No more ugly hacking of parent files and other nonsense. Once you follow this guide, not only will portage easily recognize your profiles, they will also show up in eselect right along with the ones from the main tree.


== How to do it ==
== Rules to follow ==
=== Rules to follow ===
* What your system need:
* What your system need:
** The version of [[Package:Eselect|eselect]] that supports Funtoo profiles (already integrated into Funtoo Linux)
** The version of [[Package:Eselect|eselect]] that supports Funtoo profiles (already integrated into Funtoo Linux)
Line 11: Line 12:
** If you're creating profiles of types arch, build, flavor, or mix-ins, your profile must be inside a directory with same name, such as <code><overlay_name>/profiles/<profile_name>/flavor/<flavor_name></code>, <code><overlay_name>/profiles/<profile_name>/mix-ins/<mix-ins_name></code>
** If you're creating profiles of types arch, build, flavor, or mix-ins, your profile must be inside a directory with same name, such as <code><overlay_name>/profiles/<profile_name>/flavor/<flavor_name></code>, <code><overlay_name>/profiles/<profile_name>/mix-ins/<mix-ins_name></code>


{{note | Currently, <tt>NoMix</tt> (see <code>profiles.eselect.example</code> in the Funtoo portage tree) is only supported for profiles in the same tree.}}
{{note |Currently, <tt>NoMix</tt> (see <code>profiles.eselect.example</code> in the Funtoo portage tree) is only supported for profiles in the same tree.}}


Also:
Also:
Line 17: Line 18:
{{note | If you are not using a standard Funtoo portage tree, you must ensure that your main portage tree has <pre> profile-formats = portage-2 </pre> set in <code>metadata/layout.conf</code> in order for portage to interpret the <code><repo_name>:<profile></code> syntax.}}
{{note | If you are not using a standard Funtoo portage tree, you must ensure that your main portage tree has <pre> profile-formats = portage-2 </pre> set in <code>metadata/layout.conf</code> in order for portage to interpret the <code><repo_name>:<profile></code> syntax.}}


=== Example of how to set up ===
==An Example==
For our example we will create a mix-ins profile called 'fake_pro' in a local overlay called 'local_overlay'. fake_pro will set the 'dummy' USE flag globally and also set the 'fake' USE flag on sys-apps/not-exist. We will then add the profile to eselect so it's visible when running 'eselect profile'.
* For our example, we will create a local overlay called <b>fake_overlay</b>. Then, create a profile called <b>fake_profile</b>. Finally, create a 'mix-ins' profile called <b>fake_mix-ins</b>:
** Set the <code>dummy</code> USE flag globally for <b>fake_mix-ins</b>
** Set the <code>yummy</code> USE flag on <code>sys-apps/not-exist</code> for <b>fake_mix-ins</b>


==== Creating the profile ====
We will then add this profile to [[Package:Eselect|eselect]] so it's visible when running:
We will use ''<code>${OVERLAY_DIR}</code>'' as the path to local_overlay. These instructions assume the overlay exists.
<console>
###i## eselect profile
</console>
 
=== Creating the profile ===
==== Step 1 ====
We will use <code>${FAKE_OVERLAY}</code>as the path to <b>fake_overlay</b>.These instructions assume the overlay exists.
If you haven't set a name for your overlay, do that first:
If you haven't set a name for your overlay, do that first:
<console>
<console>
###i## echo "local_overlay" > ${OVERLAY_DIR}/profiles/repo_name
###i## echo "fake_overlay" > ${FAKE_OVERLAY}/profiles/repo_name
</console>
</console>


Next lets create a directory to store our profile. Since we're creating a 'mix-ins' profile we need to make sure our profile is inside a 'mix-ins' subdirectory. This is a requirement in order to ensure that the profile will show up in eselect. If your not planning on using eselect then there's no requirement to use 'mix-ins'
==== Step 2 ====
Next lets create a directory to store our profile. Since we're creating a 'mix-ins' profile, we need to make sure our profile is inside a 'mix-ins' subdirectory. This is a requirement in order to ensure that the profile will show up in eselect. If your not planning on using [[Package:Eselect|eselect]] then there's no requirement to use 'mix-ins'
<console>
<console>
###i## install -d ${OVERLAY_DIR}/profiles/my_profiles/mix-ins/fake_pro
###i## install -d ${FAKE_OVERLAY}/profiles/fake_profile/mix-ins/fake_pro
</console>
</console>


Now that we have a directory for our profile, lets go ahead and add our settings. Global USE settings go in ''<code>make.defaults</code>'', package specific USE settings go in ''<code>package.use</code>'':
Now that we have a directory for our profile, lets go ahead and add our settings. Global USE settings go in <code>make.defaults</code>, package specific USE settings go in <code>package.use</code>:
 
<console>
<console>
###i## cd ${OVERLAY_DIR}/profiles/my_profiles/mix-ins/fake_pro
###i## cd ${FAKE_OVERLAY}/profiles/fake_profile/mix-ins/fake_pro
###i## echo 'USE="$USE dummy"' >> make.defaults
###i## echo 'USE="$USE dummy"' >> make.defaults
###i## echo 'sys-apps/not-exist fake' >> package.use
###i## echo 'sys-apps/not-exist yummy' >> package.use
</console>
</console>
Note that no matter if your using funtoo or gentoo, profile settings all work the same. For more information please check the portage man page.


==== Adding to eselect ====
{{note | No matter if your using funtoo or gentoo, profile settings all work the same. For more information please check the portage man page.}}
eselect reads from the file ''<code>profiles.eselect.desc</code>'' in your profiles/ directory. Format is "Type Name Status NoMix" space-separated. For more information look in ''<code>/usr/portage/profiles/profiles.eselect.example</code>'':
 
=== Adding to eselect ===
[[Package:Eselect|eselect]] reads from the file <code>profiles.eselect.desc</code> in your profiles directory.  
 
Format is:
<pre>
Type Name Status NoMix
</pre>
 
{{note | For more information about this Format, Please look in <code>/usr/portage/profiles/profiles.eselect.example</code>}}
 
<console>
<console>
###i## echo 'mix-ins my_profiles/mix-ins/fake_pro testing' >> ${OVERLAY_DIR}/profiles/profiles.eselect.desc
###i## echo 'mix-ins fake_profile/mix-ins/fake_pro testing' >> ${FAKE_OVERLAY}/profiles/profiles.eselect.desc
</console>
</console>
Watch the result:
Watch the result:
<console>
<console>
Line 53: Line 74:
[[Category:Labs]]
[[Category:Labs]]
[[Category:HOWTO]]
[[Category:HOWTO]]
[[Category:Featured]]

Revision as of 22:23, November 26, 2015

   Note

Eselect has been removed from Funtoo. "The example in the Creating Profiles guide to add a mix-in for an overlay no longer works."

Want to create your own custom profiles? Thought up a mix-in that's not currently in the Funtoo profiles? Have an overlay with profiles and want to make it easy for people to use them? Well you've come to the right place. This article will show you how to easily add you own profiles. No more ugly hacking of parent files and other nonsense. Once you follow this guide, not only will portage easily recognize your profiles, they will also show up in eselect right along with the ones from the main tree.

Rules to follow

  • What your system need:
    • The version of eselect that supports Funtoo profiles (already integrated into Funtoo Linux)
  • What your overlay need:
    • Directory <overlay_name>/profiles: store your profiles in it.
    • File <overlay_name>/profiles/repo_name: store the name of your overlay
    • File <overlay_name>/profiles/profiles.eselect.desc: see profiles.eselect.example in your Funtoo portage tree for instruction.
    • If you're creating profiles of types arch, build, flavor, or mix-ins, your profile must be inside a directory with same name, such as <overlay_name>/profiles/<profile_name>/flavor/<flavor_name>, <overlay_name>/profiles/<profile_name>/mix-ins/<mix-ins_name>
   Note

Currently, NoMix (see profiles.eselect.example in the Funtoo portage tree) is only supported for profiles in the same tree.

Also:

   Note
If you are not using a standard Funtoo portage tree, you must ensure that your main portage tree has
 profile-formats = portage-2 
set in metadata/layout.conf in order for portage to interpret the <repo_name>:<profile> syntax.

An Example

  • For our example, we will create a local overlay called fake_overlay. Then, create a profile called fake_profile. Finally, create a 'mix-ins' profile called fake_mix-ins:
    • Set the dummy USE flag globally for fake_mix-ins
    • Set the yummy USE flag on sys-apps/not-exist for fake_mix-ins

We will then add this profile to eselect so it's visible when running:

root # eselect profile

Creating the profile

Step 1

We will use ${FAKE_OVERLAY}as the path to fake_overlay.These instructions assume the overlay exists. If you haven't set a name for your overlay, do that first:

root # echo "fake_overlay" > ${FAKE_OVERLAY}/profiles/repo_name

Step 2

Next lets create a directory to store our profile. Since we're creating a 'mix-ins' profile, we need to make sure our profile is inside a 'mix-ins' subdirectory. This is a requirement in order to ensure that the profile will show up in eselect. If your not planning on using eselect then there's no requirement to use 'mix-ins'

root # install -d ${FAKE_OVERLAY}/profiles/fake_profile/mix-ins/fake_pro

Now that we have a directory for our profile, lets go ahead and add our settings. Global USE settings go in make.defaults, package specific USE settings go in package.use:

root # cd ${FAKE_OVERLAY}/profiles/fake_profile/mix-ins/fake_pro
root # echo 'USE="$USE dummy"' >> make.defaults
root # echo 'sys-apps/not-exist yummy' >> package.use
   Note
No matter if your using funtoo or gentoo, profile settings all work the same. For more information please check the portage man page.

Adding to eselect

eselect reads from the file profiles.eselect.desc in your profiles directory.

Format is:

Type Name Status NoMix
   Note
For more information about this Format, Please look in /usr/portage/profiles/profiles.eselect.example
root # echo 'mix-ins fake_profile/mix-ins/fake_pro testing' >> ${FAKE_OVERLAY}/profiles/profiles.eselect.desc

Watch the result:

root # eselect profile list