recipe 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Build recipe for popt.
  2. #
  3. # Copyright (C) 2017 Alan Beadle, ab.beadle@gmail.com.
  4. # Copyright (c) 2018 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=1
  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=http://rpm5.org/files/${program}/${tarname}
  25. description="
  26. Popt is a C library for parsing command line parameters.
  27. Popt was heavily influenced by the getopt() and getopt_long()
  28. functions, but it improves on them by allowing more powerful
  29. argument expansion.
  30. "
  31. homepage=http://rpm5.org
  32. license="MIT X Consortium"
  33. # Source documentation
  34. docs="CHANGES COPYING README"
  35. docsdir="${docdir}/${program}-${version}"
  36. build()
  37. {
  38. set -e
  39. unpack "${tardir}/$tarname"
  40. cd "$srcdir"
  41. # Set sane permissions
  42. chmod -R u+w,go-w,a+rX-s .
  43. # Update for hosts based on musl
  44. cp -f "${worktree}/archive/common/config.guess" ./config.guess
  45. cp -f "${worktree}/archive/common/config.sub" ./config.sub
  46. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  47. $configure_args \
  48. --libdir=/usr/lib${libSuffix} \
  49. --mandir=$mandir \
  50. --docdir=$docsdir \
  51. --enable-static=yes \
  52. --enable-shared=yes \
  53. --build="$(cc -dumpmachine)"
  54. make -j${jobs} V=1 libdir=/usr/lib${libSuffix} \
  55. pkgconfigdir=/usr/lib${libSuffix}/pkgconfig
  56. make -j${jobs} libdir=/usr/lib${libSuffix} \
  57. pkgconfigdir=/usr/lib${libSuffix}/pkgconfig \
  58. DESTDIR="${destdir}" install-strip
  59. # Compress man pages
  60. lzip -9 "${destdir}/${mandir}"/man?/*
  61. # Copy documentation
  62. mkdir -p "${destdir}${docsdir}"
  63. cp -p $docs "${destdir}${docsdir}"
  64. }