OSDN Git Service

upg
[joborun/jobcore.git] / filesystem / PKGBUILD-arch
1 # Maintainer: Sébastien Luttringer
2 # Contributor: Tom Gundersen <teg@jklm.no>
3
4 pkgname=filesystem
5 pkgver=2021.12.07
6 pkgrel=1
7 pkgdesc='Base Arch Linux files'
8 arch=('x86_64')
9 license=('GPL')
10 url='https://archlinux.org'
11 depends=('iana-etc')
12 backup=('etc/crypttab' 'etc/fstab' 'etc/group' 'etc/gshadow' 'etc/host.conf'
13         'etc/hosts' 'etc/issue' 'etc/ld.so.conf' 'etc/nsswitch.conf'
14         'etc/passwd' 'etc/profile' 'etc/resolv.conf' 'etc/securetty'
15         'etc/shadow' 'etc/shells')
16 source=('crypttab' 'env-generator' 'fstab' 'group' 'gshadow' 'host.conf' 'hosts'
17         'issue' 'ld.so.conf' 'locale.sh' 'nsswitch.conf' 'os-release'
18         'passwd' 'profile' 'resolv.conf' 'securetty' 'shadow' 'shells' 'sysctl'
19         'sysusers' 'tmpfiles' 'archlinux-logo.svg' 'archlinux-logo.png'
20         'archlinux-logo-text.svg' 'archlinux-logo-text-dark.svg')
21 sha256sums=('e03bede3d258d680548696623d5979c6edf03272e801a813c81ba5a5c64f4f82'
22             'ed0cb4f1db4021f8c3b5ce78fdf91d2c0624708f58f36c9cf867f4d93c3bc6da'
23             'e54626e74ed8fee4173b62a545ab1c3a3a069e4217a0ee8fc398d9933e9c1696'
24             '244f0718ee2a9d6862ae59d6c18c1dd1568651eada91a704574fa527fbac2b3a'
25             '90d879374f77bac47f132164c1e7fc4892e994ff1d1ac376efa0c1c26ea37273'
26             '4d7b647169063dfedbff5e1e22cee77bd1a4183dbcfd5e802e68939da4bbf733'
27             'd9cd8a77d9e0aa5e90d7f4ed74c8745c17b525e720e28e4c44364150003c35f9'
28             'c774dbbcaea38ee1c1141d0daf82aa8177bfb26aca896d6f0c4ccdc902f6ac42'
29             'dad04a370e488aa85fb0a813a5c83cf6fd981ce01883fc59685447b092de84b5'
30             '8ca2d8eef6fb5143c9ef7e9174ccfef59ac7ad2deee243574cd10c763156cc10'
31             'c8ee7a9faf798caab178ec51afae4146f1efd8a716b7acedf28345b6c75f9697'
32             'a54d010860b3e9c4b8ccc282e61da5b7118c7547697151aaca36ee771d323dc9'
33             '5e06477834f51abf42ea4e8dc199632afc6afbfd8c44354685a271e9a48d2c0a'
34             '5e4088ad8d0853d390fa303f6be8c3f69c33834200cba9e90f7849f1993ca8d0'
35             '5557d8e601b17a80d1ea7de78a9869be69637cb6a02fbfe334e22fdf64e61d4c'
36             'd88be2b45b43605ff31dd83d6a138069b6c2e92bc8989b7b9ab9eba8da5f8c7b'
37             '6e13705ac4d6f69cdba118c6b70c722346fd3c45224133e6bbfe28aca719563c'
38             'c390b31fffc4a2b5d78ae8c89f5317aadef1f71baac09cfb467b675db1406d61'
39             '89e43a0b7028f52d5c8e7fb961d962c4b4f4e9595880a6157274ddb2c7c0b6b4'
40             'b5b28f395583d141d88c0b955cd05124f9b8cdf003feab01e55885b8e8c1303e'
41             'f17efd1c6480c5db1fdab4a0e3cfcd4baa44a3e1ae1210aebeb40f8d5c82f742'
42             '3ffe8ea4e98db43a3ec4dcca55fd4009cd8b8d220f0996aef7a5b427fdf65234'
43             '3f48779141b68a81e07fee710a42025d4f67b16240295aa4cf148a7ba99cab3c'
44             '601069e6e8920309178c397fd8cebe43410827d01899d31777d13212f0dfacf8'
45             '96e3cc81623c0537a19799f9eefa966fe46ff5f28a9dc7af1187990973baa127')
46
47 package() {
48   cd "$pkgdir"
49
50   # setup root filesystem
51   for d in boot dev etc home mnt usr var opt srv/http run; do
52     install -d -m755 $d
53   done
54   install -d -m555 proc
55   install -d -m555 sys
56   install -d -m0750 root
57   install -d -m1777 tmp
58   # vsftpd won't run with write perms on /srv/ftp
59   # ftp (uid 14/gid 11)
60   install -d -m555 -g 11 srv/ftp
61
62   # setup /etc and /usr/share/factory/etc
63   install -d etc/{ld.so.conf.d,skel,profile.d} usr/share/factory/etc
64   for f in fstab group host.conf hosts issue ld.so.conf nsswitch.conf \
65   passwd resolv.conf securetty shells profile; do
66     install -m644 "$srcdir"/$f etc/
67     install -m644 "$srcdir"/$f usr/share/factory/etc/
68   done
69   ln -s ../proc/self/mounts etc/mtab
70   for f in gshadow shadow crypttab; do
71     install -m600 "$srcdir"/$f etc/
72     install -m600 "$srcdir"/$f usr/share/factory/etc/
73   done
74   touch etc/arch-release
75   install -m644 "$srcdir"/locale.sh etc/profile.d/locale.sh
76   install -Dm644 "$srcdir"/os-release usr/lib/os-release
77
78   # setup /var
79   for d in cache local opt log/old lib/misc empty; do
80     install -d -m755 var/$d
81   done
82   install -d -m1777 var/{tmp,spool/mail}
83
84   # allow setgid games (gid 50) to write scores
85   install -d -m775 -g 50 var/games
86   ln -s spool/mail var/mail
87   ln -s ../run var/run
88   ln -s ../run/lock var/lock
89
90   # setup /usr hierarchy
91   for d in bin include lib share/{misc,pixmaps} src; do
92     install -d -m755 usr/$d
93   done
94   for d in {1..8}; do
95     install -d -m755 usr/share/man/man$d
96   done
97
98   # add lib symlinks
99   ln -s usr/lib lib
100   [[ $CARCH = 'x86_64' ]] && {
101     ln -s usr/lib lib64
102     ln -s lib usr/lib64
103   }
104
105   # add bin symlinks
106   ln -s usr/bin bin
107   ln -s usr/bin sbin
108   ln -s bin usr/sbin
109
110   # setup /usr/local hierarchy
111   for d in bin etc games include lib man sbin share src; do
112     install -d -m755 usr/local/$d
113   done
114   ln -s ../man usr/local/share/man
115
116   # setup systemd-sysctl
117   install -D -m644 "$srcdir"/sysctl usr/lib/sysctl.d/10-arch.conf
118
119   # setup systemd-sysusers
120   install -D -m644 "$srcdir"/sysusers usr/lib/sysusers.d/arch.conf
121
122   # setup systemd-tmpfiles
123   install -D -m644 "$srcdir"/tmpfiles usr/lib/tmpfiles.d/arch.conf
124
125   # setup systemd.environment-generator
126   install -D -m755 "$srcdir"/env-generator usr/lib/systemd/system-environment-generators/10-arch
127
128   # add logo
129   install -D -m644 "$srcdir"/archlinux-logo{.png,.svg,-text.svg,-text-dark.svg} usr/share/pixmaps
130 }
131
132 # vim:set ts=2 sw=2 et: