cachefilesd-0.10.9.ebuild 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit flag-o-matic systemd toolchain-funcs
  5. DESCRIPTION="Provides a caching directory on an already mounted filesystem"
  6. HOMEPAGE="https://people.redhat.com/~dhowells/fscache/"
  7. SRC_URI="https://people.redhat.com/~dhowells/fscache/${P}.tar.bz2"
  8. SLOT="0"
  9. LICENSE="GPL-2+"
  10. KEYWORDS="amd64 ~x86"
  11. IUSE="doc selinux"
  12. RDEPEND="selinux? ( sec-policy/selinux-cachefilesd )"
  13. DEPEND=""
  14. src_prepare() {
  15. eapply_user
  16. eapply "${FILESDIR}"/${PN}-0.10.9-makefile.patch
  17. if ! use selinux; then
  18. sed -e '/^secctx/s:^:#:g' -i cachefilesd.conf || die
  19. fi
  20. tc-export CC
  21. append-flags -fpie
  22. }
  23. src_install() {
  24. default
  25. if use selinux; then
  26. insinto /usr/share/doc/${P}
  27. doins -r selinux
  28. fi
  29. dodoc howto.txt
  30. newconfd "${FILESDIR}"/${PN}.conf ${PN}
  31. newinitd "${FILESDIR}"/${PN}-3.init ${PN}
  32. systemd_dounit ${PN}.service
  33. systemd_newtmpfilesd "${FILESDIR}"/${PN}-tmpfiles.d ${PN}.conf
  34. }
  35. pkg_postinst() {
  36. [[ -d /var/cache/fscache ]] && return
  37. elog "Before CacheFiles can be used, a directory for local storage"
  38. elog "must be created. The default configuration of /etc/cachefilesd.conf"
  39. elog "uses /var/cache/fscache. The filesystem mounted there must support"
  40. elog "extended attributes (mount -o user_xattr)."
  41. echo ""
  42. elog "Once that is taken care of, start the daemon, add -o ...,fsc"
  43. elog "to the mount options of your network mounts, and let it fly!"
  44. }