-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

===============================================
Proposal for addition of distribution variables
===============================================

:Author:
  A. Wilcox (Adélie Linux)
:Date:
  2016-12-04
:Status:
  Request for Comment




Introduction
- ------------

This proposal outlines the addition of environment variables to a
future EAPI for the purposes of identifying the builder of packages,
and a route for their more immediate addition to the Gentoo package
tree before the next EAPI is published.


Background
- ----------

The Gentoo package repository is used not only by thousands of users,
but also used by other distributions and organisations, such as
Funtoo, CoreOS, and Google ChromeOS.  From the Gentoo Foundation's own
charter, it self-describes in the following way: "Gentoo is a
metadistribution".  That allows users to make their own flavours of
Gentoo themselves.  Several forks already exist, including Exherbo,
Funtoo, Sabayon, Galapagos, Vida, and Calculate.  Google also
maintains a fork, ChromeOS, for their Chromebook laptops.  CoreOS also
uses Gentoo's repository for their distribution.  In addition, there
are also binary distributions such as Pentoo and Adélie that provide
additional value but are not, in so many words, a 'fork' of Gentoo.


Current Situation
- -----------------

Currently, forks and derivatives of Gentoo are required to choose one
of only two options.  They can either use the tree as is, which causes
packages to identify as being built for Gentoo and causes most
autoconf -based packages (and some CMake packages in KDE) to have
their bug report URLs to point to bugs.g.o.  Alternatively, they can
fork the Git repository, requiring the need of manual merges when
conflicts arise, and additional wasted effort when upstreams release
new versions of software.


Deficiencies
- ------------

If a fork or derivative of Gentoo does not have the manpower or
resources to modify all ebuilds that mention the Gentoo name / bug URL
(about 1500 at my last count), then both distributions suffer.  Users
of the fork will file bugs with Gentoo that are not bugs in Gentoo.
Developers of the fork will not know about said bugs, and be unable to
fix them.  Gentoo bug-wranglers and devs will have to waste time and
resources testing bugs, finding out they are not even Gentoo bugs, and
closing them as WONTFIX or WORKSFORME.

If they choose the alternative of forking the repository and changing
these parameters in ebuilds, then it makes upstreaming their
improvements much more difficult.  Sabayon has a repository on GitHub
specifically for this, and Adélie wastes continual effort applying
patches against the tree as it evolves.


Solution Objectives
- -------------------

* Protect Gentoo's name, trademark, and reputation by avoiding any
  appearance that derivative distributions are associated with Gentoo.

* Lessen number of inappropriate bugs filed on bugs.g.o due to forks and
  derivatives.

* Foster better collaboration and sharing of improvements between
  Gentoo and its forks/derivatives.

* Future potential changes to the bug report URL, while exceedingly
  unlikely, is additionally made easier.


Solution Vision
- ---------------

I hereby propose adding the following two variables to the src_*
phases.  None of these variables will have a default specified in PMS
if they are added.

:``${DISTRO}``:
  The name of the distribution.  This would be set in
  ``profiles/base/make.defaults`` on Gentoo to "Gentoo".

:``${DISTRO_BUG_URL}``:
  The URL to use to report bugs with software on the distribution.
  This would be set to "https://bugs.gentoo.org/"; on Gentoo.

By replacing references to 'Gentoo' passed to ./configure, make, etc
with ``${DISTRO}``, distributions like Sabayon, Calculate, and Adélie
will be able to notate their name as the distributor on packages.
This will affect packages such as LibreOffice, OpenRC, X.Org, and KDE,
which are all compiled with the name of the distribution internally.
They use this for bug information, and having the proper distribution
name will allow for more proper bug handling and ensure less
inappropriate blame is assigned to Gentoo.  This also ensures that the
fork or derivative's own mailing lists, forums, and so on are searched
and contacted before Gentoo's.

By replacing references to 'bugs.gentoo.org' passed to ./configure with
``${DISTRO_BUG_URL}``, the Gentoo project will have a significant
reduction in wasted effort handling inappropriately filed bugs when
the issues are caused by changes by the forks and derivatives.


Roadmap
- -------

Since the shell environment is flexible, this change can be
implemented almost immediately; the defaults specified in the Gentoo
base profile ensure that at worst nothing will immediately change.  As
forks, derivatives, and other organisations change the environment
variables in their profiles or ``make.conf`` files, all updated
ebuilds will immediately reflect the changes.

During this, the variables can be added to the EAPI=7 specification,
and may eventually be added to PMS §11.1.


Suggested Wording
- -----------------

Attached is a patch for pms.git with suggested wording for the two
variables mentioned above.

- -- 
A. Wilcox (awilfox)
Project Lead, Adélie Linux
http://adelielinux.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJYRKdKAAoJEMspy1GSK50UC9UQAJDv1SV2vCc6V+5ndcvnMwoc
DPkiXxhqSPtaoCSGbggIO9xHgFmnuYXYU7xT4w8sUApS/pp3EBY5GzES+3fztlT6
xvZG+peoxOf0aIa2KiAvNdYXDQLixxWS/irnJiKvXr0A2gYbic0Z5ztqDRtsu6aR
tTaF5sp3uOUxcMs5otBC8bdvRPdwPatgr3zGG7TZ1TLCx2aQb5MFESH0wJXCig4i
fp23MIKbcBqnVyxiOqffOiexxAeIVZX5kV+zkWRPOJyq7nbg5X2tg2KSqScC/j9N
u0iVvfn/0ySv9Cnp9uWyHBvWyjymgnQPyM1wfPnCS6n834lx2Ydt2MAonIA6yJx2
cOF6/cXlBBNJ4WloAp51G1V7Rwvj5RhHB20gplDYPOIkbWi3WH10XvMhHJieSXZv
KHiJAX25M/URvDtnllSYCir+a6+lsZAWzQzzTrACx647Gt5RWEo+Kik+7oXcSooM
hTyEjBsVVj73CX2UXlYx7sT0p///nng+phLT1ZX3XIwJfM4bhBffpRtDULi/JNpV
gWXm/kW8bndvgsay9nduwc1yd1fEdshVdcUlhLOYuHwo6oDCV6Z5xXldvTf1X2KW
8rEWU17oCJOJokURkAWmZR29VUSc6mbPtldk8w+N+V1bMQaSI5SWcHwtGsckXTaJ
AcNQFF1dBC1GGOYpD8IK
=ctPw
-----END PGP SIGNATURE-----
From 5ca160c98c228875772bea2c046a26d7b2b1d085 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <awil...@wilcox-tech.com>
Date: Thu, 1 Dec 2016 17:48:50 -0600
Subject: [PATCH] Add environment variables for distro specifics

This ensures that distributions can share ebuilds between each other
freely without worrying about customising bug-url, distributor,
maintainer, and various other configuration knobs.
---
 ebuild-env-vars.tex | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ebuild-env-vars.tex b/ebuild-env-vars.tex
index 469f0cd..8a35f77 100644
--- a/ebuild-env-vars.tex
+++ b/ebuild-env-vars.tex
@@ -208,6 +208,15 @@ variable.
     \featurelabel{kv} The version of the running kernel at the time the ebuild was first executed,
     as returned by the \t{uname~-r} command or equivalent.  May be modified by ebuilds.  Only for
     EAPIs listed in table~\ref{tab:removed-env-vars-table} as supporting \t{KV}. \\
+\t{DISTRO} &
+    \t{src\_*} &
+    Yes &
+    The name of the operating system distribution that the package is being built for. \\
+\t{DISTRO_BUG_URL} &
+    \t{src\_*} &
+    Yes &
+    The URL for the bug tracker used by the operating system distribution that the package is being
+    built for.  This may be used to configure bug reporting URLs for packages that support it. \\
 \t{MERGE\_TYPE} &
     \t{pkg\_*} &
     No &
-- 
2.10.0

Attachment: environment-variables-for-distro-specifics.patch.sig
Description: PGP signature

Reply via email to