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