1 # Build recipe for xml-sax-base.
3 # Copyright (c) 2019, 2021 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.
17 # Exit immediately on any error
24 pkgname=perl-xml-sax-base
26 # Define a category for the output of the package name
30 Base class SAX drivers and filters.
32 XML::SAX::Base is intended for use as a base class for SAX filter
33 modules and XML parsers generating SAX events.
35 If you simply wish to build a SAX handler class to 'consume' SAX events
36 you do not need to use XML::SAX::Base directly although you will need
39 This module used to be distributed as part of the XML:SAX distribution
40 but is now distributed separately and referenced as a dependency by
44 homepage=https://metacpan.org/release/XML-SAX-Base
45 license="The Perl 5 License"
47 tarname=${program}-${version}.tar.gz
50 fetch=https://cpan.metacpan.org/authors/id/G/GR/GRANTM/$tarname
52 # Source documentation
54 docsdir="${docdir}/${pkgname}-${version}"
57 unpack "${tardir}/$tarname"
61 # Set sane permissions
62 chmod -R u+w,go-w,a+rX-s .
64 perl Makefile.PL INSTALLDIRS=vendor
66 make -j${jobs} V=1 docdir=$docsdir
67 make -j${jobs} DESTDIR="$destdir" install
69 # Strip remaining binaries and libraries
70 find "$destdir" -type f | xargs file | \
71 awk '/ELF/ && /executable/ || /shared object/' | \
72 cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
74 # Clean up inventory file for Perl
76 # This line removes 'destdir' adding the suffix '.lz' for manpages
77 find "${destdir}/" -type f -name '.packlist' | while read -r file
80 -e "s|${destdir}||g" \
81 -e "s|\.[0-9][a-z]*|&.lz|g" \
85 find "${destdir}/" -type f -name 'perllocal.pod' -exec rm -f {} +
87 # Compress manual pages
88 if [ -d "${destdir}/$mandir" ] ; then
90 cd "${destdir}/$mandir"
91 find . -type f -exec lzip -9 {} +
92 find . -type l | while read -r file
94 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
101 mkdir -p "${destdir}/$docsdir"
102 cp -p $docs "${destdir}/$docsdir"