recipe 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. # Build recipe for perl.
  2. #
  3. # Copyright (c) 2016-2022 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. # Exit immediately on any error
  17. set -e
  18. program=perl
  19. pkgname=perl5
  20. version=5.32.1
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=perl
  24. tarname=${program}-${version}.tar.gz
  25. # Remote source(s)
  26. fetch=https://www.cpan.org/src/5.0/$tarname
  27. description="
  28. Practical Extraction and Report Language (version $version).
  29. Perl 5 is a highly capable, feature-rich programming language with over
  30. 29 years of development. Perl 5 runs on over 100 platforms from
  31. portables to mainframes and is suitable for both rapid prototyping
  32. and large scale development projects.
  33. Perl is a language that combines some of the features of C,
  34. sed, awk, and the shell.
  35. For more information, visit: https://www.perl.org
  36. "
  37. homepage=https://www.perl.org
  38. license="Artistic | GPLv1"
  39. # Source documentation
  40. docs="AUTHORS Artistic Changes Copying README README.linux"
  41. docsdir="${docdir}/${pkgname}"
  42. # Limit parallel jobs to '1' due to perl-cross-static
  43. jobs=1
  44. # Limit package name to the program name
  45. full_pkgname="${program}@${pkgcategory}"
  46. build()
  47. {
  48. unpack "${tardir}/$tarname"
  49. cd "$srcdir"
  50. # Set sane permissions
  51. chmod -R u+w,go-w,a+rX-s .
  52. ./Configure -de \
  53. -Dprefix=/usr \
  54. -Dinstallprefix=/usr \
  55. -Dsiteprefix=/usr/local \
  56. -Dprivlib=/usr/share/perl5 \
  57. -Darchlib=/usr/lib${libSuffix}/perl5 \
  58. -Dsitelib=/usr/local/share/perl5 \
  59. -Dsitearch=/usr/local/lib${libSuffix}/perl5 \
  60. -Dvendorprefix=/usr \
  61. -Dvendorlib=/usr/share/perl5/vendor_perl \
  62. -Dvendorarch=/usr/lib${libSuffix}/perl5/vendor_perl \
  63. -Dlibpth="/usr/local/lib${libSuffix} /usr/lib${libSuffix} /lib${libSuffix}" \
  64. -Dscriptdir=/usr/bin \
  65. -Duseshrplib \
  66. -Dusethreads \
  67. -Ubincompat5005 \
  68. -Uversiononly \
  69. -Duselargefiles \
  70. -Dusemymalloc=n \
  71. -Dldflags="$QILDFLAGS" \
  72. -Doptimize="$QICFLAGS" \
  73. -Dman1dir="${mandir}/man1" \
  74. -Dman3dir="${mandir}/man3" \
  75. -Dpager="/usr/bin/less -isR" \
  76. BUILD_ZLIB="False" BUILD_BZIP2="0"
  77. make -j${jobs} BUILD_ZLIB="False" BUILD_BZIP2="0"
  78. make -j${jobs} DESTDIR="$destdir" install
  79. # Strip remaining binaries and libraries
  80. find "$destdir" -type f | xargs file | \
  81. awk '/ELF/ && /executable/ || /shared object/' | \
  82. cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  83. find "$destdir" -type f | xargs file | awk '/current ar archive/' | \
  84. cut -f 1 -d : | xargs strip --strip-debug 2> /dev/null || true
  85. # Compress info documents deleting index file for the package
  86. if test -d "${destdir}/$infodir"
  87. then
  88. rm -f "${destdir}/${infodir}/dir"
  89. lzip -9 "${destdir}/${infodir}"/*
  90. fi
  91. # Compress and link man pages (if needed)
  92. if test -d "${destdir}/$mandir"
  93. then
  94. (
  95. cd "${destdir}/$mandir"
  96. find . -type f -exec lzip -9 {} +
  97. find . -type l | while read -r file
  98. do
  99. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  100. rm -- "$file"
  101. done
  102. )
  103. fi
  104. # Copy documentation
  105. mkdir -p "${destdir}/$docsdir"
  106. cp -p $docs "${destdir}/$docsdir"
  107. }