# Contributor: Sören Tempel # Maintainer: Natanael Copa pkgname=alpine-baselayout pkgver=3.0.3 pkgrel=0 pkgdesc="Alpine base dir structure and init scripts" url="http://git.alpinelinux.org/cgit/aports/tree/main/alpine-baselayout" arch="all" license="GPL2" depends="" pkggroups="shadow" options="!fhs" install="$pkgname.pre-install $pkgname.pre-upgrade $pkgname.post-upgrade $pkgname.post-install" source="mkmntdirs.c crontab color_prompt aliases.conf blacklist.conf i386.conf kms.conf group inittab passwd profile protocols services " _builddir="$srcdir"/build prepare() { mkdir -p "$_builddir" } build() { cd "$_builddir" ${CC:-${CROSS_COMPILE}gcc} $CPPFLAGS $CFLAGS $LDFLAGS \ "$srcdir"/mkmntdirs.c -o "$_builddir"/mkmntdirs # generate shadow awk -F: '{ pw = ":!:" if ($1 == "root") { pw = "::" } print($1 pw ":0:::::") }' "$srcdir"/passwd > shadow } package() { mkdir -p "$pkgdir" cd "$pkgdir" install -m 0755 -d \ dev \ dev/pts \ dev/shm \ etc \ etc/apk \ etc/conf.d \ etc/crontabs \ etc/init.d \ etc/modprobe.d \ etc/modules-load.d \ etc/network/if-down.d \ etc/network/if-post-down.d \ etc/network/if-pre-up.d \ etc/network/if-up.d \ etc/opt \ etc/periodic/15min \ etc/periodic/daily \ etc/periodic/hourly \ etc/periodic/monthly \ etc/periodic/weekly \ etc/profile.d \ etc/sysctl.d \ home \ lib/firmware \ lib/mdev \ media/cdrom \ media/floppy \ media/usb \ mnt \ proc \ run \ sbin \ srv \ sys \ usr/bin \ usr/local/bin \ usr/local/lib \ usr/local/share \ usr/sbin \ usr/share \ usr/share/man \ usr/share/misc \ var/cache \ var/cache/misc \ var/empty \ var/lib \ var/lib/misc \ var/local \ var/lock/subsys \ var/log \ var/opt \ var/run \ var/spool \ var/spool/cron \ || return 1 install -d -m 0700 "$pkgdir"/root || return 1 install -d -m 1777 "$pkgdir"/tmp "$pkgdir"/var/tmp || return 1 install -m755 "$_builddir"/mkmntdirs "$pkgdir"/sbin/mkmntdirs \ || return 1 install -m600 "$srcdir"/crontab "$pkgdir"/etc/crontabs/root || return 1 install -m644 "$srcdir"/color_prompt "$pkgdir"/etc/profile.d/ \ || return 1 install -m644 \ "$srcdir"/aliases.conf \ "$srcdir"/blacklist.conf \ "$srcdir"/i386.conf \ "$srcdir"/kms.conf \ "$pkgdir"/etc/modprobe.d/ || return 1 echo "UTC" > "$pkgdir"/etc/TZ echo "localhost" > "$pkgdir"/etc/hostname echo "127.0.0.1 localhost localhost.localdomain" > "$pkgdir"/etc/hosts echo "af_packet" >"$pkgdir"/etc/modules cat > "$pkgdir"/etc/shells < "$pkgdir"/etc/motd <. You can setup the system with the command: setup-alpine You may change this message by editing /etc/motd. EOF cat > "$pkgdir"/etc/sysctl.conf < "$pkgdir"/etc/sysctl.d/00-alpine.conf < "$pkgdir"/etc/fstab <