OSDN Git Service

[add] : alterlinux filesystem
[alterlinux/alterlinux-pkgbuilds.git] / alter-stable / any / filesystem / PKGBUILD
1 # Maintainer : Yamada Hayao <hayao@fascode.net>
2 # Contributor: Sébastien Luttringer
3 # Contributor: Tom Gundersen <teg@jklm.no>
4
5 pkgname=filesystem
6 pkgver=2020.09.29
7 pkgrel=1
8 pkgdesc='Base Arch Linux files'
9 arch=('x86_64' 'i686')
10 license=('GPL')
11 url='https://fascode.net/en/projects/linux/alter/'
12 depends=('iana-etc')
13 provides=("alterlinux-filesystem=${pkgver}")
14
15
16 backup=(
17     'etc/arch-release'
18     'etc/crypttab'
19     'etc/fstab'
20     'etc/group'
21     'etc/gshadow'
22     'etc/host.conf'
23     'etc/hosts'
24     'etc/issue'
25     'etc/ld.so.conf'
26     'etc/motd'
27     'etc/nsswitch.conf'
28     'etc/passwd'
29     'etc/profile'
30     'etc/resolv.conf'
31     'etc/securetty'
32     'etc/shadow'
33     'etc/shells'
34     'usr/lib/os-release'
35 )
36
37 source=(
38     'arch-release'
39     'crypttab'
40     'env-generator'
41     'fstab'
42     'group'
43     'gshadow'
44     'host.conf'
45     'hosts'
46     'issue'
47     'letter-to-you'
48     'ld.so.conf'
49     'locale.sh'
50     'motd'
51     'nsswitch.conf'
52     'os-release'
53     'passwd'
54     'profile'
55     'resolv.conf'
56     'securetty'
57     'shadow'
58     'shells'
59     'sysctl'
60     'sysusers'
61     'tmpfiles'
62     'archlinux.svg'
63     'archlinux.png'
64     'archlinux-logo.svg' 
65     'archlinux-logo.png'
66 )
67
68 md5sums=(
69     $(
70         local i
71         for i in ${source[*]}; do
72             echo -e "SKIP "
73         done
74     )
75 )
76
77 pkgver() {
78     echo -ne "$(date "+%Y.%m.%d")"
79 }
80
81 package() {
82     cd "$pkgdir"
83
84     # setup root filesystem
85     for d in boot dev etc home mnt usr var opt srv/http run; do
86         install -d -m755 $d
87     done
88     install -d -m555 proc
89     install -d -m555 sys
90     install -d -m0750 root
91     install -d -m1777 tmp
92     # vsftpd won't run with write perms on /srv/ftp
93     # ftp (uid 14/gid 11)
94     install -d -m555 -g 11 srv/ftp
95
96     # setup /etc and /usr/share/factory/etc
97     install -d etc/{ld.so.conf.d,skel,profile.d} usr/share/factory/etc
98     for f in arch-release fstab group host.conf hosts issue letter-to-you ld.so.conf motd nsswitch.conf \
99         passwd resolv.conf securetty shells profile; do
100         install -m644 "$srcdir"/$f etc/
101         install -m644 "$srcdir"/$f usr/share/factory/etc/
102     done
103     ln -s ../proc/self/mounts etc/mtab
104     for f in gshadow shadow crypttab; do
105         install -m600 "$srcdir"/$f etc/
106         install -m600 "$srcdir"/$f usr/share/factory/etc/
107     done
108     install -m644 "$srcdir"/locale.sh etc/profile.d/locale.sh
109     install -Dm644 "$srcdir"/os-release usr/lib/os-release
110
111     # setup /var
112     for d in cache local opt log/old lib/misc empty; do
113         install -d -m755 var/$d
114     done
115     install -d -m1777 var/{tmp,spool/mail}
116
117     # allow setgid games (gid 50) to write scores
118     install -d -m775 -g 50 var/games
119     ln -s spool/mail var/mail
120     ln -s ../run var/run
121     ln -s ../run/lock var/lock
122
123     # setup /usr hierarchy
124     for d in bin include lib share/{misc,pixmaps} src; do
125         install -d -m755 usr/$d
126     done
127     for d in {1..8}; do
128         install -d -m755 usr/share/man/man$d
129     done
130
131     # add lib symlinks
132     ln -s usr/lib lib
133     [[ $CARCH = 'x86_64' ]] && {
134         ln -s usr/lib lib64
135         ln -s lib usr/lib64
136     }
137
138     # add bin symlinks
139     ln -s usr/bin bin
140     ln -s usr/bin sbin
141     ln -s bin usr/sbin
142
143     # setup /usr/local hierarchy
144     for d in bin etc games include lib man sbin share src; do
145         install -d -m755 usr/local/$d
146     done
147     ln -s ../man usr/local/share/man
148
149     # setup systemd-sysctl
150     install -D -m644 "$srcdir"/sysctl usr/lib/sysctl.d/10-arch.conf
151
152     # setup systemd-sysusers
153     install -D -m644 "$srcdir"/sysusers usr/lib/sysusers.d/arch.conf
154
155     # setup systemd-tmpfiles
156     install -D -m644 "$srcdir"/tmpfiles usr/lib/tmpfiles.d/arch.conf
157
158     # setup systemd.environment-generator
159     install -D -m755 "$srcdir"/env-generator usr/lib/systemd/system-environment-generators/10-arch
160
161     # add logo
162     install -D -m644 "$srcdir"/archlinux{,-logo}.{svg,png} usr/share/pixmaps
163 }
164
165 # vim:set ts=2 sw=2 et: