recipe 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. # Build recipe for tzdb.
  2. #
  3. # Copyright (c) 2017-2023 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=2023c
  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://data.iana.org/time-zones/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" \
  50. CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
  51. TOPDIR=/ \
  52. TZDIR=/etc/zoneinfo \
  53. ETCDIR=/usr/sbin \
  54. LIBDIR=/usr/lib${libSuffix} \
  55. MANDIR=$mandir \
  56. KSHELL="/bin/sh -" \
  57. DESTDIR="$destdir" install
  58. # 1. We do not offer 'tzselect'.
  59. # 2. To set default localtime.
  60. # 3. To be linked via post-install.
  61. rm -f \
  62. "${destdir}/usr/bin/tzselect" \
  63. "${destdir}/etc/localtime" \
  64. "${destdir}/etc/zoneinfo-posix"
  65. # Create .nograft to copy via post-installation the time zone files
  66. # instead of being linked to the package directory; this is to ensure
  67. # that the database is always up to date after a package update. :-)
  68. find "${destdir}"/etc/zoneinfo* -type d -print | \
  69. while read -r directory
  70. do
  71. ( cd -- "$directory" && touch .nograft )
  72. done
  73. # Compress and link man pages (if needed)
  74. if test -d "${destdir}/$mandir"
  75. then
  76. (
  77. cd "${destdir}/$mandir"
  78. find . -type f -exec lzip -9 {} +
  79. find . -type l | while read -r file
  80. do
  81. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  82. rm -- "$file"
  83. done
  84. )
  85. fi
  86. # Copy documentation
  87. mkdir -p "${destdir}/$docsdir"
  88. cp -p $docs "${destdir}/$docsdir"
  89. }