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

Contents of /eclass/java-commons.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Mar 18 22:36:09 2003 UTC (11 years, 6 months ago) by absinthe
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Renamed java-commons.eclass to jakarta-commons.eclass

1 # Copyright 1999-2003 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /space/cvsroot/gentoo-x86/eclass/java-commons.eclass,v 1.2 2003/03/18 01:47:59 absinthe Exp $
4
5 inherit base
6 ECLASS=java-commons
7 INHERITED="$INHERITED $ECLASS"
8 IUSE="$IUSE"
9
10 DESCRIPTION="Based on the $ECLASS eclass"
11 HOMEPAGE="http://jakarta.apache.org/"
12
13 # deps on the build tools
14 DEPEND="$DEPEND
15 >=virtual/jdk-1.3
16 >=ant-1.4
17 log4j? ( >=dev-java/log4j-1.2 )
18 junit? ( >=dev-java/junit-3.7 )"
19
20 RDEPEND="$RDEPEND >=virtual/jdk-1.3"
21 SLOT="$SLOT"
22
23 #java-commons_src_unpack() {
24 #
25 # debug-print-function $FUNCNAME $*
26 #
27 # # call base_src_unpack, which implements most of the functionality and has sections,
28 # # unlike this function. The change from base_src_unpack to kde_src_unpack is thus
29 # # wholly transparent for ebuilds.
30 # base_src_unpack $*
31 #
32 # cd ${S}
33 # debug-print "$FUNCNAME: Unpacked to $PWD"
34 #}
35
36 java-commons_src_compile() {
37
38 debug-print-function $FUNCNAME $*
39 [ -z "$1" ] && java-commons_src_compile all
40 ant_targetlist=`fgrep "<target" build.xml | sed -e 's/.*name="\([^"]*\)".*/\1/g'`
41 debug-print "TargetList: $ant_targetlist"
42
43 cd ${S}
44 while [ "$1" ]; do
45 case $1 in
46 myconf)
47 debug-print-section myconf
48 use jikes && myconf="$myconf -Dbuild.compiler=jikes"
49 use log4j && echo "log4j.jar=`java-config --classpath=log4j`" >> build.properties
50 use junit && echo "junit.jar=`java-config --classpath=junit`" >> build.properties
51 debug-print "$FUNCNAME: myconf: set to ${myconf}"
52 ;;
53 maketest)
54 debug-print-section maketest
55 if [ -n "`use junit`" ]; then
56 if [ -n $(echo "$target" | grep "test") ]; then
57 ANT_OPTS=${myconf} ant test || die "Building Testing Classes Failed"
58 else
59 ANT_OPTS=${myconf} ant || die "Building Testing Classes Failed"
60 fi
61 fi
62 ;;
63 make)
64 debug-print-section make
65 for each in $ant_targetlist
66 do
67 if [ "${each}" == "jar" ] ; then
68 target=${each}
69 elif [ "${each}" == "dist-jar" ] ; then
70 target=${each}
71 fi
72 done
73 ANT_OPTS=${myconf} ant ${target} || die "Compilation Failed"
74 ;;
75 makedoc)
76 debug-print-section makedoc
77 ANT_OPTS="${myconf}"
78 target=`echo "${ant_targetlist}" | grep "^javadoc$"`
79 debug-print "Building ${target}"
80 if [ -n "${target}" ]; then
81 ant "${target}" || die "Unable to create documents"
82 else
83 target=`echo "${ant_targetlist}" | grep "^doc$"`
84 if [ -n "${target}" ]; then
85 ant "${target}" || die "Unable to create documents"
86 fi
87 fi
88 ;;
89 all)
90 debug-print-section all
91 # Problem in commons-logging
92 java-commons_src_compile myconf make makedoc
93 ;;
94 esac
95
96 shift
97 done
98 }
99
100 java-commons_src_install() {
101
102 debug-print-function $FUNCNAME $*
103 [ -z "$1" ] && java-commons_src_install all
104
105 cd ${S}
106 while [ "$1" ]; do
107
108 case $1 in
109 dojar)
110 debug-print-section dojar
111 [ -f dist/*.jar ] && dojar dist/*.jar
112 [ -f target/*.jar ] && dojar target/*.jar
113 ;;
114 dohtml)
115 debug-print-section dohtml
116 [ -f LICENSE.txt ] && dodoc LICENSE.txt
117 [ -f RELEASE-NOTES.txt ] && dodoc RELEASE-NOTES.txt
118 [ -n $(ls -1 *.html 2> /dev/null | wc -l ) ] && dohtml *.html
119 [ -n $(ls -1 dist/*.html 2> /dev/null | wc -l ) ] && dohtml dist/*.html
120 [ -n $(ls -1 dist/docs/* 2> /dev/null | wc -l ) ] && dohtml -r dist/docs/*
121 ;;
122 all)
123 debug-print-section all
124 java-commons_src_install dojar dohtml
125 ;;
126 esac
127
128 shift
129 done
130 }
131
132 EXPORT_FUNCTIONS src_compile src_install

  ViewVC Help
Powered by ViewVC 1.1.20