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