recipe 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Build recipe for mlocate.
  2. #
  3. # Copyright (c) 2017 Alan Beadle, <ab.beadle@gmail.com>.
  4. # Copyright (c) 2017 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. program=mlocate
  18. version=0.26
  19. release=1
  20. # Set 'outdir' for a nice and well-organized output directory
  21. outdir="${outdir}/${arch}/tools"
  22. tarname=${program}-${version}.tar.xz
  23. # Remote source(s)
  24. fetch=http://releases.pagure.org/${program}/$tarname
  25. description="
  26. mlocate is a locate/updatedb implementation.
  27. The 'm' stands for 'merging': updatedb reuses the existing database to
  28. avoid rereading most of the file system, which makes updatedb faster
  29. and does not trash the system caches as much.
  30. "
  31. homepage=http://pagure.io/mlocate
  32. license=GPLv2+
  33. # Source documentation
  34. docs="AUTHORS ChangeLog COPYING NEWS README"
  35. docsdir="${docdir}/${program}-${version}"
  36. build()
  37. {
  38. set -e
  39. unpack "${tardir}/$tarname"
  40. cd "$srcdir"
  41. # Set sane permissions
  42. chmod -R u+w,go-w,a+rX-s .
  43. # Update for hosts based on musl
  44. cp -f "${worktree}/archive/common/config.guess" admin/config.guess
  45. cp -f "${worktree}/archive/common/config.sub" admin/config.sub
  46. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
  47. $configure_args \
  48. --libdir=/usr/lib${libSuffix} \
  49. --localstatedir=/var/lib \
  50. --mandir=$mandir \
  51. --docdir=$docsdir \
  52. --build="$(cc -dumpmachine)"
  53. make -j${jobs} groupname=locate
  54. make -j${jobs} groupname=locate DESTDIR="$destdir" install
  55. mv "${destdir}/usr/bin/locate" "${destdir}/usr/bin/mlocate"
  56. ln -s mlocate "${destdir}/usr/bin/locate"
  57. # To increase security changing the default 2755
  58. chmod 2711 "${destdir}/usr/bin/mlocate"
  59. # Remove generated charset.alias
  60. rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
  61. rmdir "${destdir}/usr/lib${libSuffix}" || true
  62. # Copy custom files
  63. mkdir -p "${destdir}/etc/cron.daily/"
  64. cp -p "${worktree}/archive/mlocate/etc/cron.daily/mlocate" \
  65. "${destdir}/etc/cron.daily/"
  66. chmod 0755 "${destdir}/etc/cron.daily/mlocate"
  67. cp -p "${worktree}/archive/mlocate/etc/updatedb.conf" \
  68. "${destdir}/etc/"
  69. chmod 0644 "${destdir}/etc/updatedb.conf"
  70. # To handle config file(s)
  71. touch "${destdir}/etc/.graft-config"
  72. # Compress man pages
  73. lzip -9 "${destdir}/${mandir}"/man?/*
  74. # A symbolic link if someone requests locate(1)
  75. ln -s locate.1.lz "${destdir}/${mandir}/man1/mlocate.1.lz"
  76. # Copy documentation
  77. mkdir -p "${destdir}${docsdir}"
  78. for file in $docs
  79. do
  80. cp -p $file "${destdir}${docsdir}"
  81. done
  82. }