mlocate-0.26-r2.ebuild 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils user toolchain-funcs
  5. DESCRIPTION="Merging locate is an utility to index and quickly search for files"
  6. HOMEPAGE="https://pagure.io/mlocate"
  7. SRC_URI="http://releases.pagure.org/mlocate/${P}.tar.xz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86"
  11. IUSE="nls selinux"
  12. RDEPEND="!sys-apps/slocate
  13. !sys-apps/rlocate
  14. selinux? ( sec-policy/selinux-slocate )"
  15. DEPEND="app-arch/xz-utils
  16. nls? ( sys-devel/gettext )
  17. "
  18. pkg_setup() {
  19. enewgroup locate
  20. }
  21. src_configure() {
  22. econf $(use_enable nls)
  23. }
  24. src_compile() {
  25. emake groupname=locate AR="$(tc-getAR)"
  26. }
  27. src_install() {
  28. emake groupname=locate DESTDIR="${D}" install
  29. dodoc AUTHORS ChangeLog README NEWS
  30. insinto /etc
  31. doins "${FILESDIR}"/updatedb.conf
  32. doins "${FILESDIR}"/mlocate-cron.conf
  33. fperms 0644 /etc/{updatedb,mlocate-cron}.conf
  34. insinto /etc/cron.daily
  35. newins "${FILESDIR}"/mlocate.cron-r3 mlocate
  36. fperms 0755 /etc/cron.daily/mlocate
  37. fowners 0:locate /usr/bin/locate
  38. fperms go-r,g+s /usr/bin/locate
  39. keepdir /var/lib/mlocate
  40. chown -R 0:locate "${ED}"/var/lib/mlocate
  41. fperms 0750 /var/lib/mlocate
  42. }
  43. pkg_postinst() {
  44. elog "The database for the locate command is generated daily by a cron job,"
  45. elog "if you install for the first time you can run the updatedb command manually now."
  46. elog
  47. elog "Note that the /etc/updatedb.conf file is generic,"
  48. elog "please customize it to your system requirements."
  49. }