recipe 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # Build recipe for inetutils.
  2. #
  3. # Copyright (c) 2017-2022 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=inetutils
  19. version=2.2
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=networking
  23. tarname=${program}-${version}.tar.gz
  24. # Remote source(s)
  25. fetch=https://ftp.gnu.org/gnu/inetutils/$tarname
  26. description="
  27. A collection of common network programs.
  28. The inetutils package contains programs for basic networking.
  29. "
  30. homepage=https://www.gnu.org/software/inetutils
  31. license=GPLv3+
  32. # Source documentation
  33. docs="AUTHORS COPYING NEWS README THANKS TODO"
  34. docsdir="${docdir}/${program}-${version}"
  35. build()
  36. {
  37. unpack "${tardir}/$tarname"
  38. cd "$srcdir"
  39. # Set sane permissions
  40. chmod -R u+w,go-w,a+rX-s .
  41. # Note about `--disable-logger':
  42. # A better version is provided by the util-linux package
  43. ./configure CPPFLAGS="$QICPPFLAGS" \
  44. CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
  45. $configure_args \
  46. --libdir=/usr/lib${libSuffix} \
  47. --infodir=$infodir \
  48. --mandir=$mandir \
  49. --docdir=$docsdir \
  50. --enable-servers \
  51. --enable-ncurses \
  52. --enable-whois \
  53. --disable-syslogd \
  54. --disable-logger \
  55. --disable-rexec \
  56. --with-wrap \
  57. --build="$(gcc -dumpmachine)"
  58. make -j${jobs} V=1
  59. make -j${jobs} DESTDIR="$destdir" install
  60. # Delete bogus file
  61. rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
  62. rmdir "${destdir}/usr/lib${libSuffix}" || true
  63. # Install inetd perp service
  64. mkdir -p "${destdir}/etc/perp/inetd"
  65. cp -p "${worktree}/archive/inetutils/etc/perp/inetd/rc.log" \
  66. "${worktree}/archive/inetutils/etc/perp/inetd/rc.main" \
  67. "${destdir}/etc/perp/inetd/"
  68. chmod 755 "${destdir}"/etc/perp/inetd/rc.*
  69. # THIS SERVICE IS DISABLED BY DEFAULT
  70. chmod -t "${destdir}/etc/perp/inetd"
  71. # Copy config file for inetd(8)
  72. cp -p "${worktree}/archive/inetutils/etc/inetd.conf" "${destdir}/etc/"
  73. chmod 644 "${destdir}/etc/inetd.conf"
  74. # To handle config file(s)
  75. touch "${destdir}/etc/.graft-config" \
  76. "${destdir}/etc/perp/inetd/.graft-config"
  77. # Compress info documents deleting index file for the package
  78. if test -d "${destdir}/$infodir"
  79. then
  80. rm -f "${destdir}/${infodir}/dir"
  81. lzip -9 "${destdir}/${infodir}"/*
  82. fi
  83. # Compress and link man pages (if needed)
  84. if test -d "${destdir}/$mandir"
  85. then
  86. (
  87. cd "${destdir}/$mandir"
  88. find . -type f -exec lzip -9 {} +
  89. find . -type l | while read -r file
  90. do
  91. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  92. rm -- "$file"
  93. done
  94. )
  95. fi
  96. # Copy documentation
  97. mkdir -p "${destdir}/$docsdir"
  98. cp -p $docs "${destdir}/$docsdir"
  99. }