recipe 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. # Build recipe for eudev.
  2. #
  3. # Copyright (c) 2016-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=eudev
  19. version=3.2.11
  20. release=3
  21. # Define a category for the output of the package name
  22. pkgcategory=boot
  23. tarname=${program}-${version}.tar.gz
  24. # Remote source(s)
  25. fetch="
  26. https://github.com/eudev-project/eudev/releases/download/v${version}/$tarname
  27. https://dev.gentoo.org/~blueness/eudev/$tarname
  28. "
  29. description="
  30. Dynamic device management.
  31. Udev is the device manager for the Linux 2.6 kernel series.
  32. Its primary function is managing device nodes in /dev.
  33. It is the successor of devfs and hotplug, which means that
  34. it handles the /dev directory and all user space actions
  35. when adding/removing devices, including firmware load.
  36. This is a fork of Udev from Gentoo.
  37. "
  38. homepage=https://wiki.gentoo.org/wiki/Eudev
  39. license=GPLv2+
  40. # Source documentation
  41. docs=COPYING
  42. docsdir="${docdir}/${program}-${version}"
  43. build()
  44. {
  45. unpack "${tardir}/$tarname"
  46. cd "$srcdir"
  47. # Set sane permissions
  48. chmod -R u+w,go-w,a+rX-s .
  49. ./configure CPPFLAGS="$QICPPFLAGS" \
  50. CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  51. $configure_args \
  52. --libdir=/usr/lib${libSuffix} \
  53. --with-rootlibexecdir=/lib/udev \
  54. --mandir=$mandir \
  55. --docdir=$docsdir \
  56. --enable-static=no \
  57. --enable-shared=yes \
  58. --enable-hwdb \
  59. --enable-manpages \
  60. --enable-rule-generator \
  61. --disable-selinux \
  62. --build="$(gcc -dumpmachine)"
  63. # http://github.com/gentoo/eudev/pull/127
  64. make -j${jobs} V=1 udevhwdbdir=/usr/lib${libSuffix}/udev/hwdb.d
  65. make -j${jobs} udevhwdbdir=/usr/lib${libSuffix}/udev/hwdb.d \
  66. DESTDIR="$destdir" install-strip
  67. # Insert custom rules
  68. mkdir -p "${destdir}/etc/udev/rules.d"
  69. for file in "${worktree}"/archive/eudev/etc/udev/rules.d/*
  70. do
  71. install -p -m 644 -o root -g root "$file" "${destdir}/etc/udev/rules.d"
  72. done
  73. for file in "${worktree}"/archive/eudev/lib/udev/*
  74. do
  75. install -p -m 755 -o root -g root "$file" "${destdir}/usr/lib${libSuffix}/udev"
  76. done
  77. unset -v file
  78. # Install UDEVD perp service
  79. mkdir -p "${destdir}/etc/perp/udevd"
  80. cp -p "${worktree}/archive/eudev/etc/perp/rc.log" \
  81. "${worktree}/archive/eudev/etc/perp/rc.main" \
  82. "${destdir}/etc/perp/udevd/"
  83. chmod 755 "${destdir}"/etc/perp/udevd/rc.*
  84. # Be an active service by default
  85. chmod +t "${destdir}/etc/perp/udevd"
  86. # To handle config file(s)
  87. touch "${destdir}/etc/udev/.graft-config" \
  88. "${destdir}/etc/perp/udevd/.graft-config"
  89. # Compress and link man pages (if needed)
  90. if test -d "${destdir}/$mandir"
  91. then
  92. (
  93. cd "${destdir}/$mandir"
  94. find . -type f -exec lzip -9 {} +
  95. find . -type l | while read -r file
  96. do
  97. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  98. rm -- "$file"
  99. done
  100. )
  101. fi
  102. # Copy documentation
  103. mkdir -p "${destdir}/$docsdir"
  104. cp -p $docs "${destdir}/$docsdir"
  105. }