recipe 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Build recipe for lm_sensors.
  2. #
  3. # Copyright (c) 2018, 2019 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. program=lm-sensors
  17. version=3-5-0
  18. release=1
  19. pkgname=lm_sensors
  20. pkgversion="$(echo $version | tr - .)"
  21. # Set 'outdir' for a nice and well-organized output directory
  22. outdir="${outdir}/${arch}/tools"
  23. tarname=${program}-${version}.tar.gz
  24. # Remote source(s)
  25. fetch=http://github.com/lm-sensors/lm-sensors/archive/V${version}/$tarname
  26. #fetch=http://ftp.gwdg.de/pub/linux/misc/lm-sensors/$tarname
  27. description="
  28. Hardware monitoring support.
  29. The lm_sensors package provides support for the hardware monitoring
  30. drivers in the Linux Kernel. This is useful for monitoring the
  31. temperature of the CPU and adjusting the performance of some hardware
  32. (such as cooling fans).
  33. "
  34. homepage=http://hwmon.wiki.kernel.org/lm_sensors
  35. license="GPLv2+, LGPLv2.1"
  36. # Source documentation
  37. docs="CHANGES CONTRIBUTORS COPYING* README doc/fancontrol.txt"
  38. docsdir="${docdir}/${pkgname}-${pkgversion}"
  39. build()
  40. {
  41. set -e
  42. unpack "${tardir}/$tarname"
  43. cd $srcdir
  44. make -j${jobs} V=1 MACHINE=$arch LIBICONV=-lc \
  45. BUILD_STATIC_LIB=0 \
  46. PREFIX=/usr LIBDIR=/usr/lib${libSuffix} MANDIR=$mandir \
  47. DESTDIR="$destdir" install
  48. # Strip remaining binaries and libraries
  49. find "$destdir" -type f | xargs file | \
  50. awk '/ELF/ && /executable/ || /shared object/' | \
  51. cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  52. #strip --strip-debug "${destdir}/usr/lib${libSuffix}"/*.a
  53. # To manage (dot) new config via graft(1)
  54. touch "${destdir}/etc/.graft-config"
  55. # Compress and link man pages (if needed)
  56. if test -d "${destdir}/$mandir"
  57. then
  58. (
  59. cd "${destdir}/$mandir"
  60. find . -type f -exec lzip -9 '{}' +
  61. find . -type l | while read -r file
  62. do
  63. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  64. rm -- "$file"
  65. done
  66. )
  67. fi
  68. # Copy documentation
  69. mkdir -p "${destdir}${docsdir}"
  70. cp -p $docs "${destdir}${docsdir}"
  71. }