/
tzdata.spec
71 lines (62 loc) · 1.8 KB
/
tzdata.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Summary: Time zone and daylight-saving time data
Name: tzdata
%define tzversion 2024a
Version: %{tzversion}+git1
Release: 1
License: Public Domain
URL: https://www.iana.org/time-zones
Source0: %{name}%{tzversion}.tar.gz
BuildRequires: fdupes
BuildRequires: glibc-common
BuildArch: noarch
%description
This package contains data required for the implementation of
standard local time for many representative locations around the
globe. It is updated periodically to reflect changes made by
political bodies to time zone boundaries, UTC offsets, and
daylight-saving rules.
%prep
%setup -q -c
%build
# The build setup is adapted from Ubuntu tzdata package version
# 2012e-0ubuntu0.12.04.1
TIMEZONES="africa \
antarctica \
asia \
australasia \
europe \
northamerica \
southamerica \
etcetera \
factory \
backward"
# Build the "default" version
for zone in $TIMEZONES; do \
/usr/sbin/zic -d tzgen -L /dev/null ${zone}
done
# Build the "posix" and "right" versions
for zone in $TIMEZONES; do
/usr/sbin/zic -d tzgen/posix -L /dev/null ${zone}
/usr/sbin/zic -d tzgen/right -L leapseconds ${zone}
done
# Generate a posixrules file
/usr/sbin/zic -d tzgen -p America/New_York
%install
rm -fr $RPM_BUILD_ROOT
install -d %{buildroot}%{_datadir}/zoneinfo
cp -prd tzgen/* %{buildroot}%{_datadir}/zoneinfo
install -m 644 iso3166.tab %{buildroot}%{_datadir}/zoneinfo
install -m 644 zone.tab %{buildroot}%{_datadir}/zoneinfo
install -m 644 zone1970.tab %{buildroot}%{_datadir}/zoneinfo
# Deduplicate files, use hardlinks here, see JB#52707
fdupes -1 -q -r %{buildroot}%{_datadir}/zoneinfo | while read line ; do
set -- ${line}
while [ "$#" -ge 2 ] ; do
ln -f "$1" "$2"
shift
done
done
%files
%defattr(-,root,root)
%license LICENSE
%{_datadir}/zoneinfo