mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-05-01 03:00:26 -04:00
40 lines
1.4 KiB
Ruby
40 lines
1.4 KiB
Ruby
# Adapted from Arch Linux sudo-rs PKGBUILD at:
|
|
# https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=sudo-rs
|
|
|
|
require 'buildsystems/rust'
|
|
|
|
class Sudo_rs < RUST
|
|
description 'A safety oriented and memory safe implementation of sudo and su written in Rust.'
|
|
homepage 'https://github.com/trifectatechfoundation/sudo-rs'
|
|
version '0.2.8-1'
|
|
license 'Apache-2.0 AND MIT'
|
|
compatibility 'all'
|
|
source_url 'https://github.com/trifectatechfoundation/sudo-rs.git'
|
|
git_hashtag "v#{version.split('-').first}"
|
|
binary_compression 'tar.zst'
|
|
|
|
binary_sha256({
|
|
aarch64: 'ccfd2bc0430d54ea43d7c5cf4080d194f2773d90d57719d48fc929e1e7a1324b',
|
|
armv7l: 'ccfd2bc0430d54ea43d7c5cf4080d194f2773d90d57719d48fc929e1e7a1324b',
|
|
i686: '3ddaaea73a4c2fb4c90f8d8a5083fc26c656313d1bb2b383afeb9681f467e9ab',
|
|
x86_64: '9cced4f75b7d9166a547aa2f608fef45f5267bc686071e72fc5563708bd80dd6'
|
|
})
|
|
|
|
depends_on 'gcc_lib' # R
|
|
depends_on 'glibc' # R
|
|
depends_on 'linux_pam' # R
|
|
|
|
conflicts_ok # su conflict with util_linux
|
|
|
|
rust_features 'pam-login'
|
|
|
|
def self.postinstall
|
|
puts 'Installation of sudo_rs will fail unless in the Chromebrew container or crew_sudo has been installed.'.orange unless CREW_IN_CONTAINER
|
|
|
|
%w[su sudo visudo].each do |bin|
|
|
system "/usr/bin/sudo chown root:root #{CREW_PREFIX}/bin/#{bin}", exception: false
|
|
system "/usr/bin/sudo chmod 4755 #{CREW_PREFIX}/bin/#{bin}", exception: false
|
|
end
|
|
end
|
|
end
|