1 # Build recipe for xml-parser.
3 # Copyright (c) 2017 Mateus P. Rodrigues, <mprodrigues@dragora.org>.
4 # Copyright (c) 2017, 2019 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.
24 # Define a category for the output of the package name
28 A perl module for parsing XML documents.
30 This is a Perl interface to the expat library.
33 homepage=http://search.cpan.org/~toddr/XML-Parser/
34 license="The Perl 5 License"
36 tarname=${program}-${version}.tar.gz
39 fetch=http://cpan.metacpan.org/authors/id/T/TO/TODDR/$tarname
41 # Source documentation
43 docsdir="${docdir}/${pkgname}-${version}"
48 unpack "${tardir}/$tarname"
52 # Set sane permissions
53 chmod -R u+w,go-w,a+rX-s .
55 perl Makefile.PL INSTALLDIRS=vendor
57 make -j${jobs} V=1 docdir=$docsdir
58 make -j${jobs} DESTDIR="$destdir" install
60 # Strip remaining binaries and libraries
61 find "$destdir" -type f | xargs file | \
62 awk '/ELF/ && /executable/ || /shared object/' | \
63 cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
65 # Clean up inventory file for Perl
67 # This line removes 'destdir' adding the suffix '.lz' for manpages
68 find "${destdir}/" -type f -name '.packlist' | while read -r file
71 -e "s|${destdir}||g" \
72 -e "s|\.[0-9][a-z]*|&.lz|g" \
76 find "${destdir}/" -type f -name 'perllocal.pod' -exec rm -f {} +
78 # Compress manual pages
79 if [ -d "${destdir}/$mandir" ] ; then
81 cd "${destdir}/$mandir"
82 find . -type f -exec lzip -9 '{}' +
83 find . -type l | while read -r file
85 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
92 mkdir -p "${destdir}${docsdir}"
93 cp -p $docs "${destdir}${docsdir}/"