/[gentoo-x86]/eclass/java.eclass
Gentoo

Contents of /eclass/java.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (show annotations) (download)
Tue May 20 01:29:57 2003 UTC (17 years, 1 month ago) by tberman
Branch: MAIN
Branch point for: RELEASE-1_4
Changes since 1.11: +2 -2 lines
woops

1 # Copyright 1999-2003 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /home/cvsroot/gentoo-x86/eclass/java.eclass,v 1.11 2003/05/19 23:29:41 tberman Exp $
4 #
5 # Author: Karl Trygve Kalleberg <karltk@gentoo.org>
6
7 ECLASS=java
8 INHERITED="$INHERITED $ECLASS"
9 DESCRIPTION="Based on the $ECLASS eclass"
10
11 VMHANDLE=${PN}-${PV}
12
13 function sed2() {
14 unset filename
15 unset arglist
16 local filename=""
17 local arglist
18 declare -a arglist
19 while test $# -gt 0 ; do
20 case $1 in
21 -e)
22 shift
23 arglist[${#arglist[@]}]="-e"
24 arglist[${#arglist[@]}]="$1"
25 ;;
26 *)
27 if [ -e "$1" ] ; then
28 filename=$1
29 fi
30 ;;
31 esac
32 shift
33 done
34
35 if [ ! -z $filename ] ; then
36 mv "${filename}" "${filename}.orig"
37 sed "${arglist[@]}" < ${filename}.orig > ${filename}
38 return 0
39 else
40 return 1
41 fi
42 }
43
44 java_pkg_postinst() {
45 if [ -z `java-config --java 2> /dev/null` ] ; then
46 einfo "No default VM found, setting ${VMHANDLE} as default"
47 java-config --set-system-vm=${VMHANDLE}
48 fi
49 }
50
51 pkg_postinst() {
52 java_pkg_postinst
53 }
54
55 system_arch() {
56 local sarch
57 sarch=`echo $ARCH | sed -e s/[i]*.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/`
58 if [ -z "$sarch" ] ; then
59 sarch=`uname -m | sed -e s/[i]*.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/`
60 fi
61 echo $sarch
62 }
63
64 set_java_env() {
65 dodir /etc/env.d/java
66 sed \
67 -e "s/@P@/${P}/g" \
68 -e "s/@PN@/${PN}/g" \
69 -e "s/@PV@/${PV}/g" \
70 -e "s/@PF@/${PF}/g" \
71 -e "/^ADDLDPATH=.*lib\\/\\\"/s|\"\\(.*\\)\"|\"\\1${platform}/:\\1${platform}/server/\"|" \
72 < $1 \
73 > ${D}/etc/env.d/java/20`basename $1` || die
74 }
75
76 install_mozilla_plugin() {
77 local bn
78 bn=`basename $1`
79
80 if [ "`use mozilla`" ] ; then
81 dodir /usr/lib/mozilla/plugins
82 dosym $1 /usr/lib/mozilla/plugins/${bn}
83 fi
84 }
85

  ViewVC Help
Powered by ViewVC 1.1.20