recipe 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Build recipe for ethtool.
  2. #
  3. # Copyright (c) 2019, 2021-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=ethtool
  19. version=5.16
  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://mirrors.edge.kernel.org/pub/software/network/ethtool/$tarname
  26. description="
  27. Utility for controlling network drivers and hardware.
  28. It can be used to:
  29. Get identification and diagnostic information.
  30. Get extended device statistics.
  31. Control speed, duplex, autonegotiation and flow control (Ethernet).
  32. Control checksum offload and other hardware offload features.
  33. Control DMA ring sizes and interrupt moderation.
  34. Control receive queue selection for multiqueue devices.
  35. Upgrade firmware in flash memory.
  36. "
  37. homepage=https://mirrors.edge.kernel.org/pub/software/network/ethtool/
  38. license=GPLv2+
  39. # Source documentation
  40. docs="AUTHORS COPYING ChangeLog LICENSE NEWS README"
  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. ./configure CPPFLAGS="$QICPPFLAGS" \
  49. CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
  50. $configure_args \
  51. --mandir=$mandir \
  52. --docdir=$docsdir \
  53. --build="$(gcc -dumpmachine)"
  54. make -j${jobs} V=1
  55. make -j${jobs} V=1 DESTDIR="$destdir" install
  56. # Compress and link man pages (if needed)
  57. if test -d "${destdir}/$mandir"
  58. then
  59. (
  60. cd "${destdir}/$mandir"
  61. find . -type f -exec lzip -9 {} +
  62. find . -type l | while read -r file
  63. do
  64. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  65. rm -- "$file"
  66. done
  67. )
  68. fi
  69. # Copy documentation
  70. mkdir -p "${destdir}/$docsdir"
  71. cp -p $docs "${destdir}/$docsdir"
  72. }