1 # Build recipe for xml-parser.
3 # Copyright (c) 2017 Mateus P. Rodrigues, <mprodrigues@dragora.org>.
4 # Copyright (c) 2017 Matias Fonzo, <selk@dragora.org>.
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
10 # http://www.apache.org/licenses/LICENSE-2.0
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.
23 A perl module for parsing XML documents.
25 This is a Perl interface to the expat library.
28 homepage=http://search.cpan.org/~toddr/XML-Parser/
29 license="The Perl 5 License"
31 tarname=${program}-${version}.tar.gz
34 fetch=http://search.cpan.org/CPAN/authors/id/T/TO/TODDR/$tarname
38 # Source documentation
40 docsdir="${docdir}/${program}-${version}"
45 unpack "${tardir}/$tarname"
49 perl Makefile.PL INSTALLDIRS=vendor
51 make -j${jobs} V=1 docdir=$docsdir
52 make -j${jobs} DESTDIR="$destdir" install
54 # Strip remaining binaries and libraries
55 find "$destdir" -type f | xargs file | \
56 awk '/ELF/ && /executable/ || /shared object/' | \
57 cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
59 # Clean up inventory file for Perl
61 # This line removes 'destdir' adding the suffix '.lz' for manpages
62 find "${destdir}/" -type f -name '.packlist' | while read -r file
65 -e "s|${destdir}||g" \
66 -e "s|\.[0-9][a-z]*|&.lz|g" \
70 find "${destdir}/" -type f -name 'perllocal.pod' -exec rm -f {} +
72 # Compress manual pages
73 if [ -d "${destdir}/$mandir" ] ; then
75 cd "${destdir}/$mandir"
76 find . -type f -exec lzip -9 '{}' +
77 find . -type l | while read -r file
79 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
86 mkdir -p "${destdir}${docsdir}"
87 cp -p $docs "${destdir}${docsdir}/"