1 # Build recipe for perl.
3 # Copyright (c) 2016-2017 Matias Fonzo, <selk@dragora.org>.
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
21 tarname=${program}-${version}.tar.gz
24 fetch=http://www.cpan.org/src/5.0/$tarname
27 Practical Extraction and Report Language.
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.
34 Perl is a language that combines some of the features of C,
35 sed, awk, and the shell.
37 For more information, visit: http://www.perl.org
40 homepage=http://www.perl.org
41 license="Artistic | GPLv1"
43 # Source documentation
44 docs="AUTHORS Artistic Changes Copying README README.linux"
45 docsdir="${docdir}/${program}-${version}"
51 unpack "${tardir}/$tarname"
55 # Don't use -fstack-protector* (troubles)
56 sed -i 's/-fstack-protector/-fnostack-protector/g' ./Configure
60 -Dinstallprefix=/usr \
61 -Dsiteprefix=/usr/local \
62 -Dprivlib=/usr/share/perl5 \
63 -Darchlib=/usr/lib${libSuffix}/perl5 \
64 -Dsitelib=/usr/local/share/perl5 \
65 -Dsitearch=/usr/local/lib${libSuffix}/perl5 \
67 -Dvendorlib=/usr/share/perl5/vendor_perl \
68 -Dvendorarch=/usr/lib${libSuffix}/perl5/vendor_perl \
69 -Dlibpth="/usr/local/lib${libSuffix} /usr/lib${libSuffix} /lib${libSuffix}" \
70 -Dscriptdir=/usr/bin \
77 -A ldflags="$QILDFLAGS" \
78 -Doptimize="$QICFLAGS" \
79 -Dman1dir="${mandir}/man1" \
80 -Dman3dir="${mandir}/man3" \
81 -Dpager="/usr/bin/less -isR" \
82 BUILD_ZLIB="False" BUILD_BZIP2="0"
84 make -j${jobs} BUILD_ZLIB="False" BUILD_BZIP2="0"
85 make -j${jobs} DESTDIR="$destdir" install
87 # Replace hard links on binaries
89 cd "${destdir}/usr/bin" || exit 1
90 ln -sf perl${version} perl
94 # Replace hard links on manual pages
95 ( cd "${destdir}/${mandir}/man1" && ln -sf c2ph.1 pstruct.1 )
97 # Strip remaining binaries and libraries
98 find "$destdir" -type f | xargs file | \
99 awk '/ELF/ && /executable/ || /shared object/' | \
100 cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
102 find "$destdir" -type f | xargs file | awk '/current ar archive/' | \
103 cut -f 1 -d : | xargs strip --strip-debug 2> /dev/null || true
105 # Compress info documents deleting index file for the package
106 if test -d "${destdir}/$infodir"
108 rm -f "${destdir}/${infodir}/dir"
109 lzip -9 "${destdir}/${infodir}"/*
112 # Compress and link man pages (if needed)
113 if test -d "${destdir}/$mandir"
116 cd "${destdir}/$mandir"
117 find . -type f -exec lzip -9 '{}' +
118 find . -type l | while read -r file
120 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
127 mkdir -p "${destdir}${docsdir}"
128 cp -p $docs "${destdir}${docsdir}"