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