security/linux-pam/linux-pam.sh

Fri, 15 Nov 2019 20:11:00 +0100

author
David Demelier <markand@malikania.fr>
date
Fri, 15 Nov 2019 20:11:00 +0100
changeset 1210
422313c3fcbd
parent 1019
ddab65a5b3f5
child 1216
6710613b88b9
permissions
-rw-r--r--

text/rarian: initial import, closes #2311

1019
ddab65a5b3f5 vanilla: use /bin/busybox sh as default shell
David Demelier <markand@malikania.fr>
parents: 902
diff changeset
1 #!/bin/busybox sh
385
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 #
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr>
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 #
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 # Permission to use, copy, modify, and/or distribute this software for any
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 # purpose with or without fee is hereby granted, provided that the above
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 # copyright notice and this permission notice appear in all copies.
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 #
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 #
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
17
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
18 PKGNAME=linux-pam
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
19 PKGVERSION=1.3.1
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
20 PKGREVISION=1
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 PKGLICENSE="BSD"
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 PKGSUMMARY="pluggable authentication modules"
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
23 PKGDOWNLOAD="https://github.com/linux-pam/linux-pam/releases/download/v$PKGVERSION/Linux-PAM-$PKGVERSION.tar.xz"
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
24 PKGOPTIONS="NLS SELINUX"
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
25 PKGPROTECT="etc/environment
386
30c785bd1da0 security/linux-pam: add basic files based on LFS
David Demelier <markand@malikania.fr>
parents: 385
diff changeset
26 etc/pam.d/other
30c785bd1da0 security/linux-pam: add basic files based on LFS
David Demelier <markand@malikania.fr>
parents: 385
diff changeset
27 etc/pam.d/system-account
30c785bd1da0 security/linux-pam: add basic files based on LFS
David Demelier <markand@malikania.fr>
parents: 385
diff changeset
28 etc/pam.d/system-auth
30c785bd1da0 security/linux-pam: add basic files based on LFS
David Demelier <markand@malikania.fr>
parents: 385
diff changeset
29 etc/pam.d/system-password
30c785bd1da0 security/linux-pam: add basic files based on LFS
David Demelier <markand@malikania.fr>
parents: 385
diff changeset
30 etc/pam.d/system-session
385
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
31 etc/security/access.conf
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
32 etc/security/group.conf
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
33 etc/security/limits.conf
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
34 etc/security/namespace.conf
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 etc/security/namespace.init
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
36 etc/security/pam_env.conf
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
37 etc/security/time.conf"
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
38
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
39 : ${CHOST:=$(uname -m)-linux-musl}
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
40 : ${CBUILD:=$(uname -m)-linux-musl}
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
41 : ${CC:=clang}
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
42 : ${CFLAGS:=-O2}
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
43 : ${LDFLAGS:=}
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
44 : ${LIBS:=}
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
45 : ${NLS:=yes}
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
46 : ${SELINUX:=no}
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
47
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
48 if [ "$NLS" = "yes" ]; then
902
a133976e0783 vanilla: remove all origins, closes #2203
David Demelier <markand@malikania.fr>
parents: 831
diff changeset
49 PKGDEPENDS="gettext $PKGDEPENDS"
385
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
50 with_nls="--enable-nls"
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
51 else
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
52 with_nls="--disable-nls"
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
53 fi
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
54
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
55 if [ "$SELINUX" = "yes" ]; then
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
56 with_selinux="--enable-selinux"
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
57 else
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
58 with_selinux="--disable-selinux"
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
59 fi
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
60
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
61 build()
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
62 {
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
63 rm -rf Linux-PAM-$PKGVERSION
606
25cecc6dca48 vanilla: use POSIX shell and busybox tar
David Demelier <markand@malikania.fr>
parents: 549
diff changeset
64 tar xvf Linux-PAM-$PKGVERSION.tar.xz
25cecc6dca48 vanilla: use POSIX shell and busybox tar
David Demelier <markand@malikania.fr>
parents: 549
diff changeset
65 cd Linux-PAM-$PKGVERSION
385
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
66
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
67 # https://git.alpinelinux.org/aports/tree/main/linux-pam/APKBUILD#n32
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
68 sed -i -e 's/pam_rhosts//g' modules/Makefile.am
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
69
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
70 # https://git.alpinelinux.org/aports/plain/main/linux-pam/musl-fix-pam_exec.patch
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
71 # https://git.alpinelinux.org/aports/plain/main/linux-pam/fix-compat.patch
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
72 patch -p0 < ../musl.patch
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
73
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
74 autoreconf -vif
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
75 CC="$CC" \
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
76 CFLAGS="$CFLAGS" \
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
77 LDFLAGS="$LDFLAGS" \
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
78 LIBS="$LIBS" \
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
79 ./configure \
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
80 --build=$CBUILD \
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
81 --host=$CHOST \
549
bad483aace64 vanilla: use prefix= instead
David Demelier <markand@malikania.fr>
parents: 536
diff changeset
82 --prefix= \
536
adaa1ae0fe9d security: use new FHS
David Demelier <markand@malikania.fr>
parents: 431
diff changeset
83 --sbindir=/bin \
549
bad483aace64 vanilla: use prefix= instead
David Demelier <markand@malikania.fr>
parents: 536
diff changeset
84 --includedir=/include/security \
385
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
85 --disable-db \
536
adaa1ae0fe9d security: use new FHS
David Demelier <markand@malikania.fr>
parents: 431
diff changeset
86 --libdir=/lib \
adaa1ae0fe9d security: use new FHS
David Demelier <markand@malikania.fr>
parents: 431
diff changeset
87 --docdir=/share/doc/linux-pam \
385
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
88 $with_nls \
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
89 $with_selinux
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
90 make
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
91 make install DESTDIR=$DESTDIR
386
30c785bd1da0 security/linux-pam: add basic files based on LFS
David Demelier <markand@malikania.fr>
parents: 385
diff changeset
92 install -Dm0600 ../other $DESTDIR/etc/pam.d/other
30c785bd1da0 security/linux-pam: add basic files based on LFS
David Demelier <markand@malikania.fr>
parents: 385
diff changeset
93 install -Dm0600 ../system-account $DESTDIR/etc/pam.d/system-account
30c785bd1da0 security/linux-pam: add basic files based on LFS
David Demelier <markand@malikania.fr>
parents: 385
diff changeset
94 install -Dm0600 ../system-auth $DESTDIR/etc/pam.d/system-auth
30c785bd1da0 security/linux-pam: add basic files based on LFS
David Demelier <markand@malikania.fr>
parents: 385
diff changeset
95 install -Dm0600 ../system-password $DESTDIR/etc/pam.d/system-password
30c785bd1da0 security/linux-pam: add basic files based on LFS
David Demelier <markand@malikania.fr>
parents: 385
diff changeset
96 install -Dm0600 ../system-session $DESTDIR/etc/pam.d/system-session
817
0e6c54d47dfb vanilla: fix many FHS issues
David Demelier <markand@malikania.fr>
parents: 639
diff changeset
97 find $DESTDIR -type f -name "*.la" -delete
385
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
98
606
25cecc6dca48 vanilla: use POSIX shell and busybox tar
David Demelier <markand@malikania.fr>
parents: 549
diff changeset
99 cd ..
385
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
100 rm -rf Linux-PAM-$PKGVERSION
3b0114bc7438 security/linux-pam: initial import, closes #1483
David Demelier <markand@malikania.fr>
parents:
diff changeset
101 }

mercurial