recipe 3.8 KB

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