recipe 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Build recipe for ncdu
  2. #
  3. # Copyright 2016, 2018 Mateus P. Rodrigues <mprodrigues@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. program=ncdu
  17. version=1.13
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/tools"
  21. description="
  22. NCurses Disk Usage.
  23. Ncdu is a disk usage analyzer with an ncurses interface. It is
  24. designed to find space hogs on a remote server where you don't have an
  25. entire graphical setup available, but it is a useful tool even on
  26. regular desktop systems. Ncdu aims to be fast, simple and easy to use,
  27. and should be able to run in any minimal POSIX-like environment with
  28. ncurses installed.
  29. "
  30. homepage=http://dev.yorhel.nl/ncdu
  31. license=MIT
  32. tarname=${program}-${version}.tar.gz
  33. tardir=.
  34. # Remote source(s)
  35. fetch="http://dev.yorhel.nl/download/$tarname"
  36. # Source documentation
  37. docs="COPYING ChangeLog README"
  38. docsdir="${docdir}/${program}-${version}"
  39. build() {
  40. unpack "${tardir}/$tarname"
  41. cd "$srcdir"
  42. # Set sane permissions
  43. chmod -R u+w,go-w,a+rX-s .
  44. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  45. $configure_args \
  46. --libdir=/usr/lib${libSuffix} \
  47. --infodir=$infodir \
  48. --mandir=$mandir \
  49. --docdir=$docdir \
  50. --build="$(cc -dumpmachine)"
  51. make -j${jobs} V=1
  52. make -j${jobs} DESTDIR="$destdir" install
  53. # Compress and link man pages (if needed)
  54. if test -d "${destdir}/$mandir"
  55. then
  56. (
  57. cd "${destdir}/$mandir"
  58. find . -type f -exec lzip -9 '{}' +
  59. find . -type l | while read -r file
  60. do
  61. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  62. rm -- "$file"
  63. done
  64. )
  65. fi
  66. # Copy documentation
  67. mkdir -p "${destdir}/usr/share/doc/${program}-${version}"
  68. cp -p $docs "${destdir}/usr/share/doc/${program}-${version}/"
  69. }