1 # Build recipe for tzdb.
3 # Copyright (c) 2017-2020 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.
22 # Define a category for the output of the package name
25 tarname=${program}-${version}.tar.lz
28 fetch=http://www.iana.org/time-zones/repository/releases/$tarname
33 The Time Zone Database (often called tz or zoneinfo) contains code and
34 data that represent the history of local time for many representative
35 locations around the globe. It is updated periodically to reflect
36 changes made by political bodies to time zone boundaries, UTC offsets,
37 and daylight-saving rules. Its management procedure is documented in
38 BCP 175: Procedures for Maintaining the Time Zone Database.
41 homepage=http://www.iana.org/time-zones
42 license="Public domain | BSD"
44 # Source documentation
45 docs="CONTRIBUTING LICENSE NEWS README"
46 docsdir="${docdir}/${program}-${version}"
48 # Force parallel jobs to '1'
55 unpack "${tardir}/$tarname"
59 # Set sane permissions
60 chmod -R u+w,go-w,a+rX-s .
62 make -j${jobs} CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
66 LIBDIR=/usr/lib${libSuffix} \
69 DESTDIR="$destdir" install
71 # 1. We do not offer 'tzselect'.
72 # 2. To set default localtime.
73 # 3. To be linked via post-install.
75 "${destdir}/usr/bin/tzselect" \
76 "${destdir}/etc/localtime" \
77 "${destdir}/etc/zoneinfo-posix"
79 # Create .nograft to copy via post-installation the time zone files
80 # instead of being linked to the package directory; this is to ensure
81 # that the database is always up to date after a package update. :-)
83 find "${destdir}"/etc/zoneinfo* -type d -print | \
84 while read -r directory
86 ( cd -- "$directory" && touch .nograft )
89 # Compress and link man pages (if needed)
90 if test -d "${destdir}/$mandir"
93 cd "${destdir}/$mandir"
94 find . -type f -exec lzip -9 '{}' +
95 find . -type l | while read -r file
97 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
104 mkdir -p "${destdir}${docsdir}"
105 cp -p $docs "${destdir}${docsdir}/"