recipe 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # Build recipe for userspace-rcu (liburcu).
  2. #
  3. # Copyright (c) 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=userspace-rcu
  19. pkgname=liburcu
  20. version=0.13.2
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=libs
  24. tarname=${program}-${version}.tar.bz2
  25. # Remote source(s)
  26. fetch=https://lttng.org/files/urcu/$tarname
  27. description="
  28. Userspace RCU (read-copy-update) library.
  29. The liburcu package provides a set of userspace RCU (read-copy-update)
  30. libraries. These data synchronization libraries provide read-side access
  31. which scales linearly with the number of cores. It does so by allowing
  32. multiples copies of a given data structure to live at the same time, and
  33. by monitoring the data structure accesses to detect grace periods after
  34. which memory reclamation is possible.
  35. "
  36. homepage=https://liburcu.org
  37. license=LGPLv2.1
  38. # Source documentation
  39. docs="ChangeLog LICENSE README* *.txt"
  40. docsdir="${docdir}/${pkgname}-${version}"
  41. build()
  42. {
  43. unpack "${tardir}/$tarname"
  44. cd "$srcdir"
  45. # Set sane permissions
  46. chmod -R u+w,go-w,a+rX-s .
  47. ./configure CPPFLAGS="$QICPPFLAGS" \
  48. CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  49. $configure_args \
  50. --libdir=/usr/lib${libSuffix} \
  51. --mandir=$mandir \
  52. --docdir=$docsdir \
  53. --enable-static=no \
  54. --enable-shared=yes \
  55. --build="$(gcc -dumpmachine)"
  56. make -j${jobs} V=1
  57. make -j${jobs} V=1 DESTDIR="$destdir" install
  58. # Compress and link man pages (if needed)
  59. if test -d "${destdir}/$mandir"
  60. then
  61. (
  62. cd "${destdir}/$mandir"
  63. find . -type f -exec lzip -9 {} +
  64. find . -type l | while read -r file
  65. do
  66. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  67. rm -- "$file"
  68. done
  69. )
  70. fi
  71. # Copy documentation
  72. mkdir -p "${destdir}/$docsdir"
  73. cp -p $docs "${destdir}/$docsdir"
  74. }