recipe 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Build recipe for musl-compat.
  2. #
  3. # Copyright (c) 2021 Matias Fonzo, <selk@dragora.org>.
  4. #
  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
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  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.
  16. # Exit immediately on any error
  17. set -e
  18. program=musl-compat
  19. version=20210503_77a1509
  20. release=2
  21. # Define a category for the output of the package name
  22. pkgcategory=libs
  23. tarname=${program}-${version}.tar.lz
  24. # Remote source(s)
  25. fetch="
  26. https://dragora.mirror.garr.it/current/sources/$tarname
  27. rsync://rsync.dragora.org/current/sources/$tarname
  28. "
  29. description="
  30. Extra utilities and headers to complement Musl.
  31. A set of headers and small utilities for use on musl libc systems,
  32. for providing some minimal glibc compatibility.
  33. The code is derived from software contributed to The NetBSD Foundation,
  34. mostly rewritten to be used in musl-compatible systems by Timo Teras.
  35. The implementation of the iconv utility was written by Rich Felker.
  36. "
  37. homepage=https://dev.midipix.org/compat/musl-compat
  38. license="GPLv2+, MIT | BSD"
  39. # Source documentation
  40. docs=README.md
  41. docsdir="${docdir}/${program}-${version}"
  42. build()
  43. {
  44. unpack "${tardir}/$tarname"
  45. cd "$srcdir"
  46. # Set sane permissions
  47. chmod -R u+w,go-w,a+rX-s .
  48. make -j${jobs} V=1 \
  49. prefix=/usr CFLAGS="$QICFLAGS" DESTDIR="$destdir" install
  50. # This should be part of usr/sbin
  51. rm -f "${destdir}/usr/bin/ldconfig"
  52. strip --strip-unneeded "${destdir}"/usr/bin/* || true
  53. # Write a better version of dummy "ldconfig"
  54. mkdir -p "${destdir}"/usr/sbin
  55. cat << EOF > "${destdir}"/usr/sbin/ldconfig
  56. #! /bin/sh -
  57. true
  58. EOF
  59. chmod 755 "${destdir}"/usr/sbin/ldconfig
  60. mkdir -p "${destdir}/$docsdir"
  61. cp -p $docs "${destdir}/$docsdir"
  62. }