| 1 | # Contributor: Natanael Copa <[email protected]> |
| 2 | # Maintainer: Natanael Copa <[email protected]> |
| 3 | pkgname=alpine-base |
| 4 | pkgver=3.21.0_rc7 |
| 5 | pkgrel=0 |
| 6 | pkgdesc="Meta package for minimal alpine base" |
| 7 | url="https://alpinelinux.org" |
| 8 | arch="noarch" |
| 9 | license="MIT" |
| 10 | depends=" |
| 11 | alpine-baselayout |
| 12 | alpine-conf |
| 13 | alpine-release |
| 14 | apk-tools |
| 15 | busybox |
| 16 | busybox-mdev-openrc |
| 17 | busybox-openrc |
| 18 | busybox-suid |
| 19 | musl-utils |
| 20 | openrc |
| 21 | " |
| 22 | subpackages="alpine-release:release" |
| 23 | replaces="alpine-baselayout" |
| 24 | options="!check" |
| 25 | |
| 26 | package() { |
| 27 | mkdir -p "$pkgdir" |
| 28 | } |
| 29 | |
| 30 | release() { |
| 31 | depends="alpine-keys" |
| 32 | pkgdesc="Alpine release data" |
| 33 | |
| 34 | mkdir -p "$subpkgdir"/etc |
| 35 | # create /etc/alpine-release |
| 36 | echo $pkgver > "$subpkgdir"/etc/alpine-release |
| 37 | local _ver="$(echo "$pkgver" | grep -E -o '^[0-9]+\.[0-9]+')" |
| 38 | local _rel="v$_ver" |
| 39 | case "$pkgver" in |
| 40 | *_alpha*|*_beta*|*_pre*) |
| 41 | _ver="$pkgver (edge)" |
| 42 | _rel="edge" |
| 43 | ;; |
| 44 | esac |
| 45 | |
| 46 | # create /etc/issue |
| 47 | cat >"$subpkgdir"/etc/issue<<EOF |
| 48 | Welcome to Alpine Linux $_ver |
| 49 | Kernel \\r on an \\m (\\l) |
| 50 | |
| 51 | EOF |
| 52 | |
| 53 | # create os-release |
| 54 | mkdir -p "$subpkgdir"/usr/lib |
| 55 | cat >"$subpkgdir"/usr/lib/os-release<<EOF |
| 56 | NAME="Alpine Linux" |
| 57 | ID=alpine |
| 58 | VERSION_ID=$pkgver |
| 59 | PRETTY_NAME="Alpine Linux $_rel" |
| 60 | HOME_URL="https://alpinelinux.org/" |
| 61 | BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues" |
| 62 | EOF |
| 63 | ln -s ../usr/lib/os-release "$subpkgdir"/etc/os-release |
| 64 | |
| 65 | # create secfixes.d repository list |
| 66 | mkdir -p "$subpkgdir"/etc/secfixes.d |
| 67 | cat >"$subpkgdir"/etc/secfixes.d/alpine<<EOF |
| 68 | https://secdb.alpinelinux.org/$_rel/main.json |
| 69 | https://secdb.alpinelinux.org/$_rel/community.json |
| 70 | EOF |
| 71 | } |