comparison security/linux-pam/linux-pam.sh @ 385:3b0114bc7438

security/linux-pam: initial import, closes #1483
author David Demelier <markand@malikania.fr>
date Mon, 01 Apr 2019 20:10:00 +0200
parents
children 30c785bd1da0
comparison
equal deleted inserted replaced
384:df76922c2bf0 385:3b0114bc7438
1 #!/bin/sh
2 #
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr>
4 #
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
8 #
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 #
17
18 PKGNAME=linux-pam
19 PKGVERSION=1.3.1
20 PKGREVISION=1
21 PKGLICENSE="BSD"
22 PKGSUMMARY="pluggable authentication modules"
23 PKGDOWNLOAD="https://github.com/linux-pam/linux-pam/releases/download/v$PKGVERSION/Linux-PAM-$PKGVERSION.tar.xz"
24 PKGOPTIONS="NLS SELINUX"
25 PKGPROTECT="etc/environment
26 etc/security/access.conf
27 etc/security/group.conf
28 etc/security/limits.conf
29 etc/security/namespace.conf
30 etc/security/namespace.init
31 etc/security/pam_env.conf
32 etc/security/time.conf"
33
34 : ${CHOST:=$(uname -m)-linux-musl}
35 : ${CBUILD:=$(uname -m)-linux-musl}
36 : ${CC:=clang}
37 : ${CFLAGS:=-O2}
38 : ${LDFLAGS:=}
39 : ${LIBS:=}
40 : ${NLS:=yes}
41 : ${SELINUX:=no}
42
43 if [ "$NLS" = "yes" ]; then
44 PKGDEPENDS="core/gettext $PKGDEPENDS"
45 with_nls="--enable-nls"
46 else
47 with_nls="--disable-nls"
48 fi
49
50 if [ "$SELINUX" = "yes" ]; then
51 with_selinux="--enable-selinux"
52 else
53 with_selinux="--disable-selinux"
54 fi
55
56 build()
57 {
58 rm -rf Linux-PAM-$PKGVERSION
59 tar xvaf Linux-PAM-$PKGVERSION.tar.xz
60 pushd Linux-PAM-$PKGVERSION
61
62 # https://git.alpinelinux.org/aports/tree/main/linux-pam/APKBUILD#n32
63 sed -i -e 's/pam_rhosts//g' modules/Makefile.am
64
65 # https://git.alpinelinux.org/aports/plain/main/linux-pam/musl-fix-pam_exec.patch
66 # https://git.alpinelinux.org/aports/plain/main/linux-pam/fix-compat.patch
67 patch -p0 < ../musl.patch
68
69 autoreconf -vif
70 CC="$CC" \
71 CFLAGS="$CFLAGS" \
72 LDFLAGS="$LDFLAGS" \
73 LIBS="$LIBS" \
74 ./configure \
75 --build=$CBUILD \
76 --host=$CHOST \
77 --prefix=/usr \
78 --sbindir=/usr/sbin \
79 --disable-db \
80 --libdir=/usr/lib \
81 --docdir=/usr/share/doc/linux-pam \
82 $with_nls \
83 $with_selinux
84 make
85 make install DESTDIR=$DESTDIR
86 rm -f $DESTDIR/usr/lib/libpam{,c,_misc}.la
87 rm -f $DESTDIR/usr/lib/security/pam*.la
88
89 popd
90 rm -rf Linux-PAM-$PKGVERSION
91 }