sources: SOURCELIST.txt: sort list
[dragora.git] / recipes / libs / libxml2 / recipe
blobe9f365e82038641fcc5f2ab96da2913784491d74
1 # Build recipe for libxml2.
3 # Copyright (C) 2018, MMPG <mmpg@vp.pl>
4 # Copyright (C) 2018, 2019 Matias Fonzo <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 #    http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 program=libxml2
19 version=2.9.9
20 pkgversion="$(echo $version | tr - _)"
21 release=1
23 # Set 'outdir' for a nice and well-organized output directory
24 outdir="${outdir}/${arch}/libs"
26 tarname=${program}-${version}.tar.gz
28 # Remote source(s)
29 fetch=http://xmlsoft.org/sources/$tarname
31 description="
32 A XML C parser library and toolkit.
34 XML itself is a meta language to design markup languages.  HTML is the
35 most well-known markup language.  Though the library is written in C,
36 a variety of language bindings make it available in other environments.
39 homepage=http://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     set -e
51     unpack "${tardir}/$tarname"
53     cd "$srcdir"
55     # Set sane permissions
56     chmod -R u+w,go-w,a+rX-s .
58     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
59      $configure_args \
60      --libdir=/usr/lib${libSuffix} \
61      --infodir=$infodir \
62      --mandir=$mandir \
63      --docdir=$docsdir \
64      --enable-static=no \
65      --enable-shared=yes \
66      --with-python=/usr/bin/python3 \
67      --with-history \
68      --without-lzma \
69      --build="$(cc -dumpmachine)"
70      
71     make -j${jobs} V=1
72     make -j${jobs} DESTDIR="$destdir" install-strip
74     # Compress info documents deleting index file for the package
75     if test -d "${destdir}/$infodir"
76     then
77         rm -f "${destdir}/${infodir}/dir"
78         lzip -9 "${destdir}/${infodir}"/*
79     fi
81     # Compress and link man pages (if needed)
82     if test -d "${destdir}/$mandir"
83     then
84         (
85             cd "${destdir}/$mandir"
86             find . -type f -exec lzip -9 '{}' +
87             find . -type l | while read -r file
88             do
89                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
90                 rm -- "$file"
91             done
92         )
93     fi
94      
95     # Copy documentation
96     mkdir -p "${destdir}${docsdir}"
97     cp -p $docs "${destdir}${docsdir}"