baikal-0.4.6.ebuild 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit webapp
  5. DESCRIPTION="Lightweight CalDAV+CardDAV server"
  6. HOMEPAGE="http://sabre.io/baikal/"
  7. SRC_URI="https://github.com/fruux/Baikal/releases/download/${PV}/${P}.zip"
  8. LICENSE="GPL-3"
  9. KEYWORDS="~amd64 ~arm"
  10. IUSE="+mysql sqlite"
  11. REQUIRED_USE="|| ( mysql sqlite )"
  12. RDEPEND=">=dev-lang/php-5.5[ctype,filter,json,pdo,session,xml,xmlreader,xmlwriter,mysql?,sqlite?]
  13. mysql? ( virtual/mysql )
  14. sqlite? ( dev-db/sqlite )
  15. virtual/httpd-php"
  16. S=${WORKDIR}/${PN}
  17. src_install() {
  18. webapp_src_preinst
  19. dodoc *.md || die "dodoc failed"
  20. einfo "Installing web files"
  21. insinto "${MY_HTDOCSDIR}"
  22. doins -r html/* html/.htaccess Core vendor || die "doins failed"
  23. einfo "Setting up container for configuration"
  24. insinto /etc/${PN}
  25. einfo "Fixing symlinks"
  26. local link target
  27. find "${D}${MY_HTDOCSDIR}" -type l | while read link ; do
  28. target=$(readlink "${link}")
  29. target=${target/..\/Core/Core}
  30. rm "${link}" && ln -s "${target}" "${link}"
  31. done
  32. dosym /etc/${PN} "${MY_HTDOCSDIR}"/Specific
  33. dosym . "${MY_HTDOCSDIR}"/html
  34. webapp_postinst_txt en "${FILESDIR}/postinstall-en.txt"
  35. webapp_src_install
  36. if has_version www-servers/apache ; then
  37. fowners -R apache:apache /etc/${PN}
  38. elif has_version www-servers/nginx ; then
  39. fowners -R nginx:nginx /etc/${PN}
  40. else
  41. einfo "/etc/${PN} must be owned by the webserver user for baikal"
  42. fi
  43. }