summaryrefslogtreecommitdiff
path: root/repo/util/sudo.xibuild
blob: 55df72d74ab901d2c0542f42a4705662c9455386 (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
50
#!/bin/sh

MAKEDEPS="make "
DEPS="musl libldap libressl 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

    mkdir -pv $PKG_DEST/etc/pam.d
    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
}