-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathtemplate
More file actions
63 lines (55 loc) · 1.98 KB
/
template
File metadata and controls
63 lines (55 loc) · 1.98 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
# Template file for 'sudo-rs'
pkgname=sudo-rs
version=0.2.13
revision=1
build_style=cargo
make_build_args="--bin sudo --bin visudo --features gettext"
make_install_args="--path . --bin sudo --bin visudo --features gettext"
hostmakedepends="gettext pkg-config"
makedepends="pam-devel"
short_desc="Memory-safe implementation of sudo"
maintainer="Nafis <mnabid.25@outlook.com>"
license="Apache-2.0 OR MIT"
homepage="https://github.com/trifectatechfoundation/sudo-rs"
distfiles="${homepage}/archive/refs/tags/v${version}.tar.gz"
checksum=79becefc504d14ffccc7cab18d42f8d892e78b2d13d9c5bb887c5f02a2721eaf
conf_files="/etc/pam.d/sudo /etc/sudoers"
conflicts="sudo"
replaces="sudo>=0"
make_check=no # tests fail in chroot
# Failed tests:
# common::context::tests::test_build_run_context
# common::resolve::test::canonicalization
# su::context::tests::invalid_shell
# sudo::env::environment::tests::test_tzinfo
# system::audit::test::secure_open_is_predictable
# system::audit::test::test_traverse_secure_open_negative
# system::audit::test::test_traverse_secure_open_positive
# system::interface::test::test_unix_user
# system::tests::test_get_user_and_group_by_id
post_install() {
# Install man pages
vman docs/man/sudo.8.man sudo.8
vman docs/man/sudoers.5.man sudoers.5
vman docs/man/visudo.8.man visudo.8
# Install sudoers and PAM config
vinstall ${FILESDIR}/sudoers.example 440 etc sudoers
vinstall ${FILESDIR}/sudoers.example 664 usr/share/examples/sudo-rs
vinstall ${FILESDIR}/sudo.pam 644 etc/pam.d sudo
# Set setuid permission on sudo binary
chmod 4755 ${DESTDIR}/usr/bin/sudo
# Create sudoedit symlink pointing to sudo
ln -s sudo ${DESTDIR}/usr/bin/sudoedit
ln -s sudo.8 ${DESTDIR}/usr/share/man/man8/sudoedit.8
# Install translations
for po in po/*.po; do
if [ -f "${po}" ]; then
lang=$(basename "${po}" .po)
dir="${DESTDIR}/usr/share/locale/${lang}/LC_MESSAGES"
install -d "${dir}"
msgfmt -o "${dir}/sudo-rs.mo" "${po}"
fi
done
vlicense LICENSE-APACHE
vlicense LICENSE-MIT
}