jobcore/filesystem/PKGBUILD

141 lines
5.5 KiB
Bash

#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=filesystem
pkgver=2023.01.30
pkgrel=01
pkgdesc='Base Joborun Linux file system'
arch=('x86_64')
groups=( jobbot )
url='https://pozol.eu'
depends=('iana-etc')
backup=('etc/crypttab' 'etc/fstab' 'etc/group' 'etc/gshadow' 'etc/host.conf'
'etc/hosts' 'etc/issue' 'etc/ld.so.conf' 'etc/nsswitch.conf'
'etc/passwd' 'etc/profile' 'etc/resolv.conf' 'etc/resolv.conf.pacnew' 'etc/securetty'
'etc/shadow' 'etc/shells' 'etc/subuid' 'etc/subgid')
source=('crypttab' 'fstab' 'group' 'gshadow' 'host.conf' 'hosts'
'issue' 'ld.so.conf' 'locale.sh' 'motd' 'nsswitch.conf' 'os-release'
'passwd' 'profile' 'resolv.conf' 'securetty' 'shadow' 'shells'
'subuid' 'subgid' 'sysusers' 'tmpfiles' 'modprobe.d.usb-load-ehci-first'
'jobo-release')
# 'env-generator' 'joborun-linux-logo.svg' 'joborun-linux-logo.png'
# 'joborun-linux-logo-text.svg' 'joborun-linux-logo-text-dark.svg')
package() {
cd "$pkgdir"
# setup root filesystem
for d in boot dev etc home mnt usr var opt srv/http run; do
install -d -m755 $d
done
install -d -m555 proc
install -d -m555 sys
install -d -m0755 root
install -d -m1777 tmp
install -d -m777 src
# vsftpd won't run with write perms on /srv/ftp
# ftp (uid 14/gid 11)
install -d -m555 -g 11 srv/ftp
# setup /etc and /usr/share/factory/etc
install -d etc/{ld.so.conf.d,skel,profile.d} usr/share/factory/etc
for f in fstab group host.conf hosts issue ld.so.conf motd nsswitch.conf \
passwd securetty shells profile subuid subgid; do
install -m644 "$srcdir"/$f etc/
install -m644 "$srcdir"/$f usr/share/factory/etc/
done
install -m644 "$srcdir"/resolv.conf etc/resolv.conf.pacnew
ln -s ../proc/self/mounts etc/mtab
for f in gshadow shadow crypttab; do
install -m600 "$srcdir"/$f etc/
install -m600 "$srcdir"/$f usr/share/factory/etc/
done
install -D -m644 "$srcdir"/modprobe.d.usb-load-ehci-first usr/lib/modprobe.d/usb-load-ehci-first.conf
install -Dm644 "$srcdir"/jobo-release etc/jobo-release
touch etc/arch-release
install -m644 "$srcdir"/locale.sh etc/profile.d/locale.sh
install -Dm644 "$srcdir"/os-release usr/lib/os-release
ln --symbolic --relative "$pkgdir"/usr/lib/os-release "$pkgdir"/etc/os-release
# setup /var
for d in cache local opt log/old lib/misc lib/pacman empty; do
install -d -m755 var/$d
done
install -d -m1777 var/{tmp,spool/mail}
# allow setgid games (gid 50) to write scores
install -d -m775 -g 50 var/games
ln -s spool/mail var/mail
ln -s ../run var/run
ln -s ../run/lock var/lock
# setup /usr hierarchy
for d in bin include lib share/{misc,pixmaps} src; do
install -d -m755 usr/$d
done
for d in {1..8}; do
install -d -m755 usr/share/man/man$d
done
# add lib symlinks
ln -s usr/lib lib
ln -s usr/lib lib64
ln -s lib usr/lib64
# add bin symlinks
ln -s usr/bin bin
ln -s usr/bin sbin
ln -s bin usr/sbin
# setup /usr/local hierarchy
for d in bin etc games include lib man sbin share src; do
install -d -m755 usr/local/$d
done
ln -s ../man usr/local/share/man
# setup systemd-sysusers wrapper
install -D -m644 "$srcdir"/sysusers usr/lib/sysusers.d/joborun.conf
# setup systemd-tmpfiles wrapper
install -D -m644 "$srcdir"/tmpfiles usr/lib/tmpfiles.d/joborun.conf
## # add logo
## install -D -m644 "$srcdir"/joborun-linux-logo{.png,.svg,-text.svg,-text-dark.svg} usr/share/pixmaps
}
#---- license gpg-key sha256sums ----
license=('GPL')
sha256sums=(e03bede3d258d680548696623d5979c6edf03272e801a813c81ba5a5c64f4f82 # crypttab
115d324c8518affc7bec5559579d85f8f5491646b6110ea9567a586a26a76da9 # fstab
327c61df6b9dcfabfe06ff4477b3a9cae7f9ca7e463f78f8cbc739b57e9448e1 # group
5003d01f30a868d6e79010a9313d43481701b5c59fbe7252fb33760d043878f1 # gshadow
250cfbb9a2b5e3cc9879ab2080eb3c7875fbe66eb375ce3f96eee335654a4979 # host.conf
8a63876eaf11641bbecdf2dea934c14e730dd4daceb32a5b172d08887a263f73 # hosts
0b59a9447ca32f89ceccd08555b509d2e4a5852fd7223195d0404cd1599ad052 # issue
dad04a370e488aa85fb0a813a5c83cf6fd981ce01883fc59685447b092de84b5 # ld.so.conf
6c17fa911c82c27a30414624cdb32b44a76e60304cb875dc794bb9ee7aac21d4 # locale.sh
3ac63947031658a1af32e418d1c66990287112f9ff090ead603caf49dfaf2d6f # motd
581a292aeae5e125f8527fef41a839c6c3d6f81f853c49c476b6ab25e20917ef # nsswitch.conf
b5ad863843339840665b80b21656bc04402a824c01f9bc5c3e5974c8182113f5 # os-release
aa9df866acb6a56ad72aca7cd215642ed8c55ba9a01d205c667ed082bc997568 # passwd
5e4088ad8d0853d390fa303f6be8c3f69c33834200cba9e90f7849f1993ca8d0 # profile
297113b9e11af3e73756482eaca6ad188e210d8cd537e66881225f6feeec1e3a # resolv.conf
d88be2b45b43605ff31dd83d6a138069b6c2e92bc8989b7b9ab9eba8da5f8c7b # securetty
6e13705ac4d6f69cdba118c6b70c722346fd3c45224133e6bbfe28aca719563c # shadow
268e414ace5dd1579e5a3085a45a969c3d580d734182166f85d02411d3be6f7d # shells
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 # subgid
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 # subuid
ec207f224fdd6f29d2a333b2e9be211ef44f21a2bff0c0c6d7ea6d1b72b70eee # sysusers
618ac097441c1f2daffc9967e5c3cd18ea8866f776db62d04bf401c53907b1c9 # tmpfiles
90fb123aa8c0176bc144322b585bb889181c437542ddbe546af43e11b95be6ab # modprobe.d.usb-load-ehci-first
040a7eafddb19c6df188a84616441cc1bf052b50f4c131df692b143270d7770c) # jobo-release