PKGBUILDs/core/filesystem/PKGBUILD

160 lines
4.2 KiB
Bash
Raw Normal View History

2012-12-05 17:13:23 +00:00
# $Id$
2012-07-24 03:42:50 +00:00
# Maintainer: Tom Gundersen <teg@jklm.no>
2012-11-28 06:34:18 +00:00
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - modifed os-release
2012-07-24 03:42:50 +00:00
pkgname=filesystem
2015-10-05 18:58:03 +00:00
pkgver=2015.09
2015-02-24 14:19:21 +00:00
pkgrel=1
2012-07-24 03:42:50 +00:00
pkgdesc='Base filesystem'
2013-01-27 04:03:58 +00:00
arch=('i686' 'x86_64')
2012-07-24 03:42:50 +00:00
license=('GPL')
url='http://www.archlinux.org'
groups=('base')
install='filesystem.install'
2012-09-14 01:03:58 +00:00
makedepends=('asciidoc')
depends=('iana-etc')
2012-07-24 03:42:50 +00:00
backup=('etc/fstab' 'etc/crypttab' 'etc/group' 'etc/hosts' 'etc/ld.so.conf' 'etc/passwd'
'etc/shadow' 'etc/gshadow' 'etc/resolv.conf' 'etc/motd' 'etc/nsswitch.conf'
'etc/shells' 'etc/host.conf' 'etc/securetty' 'etc/profile' 'etc/issue')
source=('group' 'issue' 'nsswitch.conf' 'securetty' 'host.conf' 'ld.so.conf'
'passwd' 'shadow' 'fstab' 'crypttab' 'hosts' 'motd' 'os-release' 'resolv.conf'
2012-09-14 01:03:58 +00:00
'shells' 'gshadow' 'profile' 'modprobe.d.usb-load-ehci-first' 'archlinux.7.txt'
2013-03-15 05:01:34 +00:00
'locale.sh')
2015-02-24 14:19:21 +00:00
md5sums=('4d7417d2bf8872665c0907f09ae37c34'
'7813c481156f6b280a3ba91fc6236368'
'9e4533df61f0c82d6b2e2371f7376282'
'4c4540eeb748bf1f71d631b8c1dcf0b3'
'f28150d4c0b22a017be51b9f7f9977ed'
'6e488ffecc8ba142c0cf7e2d7aeb832e'
2014-06-24 00:23:35 +00:00
'a998d1e6c7cc5791a7f4a2b49b2d10ce'
'1ec1b16e2a71fad63ab8f147069a5d97'
'693c97f2c9a519bb97a17008e92c2b74'
2014-10-29 13:52:08 +00:00
'f0a5071f50d8864d2810c44e23eb00cc'
'7bc65f234dfb6abf24e7c3b03e86f4ff'
'd41d8cd98f00b204e9800998ecf8427e'
'52db9503314f639b8f47bd9a251a6ea9'
'6f48288b6fcaf0065fcb7b0e525413e0'
'22518e922891f9359f971f4f5b4e793c'
2015-02-24 14:19:21 +00:00
'69e460404f45bdb7288d1de662e56dd9'
2015-10-05 18:58:03 +00:00
'cfa3345c485c59e681ab39a44dc7ece1'
'a8a962370cd0128465d514e6a1f74130'
'2e193c4a37245f2323ebe87f1a673563'
2015-02-24 14:19:21 +00:00
'71ed98c52e11ada1f936ac8cb14eecd9')
2014-10-29 13:52:08 +00:00
lint() {
# ensure that passwd is sync'd to shadow and group is sync'd to gshadow.
local r=0
local passwd shadow group gshadow
for f in passwd shadow group gshadow; do
mapfile -t "$f" < <(cut -d: -f1 "$f" | sort)
done
# we can cheat and do simple string comparison only because we can make some
# assumptions about the data in these files
if [[ ${passwd[*]} != "${shadow[*]}" ]]; then
error 'passwd is not in sync with shadow!'
r=1
fi
if [[ ${group[*]} != "${gshadow[*]}" ]]; then
error 'group is not in sync with gshadow!'
r=1
fi
return $r
}
2012-09-14 01:03:58 +00:00
build() {
2015-10-05 18:58:03 +00:00
cd "$srcdir"
2014-10-29 13:52:08 +00:00
lint
2012-09-14 01:03:58 +00:00
a2x -d manpage -f manpage archlinux.7.txt
}
2012-07-24 03:42:50 +00:00
package() {
2015-10-05 18:58:03 +00:00
cd "$pkgdir"
2012-07-24 03:42:50 +00:00
#
# setup root filesystem
#
2012-11-28 06:34:18 +00:00
for d in boot dev etc home mnt usr var opt srv/http run; do
2015-10-05 18:58:03 +00:00
install -d -m755 $d
2012-07-24 03:42:50 +00:00
done
install -d -m555 proc
install -d -m555 sys
install -d -m0750 root
install -d -m1777 tmp
# vsftpd won't run with write perms on /srv/ftp
install -d -m555 -g ftp srv/ftp
# setup /etc
install -d etc/{ld.so.conf.d,skel,profile.d}
2014-07-12 00:41:17 +00:00
for f in fstab group host.conf hosts issue ld.so.conf motd nsswitch.conf passwd resolv.conf securetty shells profile; do
2015-10-05 18:58:03 +00:00
install -m644 "$srcdir"/$f etc/
2012-07-24 03:42:50 +00:00
done
ln -s /proc/self/mounts etc/mtab
for f in gshadow shadow crypttab; do
2015-10-05 18:58:03 +00:00
install -m600 "$srcdir"/$f etc/
2012-07-24 03:42:50 +00:00
done
touch etc/arch-release
2015-10-05 18:58:03 +00:00
install -D -m644 "$srcdir"/modprobe.d.usb-load-ehci-first usr/lib/modprobe.d/usb-load-ehci-first.conf
install -m755 "$srcdir"/locale.sh etc/profile.d/locale.sh
2014-07-12 00:41:17 +00:00
install -Dm644 "$srcdir"/os-release "$pkgdir"/usr/lib/os-release
2012-07-24 03:42:50 +00:00
# setup /var
2014-10-29 13:52:08 +00:00
for d in cache local opt log/old lib/misc empty; do
2015-10-05 18:58:03 +00:00
install -d -m755 var/$d
2012-07-24 03:42:50 +00:00
done
install -d -m1777 var/{tmp,spool/mail}
2015-10-05 18:58:03 +00:00
2012-07-24 03:42:50 +00:00
# allow setgid games to write scores
install -d -m775 -g games var/games
ln -s spool/mail var/mail
ln -s ../run var/run
ln -s ../run/lock var/lock
#
# setup /usr hierarchy
#
2013-06-03 15:46:58 +00:00
for d in bin include lib share/misc src; do
2015-10-05 18:58:03 +00:00
install -d -m755 usr/$d
2012-07-24 03:42:50 +00:00
done
for d in $(seq 8); do
2015-10-05 18:58:03 +00:00
install -d -m755 usr/share/man/man$d
2012-07-24 03:42:50 +00:00
done
2013-03-15 05:01:34 +00:00
#
2013-01-27 04:03:58 +00:00
# add lib symlinks
#
2015-10-05 18:58:03 +00:00
ln -s usr/lib "$pkgdir"/lib
[[ $CARCH = 'x86_64' ]] && (
ln -s usr/lib "$pkgdir"/lib64
ln -s lib "$pkgdir"/usr/lib64
2013-03-15 05:01:34 +00:00
)
2013-01-27 04:03:58 +00:00
2013-06-03 15:46:58 +00:00
#
# add bin symlinks
#
2015-10-05 18:58:03 +00:00
ln -s usr/bin "$pkgdir"/bin
ln -s usr/bin "$pkgdir"/sbin
ln -s bin "$pkgdir"/usr/sbin
2013-06-03 15:46:58 +00:00
2012-09-14 01:03:58 +00:00
#
# install archlinux(7) manpage
#
2015-10-05 18:58:03 +00:00
install -D -m644 "$srcdir"/archlinux.7 usr/share/man/man7/archlinux.7
2012-07-24 03:42:50 +00:00
#
# setup /usr/local hierarchy
#
for d in bin etc games include lib man sbin share src; do
2015-10-05 18:58:03 +00:00
install -d -m755 usr/local/$d
2012-07-24 03:42:50 +00:00
done
ln -s ../man usr/local/share/man
}