recipe 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # Build recipe for gettext.
  2. #
  3. # Copyright (c) 2016-2017 Matias Fonzo, <selk@dragora.org>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. program=gettext
  17. version=0.19.8.1
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/tools"
  21. tarname=${program}-${version}.tar.lz
  22. # Remote source(s)
  23. fetch=http://ftp.gnu.org/pub/gnu/gettext/$tarname
  24. description="
  25. Utilities for internationalization and localization.
  26. The Gettext package contains utilities for internationalization and
  27. localization. These allow programs to be compiled with NLS (Native
  28. Language Support), enabling them to output messages in the user's
  29. native language.
  30. "
  31. homepage=http://www.gnu.org/software/gettext
  32. license="GPLv3+, LGPLv2.1"
  33. # Source documentation
  34. docsdir="${docdir}/${program}-${version}"
  35. build()
  36. {
  37. set -e
  38. unpack "${tardir}/$tarname"
  39. cd "$srcdir"
  40. # Set sane permissions
  41. chmod -R u+w,go-w,a+rX-s .
  42. ./configure \
  43. CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
  44. $configure_args \
  45. --libdir=/usr/lib${libSuffix} \
  46. --infodir=$infodir \
  47. --mandir=$mandir \
  48. --docdir=$docsdir \
  49. --with-bzip2 \
  50. --without-git \
  51. --without-xz \
  52. --build="$(cc -dumpmachine)"
  53. make -j${jobs} V=1
  54. make -j${jobs} DESTDIR="$destdir" install-strip
  55. # Fix library permission if needed
  56. if test -f "${destdir}/usr/lib${libSuffix}/preloadable_libintl.so"
  57. then
  58. chmod 755 "${destdir}/usr/lib${libSuffix}/preloadable_libintl.so"
  59. fi
  60. # Remove generated charset.alias
  61. rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
  62. # Compress info documents deleting index file for the package
  63. if test -d "${destdir}/$infodir"
  64. then
  65. rm -f "${destdir}/${infodir}/dir"
  66. lzip -9 "${destdir}/${infodir}"/*
  67. fi
  68. # Compress and link man pages (if needed)
  69. if test -d "${destdir}/$mandir"
  70. then
  71. (
  72. cd "${destdir}/$mandir"
  73. find . -type f -exec lzip -9 '{}' +
  74. find . -type l | while read -r file
  75. do
  76. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  77. rm -- "$file"
  78. done
  79. )
  80. fi
  81. }