recipe 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Build recipe for libaio.
  2. #
  3. # Copyright (c) 2018-2020 Matias Fonzo, <selk@dragora.org>.
  4. # Copyright (c) 2022-2023 Matias Fonzo, <selk@dragora.org>.
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License");
  7. # you may not use this file except in compliance with the License.
  8. # You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. # Exit immediately on any error
  18. set -e
  19. program=libaio
  20. version=0.3.113
  21. release=2
  22. # Define a category for the output of the package name
  23. pkgcategory=libs
  24. tarname=${program}_${version}.orig.tar.gz
  25. # Remote source(s)
  26. fetch=https://ftp.debian.org/debian/pool/main/liba/libaio/$tarname
  27. description="
  28. Kernel Asynchronous I/O (AIO) support for GNU/Linux.
  29. AIO enables even a single application thread to overlap I/O operations
  30. with other processing, by providing an interface for submitting one or
  31. more I/O requests in one system call (io_submit()) without waiting for
  32. completion, and a separate interface (io_getevents()) to reap
  33. completed I/O operations associated with a given completion group.
  34. "
  35. homepage=https://lse.sourceforge.net/io/aio.html
  36. license=LGPLv2+
  37. # Source documentation
  38. docs="COPYING ChangeLog TODO"
  39. docsdir="${docdir}/${program}-${version}"
  40. build()
  41. {
  42. unpack "${tardir}/$tarname"
  43. cd "$srcdir"
  44. # Apply patches from "Alpine Linux" in order to improve it
  45. # A huge thanks to the authors of the patches
  46. patch -Np1 -i "${worktree}/patches/libaio/libaio-cppflags.patch"
  47. patch -Np1 -i "${worktree}/patches/libaio/libaio-errno.patch"
  48. patch -Np1 -i "${worktree}/patches/libaio/test.patch"
  49. patch -Np1 -i "${worktree}/patches/libaio/test-poll.patch"
  50. # Set sane permissions
  51. chmod -R u+w,go-w,a+rX-s .
  52. make V=1 -j${jobs} \
  53. prefix=/usr \
  54. libdir=/usr/lib${libSuffix} \
  55. DESTDIR="$destdir" install
  56. strip --strip-unneeded "${destdir}/usr/lib${libSuffix}"/*.so || true
  57. strip --strip-debug "${destdir}/usr/lib${libSuffix}"/*.a || true
  58. # Copy documentation
  59. mkdir -p "${destdir}/$docsdir"
  60. cp -p $docs "${destdir}/$docsdir"
  61. }