recipe 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Build recipe for tzdb.
  2. #
  3. # Copyright (c) 2017-2021 Matias Fonzo, <selk@dragora.org>.
  4. # Copyright (c) 2018 Mateus P. Rodrigues, <mprodrigues@dragora.org>.
  5. #
  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
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  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.
  17. # Exit immediately on any error
  18. set -e
  19. program=tzdb
  20. version=2021e
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=db
  24. tarname=${program}-${version}.tar.lz
  25. # Remote source(s)
  26. fetch=https://www.iana.org/time-zones/repository/releases/$tarname
  27. description="
  28. Time zone database.
  29. The Time Zone Database (often called tz or zoneinfo) contains code and
  30. data that represent the history of local time for many representative
  31. locations around the globe. It is updated periodically to reflect
  32. changes made by political bodies to time zone boundaries, UTC offsets,
  33. and daylight-saving rules. Its management procedure is documented in
  34. BCP 175: Procedures for Maintaining the Time Zone Database.
  35. "
  36. homepage=https://www.iana.org/time-zones
  37. license="Public domain | BSD"
  38. # Source documentation
  39. docs="CONTRIBUTING LICENSE NEWS README"
  40. docsdir="${docdir}/${program}-${version}"
  41. # Force parallel jobs to '1'
  42. jobs=1
  43. build()
  44. {
  45. unpack "${tardir}/$tarname"
  46. cd "$srcdir"
  47. # Set sane permissions
  48. chmod -R u+w,go-w,a+rX-s .
  49. make -j${jobs} CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
  50. TOPDIR=/ \
  51. TZDIR=/etc/zoneinfo \
  52. ETCDIR=/usr/sbin \
  53. LIBDIR=/usr/lib${libSuffix} \
  54. MANDIR=$mandir \
  55. KSHELL="/bin/sh -" \
  56. DESTDIR="$destdir" install
  57. # 1. We do not offer 'tzselect'.
  58. # 2. To set default localtime.
  59. # 3. To be linked via post-install.
  60. rm -f \
  61. "${destdir}/usr/bin/tzselect" \
  62. "${destdir}/etc/localtime" \
  63. "${destdir}/etc/zoneinfo-posix"
  64. # Create .nograft to copy via post-installation the time zone files
  65. # instead of being linked to the package directory; this is to ensure
  66. # that the database is always up to date after a package update. :-)
  67. find "${destdir}"/etc/zoneinfo* -type d -print | \
  68. while read -r directory
  69. do
  70. ( cd -- "$directory" && touch .nograft )
  71. done
  72. # Compress and link man pages (if needed)
  73. if test -d "${destdir}/$mandir"
  74. then
  75. (
  76. cd "${destdir}/$mandir"
  77. find . -type f -exec lzip -9 {} +
  78. find . -type l | while read -r file
  79. do
  80. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  81. rm -- "$file"
  82. done
  83. )
  84. fi
  85. # Copy documentation
  86. mkdir -p "${destdir}/$docsdir"
  87. cp -p $docs "${destdir}/$docsdir"
  88. }