Magellan Linux

Contents of /branches/R11-unstable/include/java.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 24893 - (show annotations) (download)
Tue Nov 25 02:21:44 2014 UTC (9 years, 11 months ago) by niro
File size: 1383 byte(s)
-release R11-unstable
1 # $Id$
2
3 sminclude mtools
4
5 JAVA_CLASSPATH_DIR="/usr/share/java"
6
7 mget-jar-path-from-classpath()
8 {
9 local jar="$1"
10 local i
11
12 for i in ${CLASSPATH//:/ }
13 do
14 case ${i} in
15 *${jar}) echo ${i};;
16 esac
17 done
18 }
19
20 # deprecated and will be dropped in near future
21 jar-path-from-classpath()
22 {
23 echo -e "${COLYELLOW}Warning: jar-path-from-classpath() is depcrecated, please use mget-jar-path-from-classpath() instead${COLDEFAULT}" >&2
24 mget-jar-path-from-classpath $@
25 }
26
27 mclasspathinit()
28 {
29 minstalldir /etc/env.d || die
30
31 # classpath env
32 MCONFIG="/etc/env.d/22java-app-${PNAME}"
33 mclearconfig || die
34 }
35
36 minstalljar-classpath()
37 {
38 local files
39 local jar
40 local jarbase
41
42 files="$@"
43
44 # needed directories
45 minstalldir /etc/env.d || die
46 minstalldir /usr/share/${PNAME}-${PVER}/lib || die
47
48 # classpath env
49 MCONFIG="/etc/env.d/22java-app-${PNAME}"
50
51 for jar in ${files}
52 do
53 jarbase="$(basename ${jar})"
54 minstallfile ${jar} /usr/share/${PNAME}-${PVER}/lib/${jarbase} || die
55 maddconfig "CLASSPATH=/usr/share/${PNAME}-${PVER}/lib/${jarbase}" || die
56 done
57 }
58
59 minstalljar()
60 {
61 local files
62 local jar
63 local jarbase
64
65 files="$@"
66
67 minstalldir ${JAVA_CLASSPATH_DIR} || die
68 for jar in ${files}
69 do
70 jarbase="$(basename ${jar} .jar)"
71 minstallfile ${jar} ${JAVA_CLASSPATH_DIR}/${jarbase}-${PVER}.jar || die
72 mlink ${jarbase}-${PVER}.jar ${JAVA_CLASSPATH_DIR}/${jarbase}.jar || die
73 done
74 }