Mail archive
alpine-devel

Re: [alpine-devel] RFC: Distribution variables for abuild

From: Natanael Copa <ncopa_at_alpinelinux.org>
Date: Fri, 30 Jun 2017 07:52:33 +0200

On Sun, 25 Jun 2017 01:36:37 -0500
"A. Wilcox" <awilfox_at_adelielinux.org> wrote:

...

> I hereby propose adding the following four variables to abuild.conf,
> with the default values in abuild being appropriate for Alpine.
>
> :``${DISTRO_NAME}``:
> The name of the distribution, such as "Alpine Linux" or
> "Adélie Linux".
>
> :``${DISTRO_SHORT_NAME}``:
> A single word describing the distribution, such as "Alpine" or
> "Adelie".
>
> :``${DISTRO_URL}``:
> The home page of the distribution, i.e. "https://alpinelinux.org".
>
> :``${DISTRO_BUG_URL}``:
> The URL to use to report bugs with software on the distribution.
> This would be set to "https://bugs.alpinelinux.org" by default.

I think this is a good idea. It is trivial to implement and does not
cause any maintenance burden.

...

> Roadmap
> - -------
>
> Since the shell environment is flexible, this change can be
> implemented almost immediately; the defaults specified ensure that at
> worst, nothing will change. As forks and spins change the environment
> variables in their ``abuild.conf`` files, all updated packages will
> immediately reflect those changes.

How much code is needed in abuild? I think we could start with the APKBUILDs:

        ${DISTRO_URL:-https://alpinelinux.org}

That way you can override the default and we are still backwards
compatible. No code changes in abuild required to get started.

This makes it also possible backport security and bug fixes to stable
branches if needed.

> If there is interest, I would be happy to work on the abuild code and
> adding the variables in relevant APKBUILDs. There are a few packages
> that don't specify bug report URLs where they could; I could
> additionally add support there, if desired.

Yes. This would be great!

> One alternative is sourcing this information from ``/etc/os-release``
> instead of ``abuild.conf``, or using os-release when abuild.conf does
> not have anything set.

Nah, I like your proposal better.
  
> Thank you for your time in reviewing this proposal. If you have any
> questions or concerns or changes, I would love to discuss them. I'm
> open to any comments the community has.

Are you ok with using the style ${DISTRO_NAME:-Alpine Linux} in the
APKBUILDs?

Something like:
diff --git a/main/alpine-base/APKBUILD b/main/alpine-base/APKBUILD
index e5cfeba83f..58980b5273 100644
--- a/main/alpine-base/APKBUILD
+++ b/main/alpine-base/APKBUILD
_at_@ -26,7 +26,7 @@ package() {
 
        # create /etc/issue
        cat >"$pkgdir"/etc/issue<<EOF
-Welcome to Alpine Linux ${pkgver%.*}
+Welcome to ${DISTRO_NAME:-Alpine Linux} ${pkgver%.*}
 Kernel \\r on an \\m (\\l)
 
 EOF
_at_@ -34,11 +34,11 @@ EOF
        _ver="$(echo "$pkgver" | grep -E -o '^[0-9]+\.[0-9]+')"
        # create os-release
        cat >"$pkgdir"/etc/os-release<<EOF
-NAME="Alpine Linux"
-ID=alpine
+NAME="${DISTRO_NAME:-Alpine Linux}"
+ID=${DISTRO_SHORT_NAME:-alpine}
 VERSION_ID=$pkgver
-PRETTY_NAME="Alpine Linux v$_ver"
-HOME_URL="http://alpinelinux.org"
-BUG_REPORT_URL="http://bugs.alpinelinux.org"
+PRETTY_NAME="${DISTRO_NAME:-Alpine Linux} v$_ver"
+HOME_URL="${DISTRO_URL:-https://alpinelinux.org}"
+BUG_REPORT_URL="${DISTRO_BUG_URL:-https://bugs.alpinelinux.org}"
 EOF
 }


Thanks for working on this.

-nc


---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Fri Jun 30 2017 - 07:52:33 GMT