summaryrefslogtreecommitdiff
path: root/system/adelie-base/APKBUILD
blob: 4bd4b1c2666cd4dc6c54a6aff9e4e7290b328cca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=adelie-base
pkgver=0.8.1
pkgrel=3
pkgdesc="The Adélie Linux Base System"
url="http://adelielinux.org/"
arch="noarch"
license="NCSA"
_core_depends="apk-tools adelie-keys shadow
	shimmy grep procps bash
	coreutils diffutils findutils sharutils
	util-linux net-tools
	sysklogd
	patch sed nvi psmisc less"
depends="adelie-core debianutils libarchive-tools file zsh binutils
	console-setup sysklogd man-db tzdata"
makedepends=""
makedepends_host="$depends"
install=""
options="!check !fhs"
subpackages="adelie-core:core $pkgname-doc $pkgname-posix $pkgname-lsb dev-kit:devkit"
provides="alpine-base"
source="https://distfiles.adelielinux.org/source/$pkgname/$pkgname-$pkgver.tar.xz
	group
	passwd
	addgroup
	adduser
	"

build() {
	# taken from Alpine Base Layout: generate shadow
	awk -F: '{
		pw = ":!:"
		if ($1 == "root") { pw = "::" }
		print($1 pw ":0:::::")
	}' "$srcdir"/passwd > "$builddir"/tree/etc/shadow
	chmod 640 "$builddir"/tree/etc/shadow
}

package() {
	cd "$builddir"
	mkdir -p "$pkgdir"
	make install DESTDIR="$pkgdir"
	install -m644 "$srcdir"/group "$pkgdir"/etc/group
	install -m644 "$srcdir"/passwd "$pkgdir"/etc/passwd
	install -m640 -g shadow "$builddir"/tree/etc/shadow "$pkgdir"/etc/shadow

	# stupid inflatable stupid busybox
	local i
	for i in adduser addgroup; do
		install -m755 "$srcdir"/$i "$pkgdir"/usr/sbin/$i
	done
}

core() {
	core="The Adélie Linux minimal runtime environment"
	depends=$_core_depends
	replaces="adelie-base"
	mkdir -p "$subpkgdir"
	mv -i "$pkgdir"/* "$subpkgdir"/
}

doc() {
	local _doc DOCS
	DOCS="CONTRIBUTING.rst LICENSE README.rst"
	for _doc in $DOCS; do
		install -Dm644 "$srcdir"/$pkgname-$pkgver/$_doc \
			"$subpkgdir"/usr/share/doc/$pkgname/$_doc || return 1
	done
}

posix() {
	# We pull in vim for /usr/bin/ex, until apk has an alternatives system
	depends="adelie-base at bc cflow ed fcron heirloom-pax m4 mailx mawk vim"
	pkgdesc="$pkgdesc - Additional POSIX tools"
	mkdir -p "$subpkgdir"
	return 0
}

lsb() {
	depends="adelie-base gettext-tiny gzip libarchive-tools linux-pam make mawk ncurses nspr nss"
	pkgdesc="$pkgdesc - Additional LSB tools"
	mkdir -p "$subpkgdir"
	return 0
}

devkit() {
	depends="build-tools fakeroot gzip libarchive-tools mawk xz"
	pkgdesc="The Adélie Linux Development Kit"
	mkdir -p "$subpkgdir"
	return 0
}

sha512sums="6eb6e2798e924caa911f3d070b1c955aa1abde42ac7b51224b2c4dc851a7dcfc586915ef8b3977a1cfb13a4f503003ea62acf59417daa8a2d4b6cc2e27b755ad  adelie-base-0.8.1.tar.xz
50a2d4df4218594dd3288ac96d5336ad72318451a66540f4c86cdf31498fedf5e39ce3bfee423adbaca1ffcaf26aeaa82f17ed847bc25c0f193d2b5a5c121b97  group
cce002394e6febc678679ca829afd5d91d26a1d5c5d3ab59f52412c75de95008c2df7e775b7539054c132a8b65160e00c5315b4b66feb27dd714259198068fd5  passwd
5b87e0c73e7d73715467b09c9c228b14abfdc1567b3d8a3e6ef86694a9d016c798c22411c9c8ccf41920fbe185199f6d6dbd45d4bceb6652ab4a7bea87c4fe51  addgroup
f50be377c781b1eefb1804ac9d96b4ebc64f80abe0d12b288413687a000e79ca30c531bbced2c63f9e4df59b1d8a71d0eda09ee82782eaafea453f2f1c2f7b8f  adduser"