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
21 version=20210503_77a1509
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.tar.lz
31 https://dragora.mirror.garr.it/current/sources/$tarname
32 rsync://rsync.dragora.org/current/sources/$tarname
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
52 docsdir="${docdir}/${program}-${version}"
56 unpack "${tardir}/$tarname"
60 # Set sane permissions
61 chmod -R u+w,go-w,a+rX-s .
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
79 chmod 755 "${destdir}"/usr/sbin/ldconfig
81 mkdir -p "${destdir}/$docsdir"
82 cp -p $docs "${destdir}/$docsdir"