1 # Build recipe for tzdb.
3 # Copyright (c) 2017-2022 Matias Fonzo, <selk@dragora.org>.
4 # Copyright (c) 2018 Mateus P. Rodrigues, <mprodrigues@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # Exit immediately on any error
25 # Define a category for the output of the package name
28 tarname=${program}-${version}.tar.lz
31 fetch=https://data.iana.org/time-zones/releases/$tarname
36 The Time Zone Database (often called tz or zoneinfo) contains code and
37 data that represent the history of local time for many representative
38 locations around the globe. It is updated periodically to reflect
39 changes made by political bodies to time zone boundaries, UTC offsets,
40 and daylight-saving rules. Its management procedure is documented in
41 BCP 175: Procedures for Maintaining the Time Zone Database.
44 homepage=https://www.iana.org/time-zones
45 license="Public domain | BSD"
47 # Source documentation
48 docs="CONTRIBUTING LICENSE NEWS README"
49 docsdir="${docdir}/${program}-${version}"
51 # Force parallel jobs to '1'
56 unpack "${tardir}/$tarname"
60 # Set sane permissions
61 chmod -R u+w,go-w,a+rX-s .
63 make -j${jobs} CPPFLAGS="$QICPPFLAGS" \
64 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
68 LIBDIR=/usr/lib${libSuffix} \
71 DESTDIR="$destdir" install
73 # 1. We do not offer 'tzselect'.
74 # 2. To set default localtime.
75 # 3. To be linked via post-install.
77 "${destdir}/usr/bin/tzselect" \
78 "${destdir}/etc/localtime" \
79 "${destdir}/etc/zoneinfo-posix"
81 # Create .nograft to copy via post-installation the time zone files
82 # instead of being linked to the package directory; this is to ensure
83 # that the database is always up to date after a package update. :-)
85 find "${destdir}"/etc/zoneinfo* -type d -print | \
86 while read -r directory
88 ( cd -- "$directory" && touch .nograft )
91 # Compress and link man pages (if needed)
92 if test -d "${destdir}/$mandir"
95 cd "${destdir}/$mandir"
96 find . -type f -exec lzip -9 {} +
97 find . -type l | while read -r file
99 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
106 mkdir -p "${destdir}/$docsdir"
107 cp -p $docs "${destdir}/$docsdir"