recipe 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # Build recipe for quota.
  2. #
  3. # Copyright (c) 2018-2021 Matias Fonzo, <selk@dragora.org>.
  4. # Copyright (c) 2022 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=quota
  20. version=4.09
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=tools
  24. tarname=${program}-${version}.tar.gz
  25. # Remote source(s)
  26. fetch=https://downloads.sourceforge.net/project/linuxquota/quota-tools/${version}/$tarname
  27. description="
  28. User space tools to manage the disk quota system.
  29. Tools for the disk quota system as part of the Linux Kernel.
  30. "
  31. homepage=https://sourceforge.net/projects/linuxquota
  32. license="GPLv2+ | BSD"
  33. # Source documentation
  34. docs="COPYING Changelog README*"
  35. docsdir="${docdir}/${program}-${version}"
  36. build()
  37. {
  38. unpack "${tardir}/$tarname"
  39. cd "$srcdir"
  40. # Set sane permissions
  41. chmod -R u+w,go-w,a+rX-s .
  42. ./configure CPPFLAGS="-D_GNU_SOURCE -D_BSD_SOURCE" \
  43. CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  44. $configure_args \
  45. --libdir=/usr/lib${libSuffix} \
  46. --sysconfdir=/etc/quota \
  47. --mandir=$mandir \
  48. --docdir=$docsdir \
  49. --disable-werror \
  50. --enable-rpc=yes \
  51. --enable-ldapmail=no \
  52. --build="$(gcc -dumpmachine)"
  53. make -j${jobs} V=1
  54. make -j${jobs} DESTDIR="$destdir" install-strip
  55. # To manage dot (new) config files via graft(1)
  56. touch "${destdir}/etc/quota/.graft-config"
  57. # Compress and link man pages (if needed)
  58. if test -d "${destdir}/$mandir"
  59. then
  60. (
  61. cd "${destdir}/$mandir"
  62. find . -type f -exec lzip -9 {} +
  63. find . -type l | while read -r file
  64. do
  65. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  66. rm -- "$file"
  67. done
  68. )
  69. fi
  70. # Copy documentation
  71. mkdir -p "${destdir}/$docsdir"
  72. cp -p $docs "${destdir}/$docsdir"
  73. }