agendav-1.2.6.2.ebuild 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit webapp
  5. DESCRIPTION="multilanguage CalDAV web client"
  6. HOMEPAGE="http://agendav.org/"
  7. SRC_URI="https://github.com/adobo/${PN}/tarball/${PV} -> ${P}.tar.gz"
  8. LICENSE="BSD LGPL-3+ LGPL-2.1+ GPL-3+"
  9. KEYWORDS="~amd64"
  10. RDEPEND=">=dev-lang/php-5.3[curl,unicode]
  11. virtual/httpd-php
  12. || ( >=virtual/mysql-5.1 >=dev-db/postgresql-8.1 )"
  13. S=${WORKDIR}/adobo-${PN}-84f869e
  14. src_install() {
  15. webapp_src_preinst
  16. dodoc \
  17. doc/source/admin/configuration.rst \
  18. doc/source/admin/installation.rst \
  19. doc/source/admin/troubleshooting.rst \
  20. doc/source/admin/upgrading.rst \
  21. || die
  22. # fix locations
  23. sed -i \
  24. -e "s:\(system_path = \)'[^']\+':\1'${MY_HOSTROOTDIR}/${PN}/system':" \
  25. -e "s:\(application_folder = \)'[^']\+':\1'${MY_HOSTROOTDIR}/${PN}/application':" \
  26. web/public/index.php || die
  27. sed -i \
  28. -e "/require_once/s:'../:'${MY_HOSTROOTDIR}/${PN}/:" \
  29. web/config/autoload.php || die
  30. sed -i \
  31. -e "1a\set_include_path(get_include_path() . PATH_SEPARATOR . APPPATH.'config');" \
  32. web/config/constants.php || die
  33. einfo "Installing web files"
  34. insinto "${MY_HTDOCSDIR}"
  35. doins -r web/public/* || die
  36. einfo "Creating configuration container"
  37. dodir "/etc/agendav"
  38. local f
  39. for f in caldav database config ; do
  40. cp web/config/${f}.php.template "${ED}"/etc/agendav/${f}.php || die
  41. ln -s "${EPREFIX}"/etc/agendav/${f}.php web/config/${f}.php || die
  42. done
  43. einfo "Installing main files"
  44. insinto "${MY_HOSTROOTDIR}/${PN}"
  45. doins -r web/{application,config,css_src,lang,system,templates_src,public} \
  46. || die
  47. insinto "${MY_HOSTROOTDIR}/${PN}/application/libraries"
  48. doins libs/icalcreator/*.php \
  49. libs/caldav-client/*.php \
  50. libs/awl/*.php \
  51. || die
  52. dodir /usr/bin
  53. cat > "${ED}"/usr/bin/agendavcli <<-EOF
  54. #!/usr/bin/env bash
  55. exec php "${MY_HOSTROOTDIR}/${PN}/public/index.php" cli "\${@}"
  56. EOF
  57. chmod 755 "${ED}"/usr/bin/agendavcli
  58. einfo "Installing sql files"
  59. insinto "${MY_SQLSCRIPTSDIR}"
  60. doins -r sql/* || die
  61. webapp_postinst_txt en "${FILESDIR}/postinstall-en.txt"
  62. webapp_src_install
  63. }