summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rwxr-xr-xbuild77
1 files changed, 27 insertions, 50 deletions
diff --git a/build b/build
index fa48d2f..4f77a6f 100755
--- a/build
+++ b/build
@@ -1,55 +1,32 @@
#!/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
- printf 'base-files: Installing base files...\n'
- mv src dest
- printf 'base-files: Making filesystem hierarchy...\n'
- cd dest && \
- mkdir -p bin boot dev/pts etc/opt home lib media mnt opt proc && \
- install -d -m 0750 root && \
- mkdir -p sbin srv sys && \
- install -d -m 1777 tmp var/tmp && \
- mkdir -p usr/bin usr/include usr/lib usr/sbin \
- usr/share/man usr/share/misc usr/src && \
- mkdir -p usr/local/bin usr/local/include usr/local/lib usr/local/sbin \
- usr/local/share/man usr/local/share/misc usr/local/src && \
- mkdir -p usr/local/etc usr/local/games && \
- mkdir -p usr/share/doc usr/share/info usr/share/locale \
- usr/share/terminfo usr/share/zoneinfo && \
- mkdir -p usr/local/share/doc usr/local/share/info \
- usr/local/share/locale usr/local/share/terminfo \
- usr/local/share/zoneinfo && \
- mkdir -p usr/share/man/man1 usr/share/man/man2 \
- usr/share/man/man3 usr/share/man/man4 \
- usr/share/man/man5 usr/share/man/man6 \
- usr/share/man/man7 usr/share/man/man8 && \
- mkdir -p usr/local/share/man/man1 usr/local/share/man/man2 \
- usr/local/share/man/man3 usr/local/share/man/man4 \
- usr/local/share/man/man5 usr/local/share/man/man6 \
- usr/local/share/man/man7 usr/local/share/man/man8 && \
- ln -s share/man usr/local/man && \
- mkdir -p var/cache var/lib/misc var/local var/lock var/log var/mail \
- var/opt var/run var/spool
- printf 'base-files: Making service run control links...\n'
- cd dest && \
- mkdir etc/rc.d && \
- ln -s rc etc/init.d/rcS && \
- ln -s rc etc/init.d/rcK && \
- ln -s ../init.d/sysfs etc/rc.d/S01sysfs && \
- ln -s ../init.d/mdev etc/rc.d/S02mdev && \
- ln -s ../init.d/mountall etc/rc.d/S03mountall && \
- ln -s ../init.d/hostname etc/rc.d/S04hostname && \
- ln -s ../init.d/networking etc/rc.d/S05networking && \
- ln -s ../init.d/syslog etc/rc.d/S06syslog && \
- ln -s ../init.d/telnetd etc/rc.d/S07telnetd && \
- ln -s ../init.d/httpd etc/rc.d/S08httpd
- cd dest && \
- ln -s ../init.d/httpd etc/rc.d/K01httpd && \
- ln -s ../init.d/telnetd etc/rc.d/K02telnetd && \
- ln -s ../init.d/syslog etc/rc.d/K03syslog && \
- ln -s ../init.d/networking etc/rc.d/K04networking
- cd dest/etc/network && \
- mkdir if-down.d if-post-down.d if-pre-up.d if-up.d
- oh-installfiles
+ # 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
+ # 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