recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / perl / xml-sax_base / recipe
blobc8f554059f3bdce0212bc119360859ff3e9f4e01
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.
17 program=XML-SAX-Base
18 version=1.09
19 release=1
21 pkgname=xml-sax_base
23 # Define a category for the output of the package name
24 pkgcategory=perl
26 description="
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
34 to install XML::SAX.
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
38 XML::SAX.
41 homepage=http://metacpan.org/release/XML-SAX-Base
42 license="The Perl 5 License"
44 tarname=${program}-${version}.tar.gz
46 # Remote source(s)
47 fetch=http://cpan.metacpan.org/authors/id/G/GR/GRANTM/$tarname
49 # Source documentation
50 docs="Changes README"
51 docsdir="${docdir}/${pkgname}-${version}"
53 build() {
54     set -e
56     unpack "${tardir}/$tarname"
58     cd "$srcdir"
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
77     do
78          sed -i \
79           -e "s|${destdir}||g" \
80           -e "s|\.[0-9][a-z]*|&.lz|g" \
81           $file
82     done
84     find "${destdir}/" -type f -name 'perllocal.pod' -exec rm -f {} +
86     # Compress manual pages
87     if [ -d "${destdir}/$mandir" ] ; then
88         (
89             cd "${destdir}/$mandir"
90             find . -type f -exec lzip -9 '{}' +
91             find . -type l | while read -r file
92             do
93                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
94                 rm -- "$file"
95             done
96         )
97     fi
99     # Copy documentation
100     mkdir -p "${destdir}${docsdir}"
101     cp -p $docs "${destdir}${docsdir}/"