Files
chromebrew/packages/tuptime.rb
Ed Reel 6fd797919a Tuptime 5.2.3 => 5.2.4 (#10697)
Co-authored-by: Satadru Pramanik, DO, MPH, MEng <satadru@gmail.com>
2024-11-02 01:51:14 +00:00

37 lines
1.0 KiB
Ruby

require 'package'
class Tuptime < Package
description 'Report historical and statistical real time of the system, keeping it between restarts.'
homepage 'https://github.com/rfmoz/tuptime'
version '5.2.4'
license 'GPL-2.0'
compatibility 'all'
source_url 'https://github.com/rfmoz/tuptime.git'
git_hashtag version
no_compile_needed
def self.patch
system "sed -i 's,/var/lib,#{CREW_PREFIX}/var/lib,' src/tuptime"
end
def self.install
FileUtils.install 'src/tuptime', "#{CREW_DEST_PREFIX}/bin/tuptime", mode: 0o755
end
def self.postremove
config_dir = "#{CREW_PREFIX}/var/lib/tuptime"
if Dir.exist? config_dir
puts "WARNING: This will remove #{CREW_PREFIX}/var/lib/tuptime/tuptime.db and all your history.".orange
print "Would you like to remove the #{config_dir} directory? [y/N] "
case $stdin.gets.chomp.downcase
when 'y', 'yes'
FileUtils.rm_rf config_dir
puts "#{config_dir} removed.".lightgreen
else
puts "#{config_dir} saved.".lightgreen
end
end
end
end