recipe 3.6 KB

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