wok-current view icedtea6-jdk/receipt @ rev 7710

merge
author fireflyoo <lufeng369@gmail.com>
date Sun Dec 19 23:29:00 2010 +0800 (2010-12-19)
parents 501d89e34aae
children 9fc32aa2b184
line source
1 # SliTaz package receipt.
3 PACKAGE="icedtea6-jdk"
4 SOURCE="icedtea6"
5 VERSION="1.9.1"
6 CATEGORY="development"
7 SHORT_DESC="A Free Software harness for OpenJDK."
8 MAINTAINER="rcx@zoominternet.net"
9 DEPENDS="icedtea6-jre glibc-base zlib xorg-libX11 xorg-libXau xorg-libXdmcp"
10 BUILD_DEPENDS="gcc+gcj slitaz-toolchain autoconf automake m4 diffutils gawk \
11 coreutils-file-special coreutils-file-summarize alsa-lib-dev cups-dev \
12 gawk file patch findutils perl zip unzip bzip2 tar cpio glib-dev zlib-dev \
13 fastjar rhino ecj apache-ant xalan-xerces-j \
14 freetype-dev gtk+-dev giflib-dev jpeg-dev libpng-dev \
15 xorg-inputproto xorg-kbproto xorg-libXi-dev xorg-libXinerama-dev \
16 xorg-libXp-dev xorg-libXt-dev xorg-libXtst-dev xorg-printproto \
17 xorg-recordproto xorg-renderproto xorg-xextproto xorg-xineramaproto xorg-xproto"
18 TARBALL="$SOURCE-$VERSION.tar.gz"
19 WEB_SITE="http://www.iced-tea.org/"
20 WGET_URL="http://icedtea.classpath.org/download/source/$TARBALL"
22 openjdk_version="b20"
23 openjdk_date="21_jun_2010"
24 JAXWS="jdk6-jaxws-${openjdk_version}.zip"
25 JAXP="jdk6-jaxp-${openjdk_version}.zip"
26 JAF="jdk6-jaf-${openjdk_version}.zip"
27 OPENJDK="openjdk-6-src-${openjdk_version}-${openjdk_date}.tar.gz"
28 WGETJAXWS="https://jax-ws.dev.java.net/files/documents/4202/150724"
29 WGETJAXP="https://jaxp.dev.java.net/files/documents/913/150648"
30 WGETJAF="https://jax-ws.dev.java.net/files/documents/4202/150725"
31 WGETOPENJDK="http://download.java.net/openjdk/jdk6/promoted/${openjdk_version}"
33 # Rules to configure and make the package.
34 compile_rules()
35 {
36 # Limit memory usage
37 ulimit -v $(awk '/MemTotal/ { print int(($2*80)/100) }' < /proc/meminfo)
39 local JVM_PREFIX
40 JVM_PREFIX="/usr/lib/jvm/java-icedtea"
42 # NOTE: This build does not seem to work with ECJ 3.5
43 local ECJ_VERSION
44 ECJ_VERSION="3.6"
46 cd $src
47 mkdir drops
48 sed -i -e 's/mkdir -p drops/true/' -e 's/ jar xf/ fastjar xf/' Makefile*
49 [ -L /usr/bin/wget ] && tazpkg get-install wget --forced
50 for i in $JAXWS $JAXP $JAF ; do
51 if [ -f $SOURCES_REPOSITORY/$i ]; then
52 cp $SOURCES_REPOSITORY/$i drops
53 elif [ "$i" == "$JAXWS" ]; then
54 wget -O $SOURCES_REPOSITORY/$JAXWS --no-check-certificate "$WGETJAXWS/$JAXWS"
55 cp $SOURCES_REPOSITORY/$JAXWS drops
56 elif [ "$i" == "$JAXP" ]; then
57 wget -O $SOURCES_REPOSITORY/$JAXP --no-check-certificate "$WGETJAXP/$JAXP"
58 cp $SOURCES_REPOSITORY/$JAXP drops
59 elif [ "$i" == "$JAF" ]; then
60 wget -O $SOURCES_REPOSITORY/$JAF --no-check-certificate "$WGETJAF/$JAF"
61 cp $SOURCES_REPOSITORY/$JAF drops
62 fi
64 done
66 for i in $OPENJDK ; do
67 if [ -f $SOURCES_REPOSITORY/$i ]; then
68 cp $SOURCES_REPOSITORY/$i .
69 else
70 wget -O $SOURCES_REPOSITORY/$OPENJDK "$WGETOPENJDK/$OPENJDK"
71 cp $SOURCES_REPOSITORY/$OPENJDK .
72 fi
73 done
74 [ -L /usr/bin/find ] && tazpkg get-install findutils --forced
75 [ -L /usr/bin/diff ] && tazpkg get-install diffutils --forced
76 [ "$(readlink /usr/bin/awk)" == "gawk" ] ||
77 tazpkg get-install gawk --forced
78 [ -L /usr/bin/sed ] && tazpkg get-install sed --forced
79 mem=$(free | awk '/Mem:/ { printf "%d\n",$2/1024 }')
80 cat > slitaz.sh <<EOT
81 # Busybox compatibility
82 #find -name Sanity.gmk | xargs sed -i 's/--sync -kP/-k/' Makefile
83 find -name Platform.gmk | xargs sed -i "s@MB_OF_MEMORY *:=.*free.*@MB_OF_MEMORY := $mem@" Makefile
84 EOT
85 sed -i -e 's|touch .*|&\n\tsh slitaz.sh|' \
86 -e 's/--check/-c/' \
87 -e 's/ln -sfv/ln -sf/' Makefile*
88 autoreconf &&
89 ./configure \
90 --prefix=/usr \
91 --disable-plugin \
92 --disable-docs \
93 --with-ecj \
94 --with-ecj-jar=/usr/share/java/ecj-$ECJ_VERSION.jar \
95 --with-gcj \
96 --with-gcj-home=/usr/lib/jvm/java-gcj \
97 --with-xalan2-jar=/usr/share/java/xalan.jar \
98 --with-xalan2-serializer-jar=/usr/share/java/serializer.jar \
99 --with-xerces2-jar=/usr/share/java/xercesImpl.jar \
100 --with-rhino=/usr/share/java/js.jar \
101 --with-abs-install-dir=$JVM_PREFIX \
102 $CONFIGURE_ARGS &&
103 make -j 1 ARCH_PREFIX= || exit 1
105 # NOTE: don't build with -j 4. Only build with -j 1 or tank will crash
106 # NOTE: IcedTea6 does not define an "install" target
108 rm -r -f $src/_pkg
110 local JVM_BUILDDIR
111 JVM_BUILDDIR=$src/openjdk.build/j2sdk-image
112 local JVM_DESTDIR
113 JVM_DESTDIR=$src/_pkg$JVM_PREFIX
115 mkdir -p $JVM_DESTDIR
116 cp -a $JVM_BUILDDIR/bin $JVM_DESTDIR
117 cp -a $JVM_BUILDDIR/lib $JVM_DESTDIR
119 mkdir -p $JVM_DESTDIR/jre
120 cp -a $JVM_BUILDDIR/jre/bin $JVM_DESTDIR/jre
121 cp -a $JVM_BUILDDIR/jre/lib $JVM_DESTDIR/jre
123 # Delete duplicated executables from the JDK bin
124 for jbin in $(ls -1 $JVM_DESTDIR/jre/bin) ; do
125 rm -f $JVM_DESTDIR/bin/$jbin
126 done
128 # Create symlinks for JDK binaries
129 mkdir -p $src/_pkg/usr/jdk-bin
130 for jbin in $(ls -1 $JVM_DESTDIR/bin) ; do
131 ln -s $JVM_PREFIX/bin/$jbin $src/_pkg/usr/jdk-bin/$jbin
132 done
134 # Create symlinks for JRE binaries
135 mkdir -p $src/_pkg/usr/jre-bin
136 for jbin in $(ls -1 $JVM_DESTDIR/jre/bin) ; do
137 ln -s $JVM_PREFIX/jre/bin/$jbin $JVM_DESTDIR/bin/$jbin
138 ln -s $JVM_PREFIX/jre/bin/$jbin $src/_pkg/usr/jre-bin
139 done
140 }
142 # Rules to gen a SliTaz package suitable for Tazpkg.
143 genpkg_rules()
144 {
145 mkdir -p $fs/usr/lib/jvm/java-icedtea
146 cp -a $_pkg/usr/lib/jvm/java-icedtea/bin $fs/usr/lib/jvm/java-icedtea
147 cp -a $_pkg/usr/lib/jvm/java-icedtea/lib $fs/usr/lib/jvm/java-icedtea
148 }