summaryrefslogtreecommitdiff
path: root/repo/util/sudo.xibuild
blob: a613ccb150c3c6e2f4175e2c8db1b1a359e73da5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash

MAKEDEPS=(make )
DEPS=(glibc libldap openssl pam zlib)

PKG_VER=1.9.9
SOURCE=https://www.sudo.ws/dist/sudo-$PKG_VER.tar.gz
DESC="Give certain users the ability to run some commands as root"

build () {
    ./configure --prefix=/usr              \
            --libexecdir=/usr/lib      \
            --with-secure-path         \
            --with-all-insults         \
            --with-env-editor          \
            --docdir=/usr/share/doc/sudo-1.9.9 \
            --with-passprompt="[sudo] password for %p: " &&
    make

}

package () {
    make DESTDIR=$PKG_DEST install &&
    ln -sfv libsudo_util.so.0.0.0 $PKG_DEST/usr/lib/sudo/libsudo_util.so.0

    cat > $PKG_DEST/etc/sudoers.d/00-sudo << "EOF"
Defaults secure_path="/usr/sbin:/usr/bin"
%wheel ALL=(ALL) ALL
EOF

    cat > $PKG_DEST/etc/pam.d/sudo << "EOF"
# Begin /etc/pam.d/sudo

# include the default auth settings
auth      include     system-auth

# include the default account settings
account   include     system-account

# Set default environment variables for the service user
session   required    pam_env.so

# include system session defaults
session   include     system-session

# End /etc/pam.d/sudo
EOF
    chmod 644 $PKG_DEST/etc/pam.d/sudo
}