|
| 1 | +# Template file for 'sudo-rs' |
| 2 | +pkgname=sudo-rs |
| 3 | +version=0.2.13 |
| 4 | +revision=1 |
| 5 | +build_style=cargo |
| 6 | +make_build_args="--bin sudo --bin visudo --features gettext" |
| 7 | +make_install_args="--path . --bin sudo --bin visudo --features gettext" |
| 8 | +hostmakedepends="gettext pkg-config" |
| 9 | +makedepends="pam-devel" |
| 10 | +short_desc="Memory-safe implementation of sudo" |
| 11 | +maintainer="Nafis <mnabid.25@outlook.com>" |
| 12 | +license="Apache-2.0 OR MIT" |
| 13 | +homepage="https://github.com/trifectatechfoundation/sudo-rs" |
| 14 | +distfiles="${homepage}/archive/refs/tags/v${version}.tar.gz" |
| 15 | +checksum=79becefc504d14ffccc7cab18d42f8d892e78b2d13d9c5bb887c5f02a2721eaf |
| 16 | +conf_files="/etc/pam.d/sudo /etc/sudoers" |
| 17 | +conflicts="sudo" |
| 18 | +replaces="sudo>=0" |
| 19 | + |
| 20 | +make_check=no # tests fail in chroot |
| 21 | + |
| 22 | +# Failed tests: |
| 23 | +# common::context::tests::test_build_run_context |
| 24 | +# common::resolve::test::canonicalization |
| 25 | +# su::context::tests::invalid_shell |
| 26 | +# sudo::env::environment::tests::test_tzinfo |
| 27 | +# system::audit::test::secure_open_is_predictable |
| 28 | +# system::audit::test::test_traverse_secure_open_negative |
| 29 | +# system::audit::test::test_traverse_secure_open_positive |
| 30 | +# system::interface::test::test_unix_user |
| 31 | +# system::tests::test_get_user_and_group_by_id |
| 32 | + |
| 33 | +post_install() { |
| 34 | + # Install man pages |
| 35 | + vman docs/man/sudo.8.man sudo.8 |
| 36 | + vman docs/man/sudoers.5.man sudoers.5 |
| 37 | + vman docs/man/visudo.8.man visudo.8 |
| 38 | + |
| 39 | + # Install sudoers and PAM config |
| 40 | + vinstall ${FILESDIR}/sudoers.example 440 etc sudoers |
| 41 | + vinstall ${FILESDIR}/sudoers.example 664 usr/share/examples/sudo-rs |
| 42 | + vinstall ${FILESDIR}/sudo.pam 644 etc/pam.d sudo |
| 43 | + |
| 44 | + # Set setuid permission on sudo binary |
| 45 | + chmod 4755 ${DESTDIR}/usr/bin/sudo |
| 46 | + |
| 47 | + # Create sudoedit symlink pointing to sudo |
| 48 | + ln -s sudo ${DESTDIR}/usr/bin/sudoedit |
| 49 | + ln -s sudo.8 ${DESTDIR}/usr/share/man/man8/sudoedit.8 |
| 50 | + |
| 51 | + # Install translations |
| 52 | + for po in po/*.po; do |
| 53 | + if [ -f "${po}" ]; then |
| 54 | + lang=$(basename "${po}" .po) |
| 55 | + dir="${DESTDIR}/usr/share/locale/${lang}/LC_MESSAGES" |
| 56 | + install -d "${dir}" |
| 57 | + msgfmt -o "${dir}/sudo-rs.mo" "${po}" |
| 58 | + fi |
| 59 | + done |
| 60 | + |
| 61 | + vlicense LICENSE-APACHE |
| 62 | + vlicense LICENSE-MIT |
| 63 | +} |
0 commit comments