recipes: x-apps/emacs: Enable emacs again, trying the -no-pie option
[dragora.git] / recipes / perl / xml-sax-base / recipe
blob2ed13ac0e4b7260016683b8fe84dd1da8d39dd7f
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
18 set -e
20 program=XML-SAX-Base
21 version=1.09
22 release=1
24 pkgname=perl-xml-sax-base
26 # Define a category for the output of the package name
27 pkgcategory=perl
29 description="
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
37 to install XML::SAX.
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
41 XML::SAX.
44 homepage=https://metacpan.org/release/XML-SAX-Base
45 license="The Perl 5 License"
47 tarname=${program}-${version}.tar.gz
49 # Remote source(s)
50 fetch=https://cpan.metacpan.org/authors/id/G/GR/GRANTM/$tarname
52 # Source documentation
53 docs="Changes README"
54 docsdir="${docdir}/${pkgname}-${version}"
56 build() {
57     unpack "${tardir}/$tarname"
59     cd "$srcdir"
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
78     do
79          sed -i \
80           -e "s|${destdir}||g" \
81           -e "s|\.[0-9][a-z]*|&.lz|g" \
82           $file
83     done
85     find "${destdir}/" -type f -name 'perllocal.pod' -exec rm -f {} +
87     # Compress manual pages
88     if [ -d "${destdir}/$mandir" ] ; then
89         (
90             cd "${destdir}/$mandir"
91             find . -type f -exec lzip -9 {} +
92             find . -type l | while read -r file
93             do
94                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
95                 rm -- "$file"
96             done
97         )
98     fi
100     # Copy documentation
101     mkdir -p "${destdir}/$docsdir"
102     cp -p $docs "${destdir}/$docsdir"