recipe 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Build recipe for popt.
  2. #
  3. # Copyright (C) 2017 Alan Beadle, ab.beadle@gmail.com.
  4. # Copyright (c) 2018-2019 Matias Fonzo, <selk@dragora.org>.
  5. #
  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
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  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.
  17. program=popt
  18. version=1.16
  19. release=2
  20. # Set 'outdir' for a nice and well-organized output directory
  21. outdir="${outdir}/${arch}/libs"
  22. tarname=${program}-${version}.tar.gz
  23. # Remote source(s)
  24. fetch="
  25. ftp://anduin.linuxfromscratch.org/BLFS/popt/$tarname
  26. http://rsync.dragora.org/current/sources/$tarname
  27. "
  28. description="
  29. Popt is a C library for parsing command line parameters.
  30. Popt was heavily influenced by the getopt() and getopt_long()
  31. functions, but it improves on them by allowing more powerful
  32. argument expansion.
  33. "
  34. homepage=http://rpm5.org
  35. license="MIT X Consortium"
  36. # Source documentation
  37. docs="CHANGES COPYING README"
  38. docsdir="${docdir}/${program}-${version}"
  39. build()
  40. {
  41. set -e
  42. unpack "${tardir}/$tarname"
  43. cd "$srcdir"
  44. # Set sane permissions
  45. chmod -R u+w,go-w,a+rX-s .
  46. # Update for hosts based on musl
  47. cp -f "${worktree}/archive/common/config.guess" ./config.guess
  48. cp -f "${worktree}/archive/common/config.sub" ./config.sub
  49. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  50. $configure_args \
  51. --libdir=/usr/lib${libSuffix} \
  52. --mandir=$mandir \
  53. --docdir=$docsdir \
  54. --enable-static=yes \
  55. --enable-shared=yes \
  56. --build="$(cc -dumpmachine)"
  57. make -j${jobs} V=1 libdir=/usr/lib${libSuffix} \
  58. pkgconfigdir=/usr/lib${libSuffix}/pkgconfig
  59. make -j${jobs} libdir=/usr/lib${libSuffix} \
  60. pkgconfigdir=/usr/lib${libSuffix}/pkgconfig \
  61. DESTDIR="${destdir}" install-strip
  62. # Compress man pages
  63. lzip -9 "${destdir}/${mandir}"/man?/*
  64. # Copy documentation
  65. mkdir -p "${destdir}${docsdir}"
  66. cp -p $docs "${destdir}${docsdir}"
  67. }