ports/main/lfsbase/APKBUILD

89 lines
1.7 KiB
Plaintext
Raw Normal View History

2022-03-21 12:25:55 +00:00
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Alex Denes <caskd@redxen.eu>
pkgname=lfsbase
pkgver=1.2
pkgrel=2
2022-03-21 12:25:55 +00:00
pkgdesc="Base directory structure for linux"
url="none"
arch="noarch"
license="GPL-2.0-only"
options="!check"
provides="alpine-baselayout"
2022-03-21 12:25:55 +00:00
install="
$pkgname.pre-install
$pkgname.post-install
$pkgname.pre-upgrade
$pkgname.post-upgrade
"
source="
group
passwd
profile
"
builddir="$srcdir/build"
prepare() {
default_prepare
mkdir -p "$builddir"
}
_passwd2shadow() {
local name="$(echo "$1" | cut -d: -f1)"
printf '%s:!:::::::\n' "$name"
}
build() {
while read -r LINE; do
_passwd2shadow "$LINE"
done < "$srcdir"/passwd > shadow
}
package() {
mkdir -p "$pkgdir"
cd "$pkgdir"
install -m 0755 -d \
etc \
var \
mnt \
proc \
run \
sys
install -d -m 0700 root
install -d -m 1777 tmp
ln -s /run var/run
ln -s /tmp var/tmp
echo "localhost" > etc/hostname
cat > etc/hosts <<-EOF
127.0.0.1 localhost localhost.localdomain
::1 localhost localhost.localdomain
EOF
cat > etc/shells <<-EOF
# valid login shells
/bin/sh
/bin/ash
EOF
install -m644 \
"$srcdir"/group \
"$srcdir"/passwd \
"$srcdir"/profile \
etc/
install -m640 "$builddir"/shadow \
etc/
# symlinks
ln -s /proc/mounts etc/mtab
}
sha512sums="
fc9508f3f3a731b428d7a7f2dda5fd34d855a1bbbb5f8afd22da64cfc3b0354888b25452ac2e1500424aa2eda7ca6fb44c993e17c1912535d60f8bc64487f52b group
2022-03-21 12:25:55 +00:00
f6fe247889a9c09a1c6ac6b1f5baae9ecc9f6300594428dc04dd8e7543c06b4774f57cf034e970a913faf7bbf0aff28b170e5c6425ab04b380b34a3b80a3b529 passwd
2e0c19c08bc161278db950ca66c138091724a134ccbaa655cb7efa933f32ce28cfc006a563d0c150646c8ac7b6c84ab03f0958fd1a55c17e7d3f91c9ff0c1e94 profile
"