summaryrefslogtreecommitdiffstats
path: root/build
blob: 46be68aa2bd9469645cd694e37848c53f6d8bb2f (plain)
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
#!/usr/bin/make -f

include ../macros.$(OPK_HOST_ARCH_KERNEL).mk

version = $$(printf '%s\n' '$(OPK_SOURCE_VERSION)' | \
	sed 's|\(^[0-9][0-9]*\.[0-9][0-9]*\).*$$|\1|')

script = \
	s|@DISTRIBUTION@|ProteanOS|; \
	s|@OS@|$(os)|; \
	s|@VERSION@|$(version)|;

build:

install: build
	# Make file system hierarchy.
	while read -r mode dir; do \
		install -d -m "$${mode}" "base-files.data/$${dir}"; \
	done <'../dirs'
	while read -r mode dir; do \
		install -d -m "$${mode}" "base-files.data/$${dir}"; \
	done <'../dirs.$(OPK_HOST_ARCH_KERNEL)'
	ln -s share/man base-files.data/usr/local/man
	ln -s /run      base-files.data/var/run
	ln -s /run/lock base-files.data/var/lock
	# Install base files.
	for file in /etc/issue /etc/motd; do \
		sed "$(script)" "src/$${file}" >"base-files.data/$${file}"; \
	done
	printf '%s\n' '$(OPK_HOST_ARCH)' >'base-files.data/etc/proteanos_arch'
	printf '%s\n' '$(OPK_HOST_PLAT)' >'base-files.data/etc/proteanos_plat'
	# Install common licenses.
	install -p -m 644 src/usr/share/common-licenses/* \
		base-files.data/usr/share/common-licenses