From d25bf1b9a3a9c2d853769cb529dcb230ab5f6095 Mon Sep 17 00:00:00 2001 From: saltedcoffii <55339220+saltedcoffii@users.noreply.github.com> Date: Fri, 19 Feb 2021 00:32:08 -0500 Subject: [PATCH] [New Package] zoneinfo (#5163) --- packages/zoneinfo.rb | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 packages/zoneinfo.rb diff --git a/packages/zoneinfo.rb b/packages/zoneinfo.rb new file mode 100644 index 000000000..c3ef9245e --- /dev/null +++ b/packages/zoneinfo.rb @@ -0,0 +1,37 @@ +require 'package' + +class Zoneinfo < Package + description 'Code and data that represent the history of local time for many representative locations around the globe.' + homepage 'https://www.iana.org/time-zones' + version '2021a' + compatibility 'all' + source_url 'https://data.iana.org/time-zones/releases/tzdb-2021a.tar.lz' + source_sha256 '21bf125de7b0c486cb57f1ba61b39584c949b2e6cac0a03a6425435d9bff37d0' + + def self.patch + system "sed -i 's:TZDEFAULT = $(TOPDIR)/etc/localtime:TZDEFAULT = #{CREW_PREFIX}/etc/localtime:g' Makefile" + system "sed -i 's:USRDIR = usr:USRDIR = usr/local:g' Makefile" + end + + def self.build + system "make" + end + + def self.install + system "make", "DESTDIR=#{CREW_DEST_DIR}", "install" + end + + def self.check + system "make", "check" + end + + def self.postinstall + system "tzselect" + puts + puts "Add `TZ=''` to your ~/.bashrc file".lightblue + puts "Where is the timezone displayed above".lightblue + puts "e.g. `TZ=America/New_York` or `TZ=Etc/UTC`".lightblue + puts "This won't affect the timezone of non-chromebrew ChromeOS apps." + puts + end +end