recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / libs / musl-compat / recipe
blob956d480aeb3310f680611a5930bb7964b1b5adf7
1 # Build recipe for musl-compat.
3 # Copyright (c) 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=musl-compat
21 version=20210503_77a1509
22 release=2
24 # Define a category for the output of the package name
25 pkgcategory=libs
27 tarname=${program}-${version}.tar.lz
29 # Remote source(s)
30 fetch="
31  https://dragora.mirror.garr.it/current/sources/$tarname
32  rsync://rsync.dragora.org/current/sources/$tarname
35 description="
36 Extra utilities and headers to complement Musl.
38 A set of headers and small utilities for use on musl libc systems,
39 for providing some minimal glibc compatibility.
41 The code is derived from software contributed to The NetBSD Foundation,
42 mostly rewritten to be used in musl-compatible systems by Timo Teras.
44 The implementation of the iconv utility was written by Rich Felker.
47 homepage=https://dev.midipix.org/compat/musl-compat
48 license="GPLv2+, MIT | BSD"
50 # Source documentation
51 docs=README.md
52 docsdir="${docdir}/${program}-${version}"
54 build()
56     unpack "${tardir}/$tarname"
58     cd "$srcdir"
60     # Set sane permissions
61     chmod -R u+w,go-w,a+rX-s .
63     make -j${jobs} V=1 \
64      prefix=/usr CFLAGS="$QICFLAGS" DESTDIR="$destdir" install
66     # This should be part of usr/sbin
67     rm -f "${destdir}/usr/bin/ldconfig"
69     strip --strip-unneeded "${destdir}"/usr/bin/* || true
71     # Write a better version of dummy "ldconfig"
72     mkdir -p "${destdir}"/usr/sbin
73     cat << EOF > "${destdir}"/usr/sbin/ldconfig
74 #! /bin/sh -
76 true
78 EOF
79     chmod 755 "${destdir}"/usr/sbin/ldconfig
81     mkdir -p "${destdir}/$docsdir"
82     cp -p $docs "${destdir}/$docsdir"