common-lisp.eclass 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Copyright 1999-2011 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. #
  4. # Author Matthew Kennedy <mkennedy@gentoo.org>
  5. #
  6. # This eclass supports the common-lisp-controller installation of many
  7. # Common Lisp libraries
  8. inherit common-lisp-common
  9. CLPACKAGE=
  10. DEPEND="dev-lisp/common-lisp-controller"
  11. EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_postrm
  12. common-lisp_pkg_postinst() {
  13. if [ -z "${CLPACKAGE}" ]; then
  14. die "CLPACKAGE was empty or undefined upon call to pkg_prerm"
  15. else
  16. for package in ${CLPACKAGE}; do
  17. einfo "Registering Common Lisp source for ${package}"
  18. register-common-lisp-source ${package}
  19. done
  20. fi
  21. }
  22. common-lisp_pkg_postrm() {
  23. if [ -z "${CLPACKAGE}" ]; then
  24. die "CLPACKAGE was empty or undefined upon call to pkg_prerm"
  25. else
  26. for package in ${CLPACKAGE}; do
  27. if [ ! -d ${CLSOURCEROOT}/${package} ]; then
  28. einfo "Unregistering Common Lisp source for ${package}"
  29. # rm -rf ${CLFASLROOT}/*/${package}
  30. unregister-common-lisp-source ${package}
  31. fi
  32. done
  33. fi
  34. }
  35. #
  36. # In pkg_preinst, we remove the FASL files for the previous version of
  37. # the source.
  38. #
  39. common-lisp_pkg_preinst() {
  40. if [ -z "${CLPACKAGE}" ]; then
  41. die "CLPACKAGE was empty or undefined upon call to pkg_preinst"
  42. else
  43. for package in ${CLPACKAGE}; do
  44. einfo "Removing FASL files for previous version of Common Lisp package ${package}"
  45. rm -rf ${CLFASLROOT}/*/${package} || true
  46. done
  47. fi
  48. }
  49. common-lisp-install() {
  50. insinto ${CLSOURCEROOT}/${CLPACKAGE}
  51. doins $@
  52. }
  53. common-lisp-system-symlink() {
  54. dodir ${CLSYSTEMROOT}/`dirname ${CLPACKAGE}`
  55. if [ $# -eq 0 ]; then
  56. dosym ${CLSOURCEROOT}/${CLPACKAGE}/${CLPACKAGE}.asd \
  57. ${CLSYSTEMROOT}/${CLPACKAGE}.asd
  58. else
  59. for package in "$@" ; do
  60. dosym ${CLSOURCEROOT}/$CLPACKAGE/${package}.asd \
  61. ${CLSYSTEMROOT}/${package}.asd
  62. done
  63. fi
  64. }
  65. # Local Variables: ***
  66. # mode: shell-script ***
  67. # tab-width: 4 ***
  68. # End: ***