recipe 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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.1
  21. release=2
  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}/${program}-${version}"
  41. build()
  42. {
  43. unpack "${tardir}/$tarname"
  44. cd "$srcdir"
  45. # The value used in the Makefiles for PWD it is set to null
  46. # on the build, reason why we establish again to link against
  47. # the produced library objects
  48. find . -type f | xargs grep -l 'PWD' | xargs \
  49. sed -i 's@$(PWD)@$(shell pwd)@g'
  50. autoreconf -vif
  51. # Set sane permissions
  52. chmod -R u+w,go-w,a+rX-s .
  53. ./configure CPPFLAGS="$QICPPFLAGS" \
  54. CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  55. $configure_args \
  56. --libdir=/usr/lib${libSuffix} \
  57. --mandir=$mandir \
  58. --docdir=$docsdir \
  59. --enable-static=no \
  60. --enable-shared=yes \
  61. --build="$(gcc -dumpmachine)"
  62. make -j${jobs} V=1
  63. make -j${jobs} V=1 DESTDIR="$destdir" install
  64. # Please refer to the full source for the documentation
  65. rm -rf "${destdir}/$docsdirexamples"
  66. # Compress and link man pages (if needed)
  67. if test -d "${destdir}/$mandir"
  68. then
  69. (
  70. cd "${destdir}/$mandir"
  71. find . -type f -exec lzip -9 {} +
  72. find . -type l | while read -r file
  73. do
  74. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  75. rm -- "$file"
  76. done
  77. )
  78. fi
  79. # Copy documentation
  80. mkdir -p "${destdir}/$docsdir"
  81. cp -p $docs "${destdir}/$docsdir"
  82. }