mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-05-01 03:00:26 -04:00
41 lines
1.5 KiB
Ruby
41 lines
1.5 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.13'
|
|
license 'Apache-2.0 AND MIT'
|
|
compatibility 'all'
|
|
source_url 'https://github.com/trifectatechfoundation/sudo-rs.git'
|
|
git_hashtag "v#{version}"
|
|
binary_compression 'tar.zst'
|
|
|
|
binary_sha256({
|
|
aarch64: '10d040aeead7ff70abdfcca6230628f9b86add54a2570005f3179c47b8adb53b',
|
|
armv7l: '10d040aeead7ff70abdfcca6230628f9b86add54a2570005f3179c47b8adb53b',
|
|
i686: 'b35ffdf894798a287c01cc7d95c65cf27af736e194fd8d3b825860c96e07339e',
|
|
x86_64: 'af0b303e45466a30d675c31a65653582dddd1d6e24886a7bebbc3ef2506bb221'
|
|
})
|
|
|
|
depends_on 'gcc_lib' => :executable
|
|
depends_on 'glibc' => :executable
|
|
depends_on 'linux_pam' => :executable
|
|
depends_on 'rust' => :build
|
|
|
|
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
|