recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / libs / libxslt / recipe
blobaeacbbe81903626dbcd92985948496237d180b52
1 # Build recipe for libxslt.
3 # Copyright (C) 2018-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=libxslt
21 version=1.1.34
22 release=4
24 # Define a category for the output of the package name
25 pkgcategory=libs
27 tarname=${program}-${version}.tar.gz
29 # Remote source(s)
30 fetch=http://xmlsoft.org/sources/$tarname
32 description="
33 XSLT support for libxml2.
35 The libxslt package contains XSLT libraries.  These are useful for
36 extending libxml2 libraries in order to support XSLT files.
39 homepage=https://xmlsoft.org
40 license=MIT
42 docs="AUTHORS ChangeLog Copyright NEWS README TODO"
43 docsdir="${docdir}/${program}-${version}"
45 # The source has a custom directory
46 srcdir="${program}-${version%-*}"
48 build()
50     unpack "${tardir}/$tarname"
52     cd "$srcdir"
54     # Set sane permissions
55     chmod -R u+w,go-w,a+rX-s .
57     # This increases the recursion limit.  This is
58     # needed by some packages for their documentation
59     sed -e 's/3000/5000/' \
60         -i libxslt/transform.c doc/xsltproc.1 doc/xsltproc.xml
62     ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
63      $configure_args \
64      --libdir=/usr/lib${libSuffix} \
65      --mandir=$mandir \
66      --docdir=$docsdir \
67      --enable-static=no \
68      --enable-shared=yes \
69      --with-python=/usr/bin/python3 \
70      --build="$(gcc -dumpmachine)"
71      
72     make -j${jobs} V=1
73     make -j${jobs} DESTDIR="$destdir" install-strip
75     # Compress and link man pages (if needed)
76     if test -d "${destdir}/$mandir"
77     then
78         (
79             cd "${destdir}/$mandir"
80             find . -type f -exec lzip -9 {} +
81             find . -type l | while read -r file
82             do
83                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
84                 rm -- "$file"
85             done
86         )
87     fi
88      
89     # Copy documentation
90     mkdir -p "${destdir}/$docsdir"
91     cp -p $docs "${destdir}/$docsdir"