wok view icedtea6-jdk/receipt @ rev 8823

Put tazchroot stuff into wok
author Antoine Bodin <gokhlayeh@slitaz.org>
date Thu Feb 24 00:25:49 2011 +0100 (2011-02-24)
parents 9fc32aa2b184
children f1207145dcb3
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 nss"
19 TARBALL="$SOURCE-$VERSION.tar.gz"
20 WEB_SITE="http://www.iced-tea.org/"
21 WGET_URL="http://icedtea.classpath.org/download/source/$TARBALL"
23 openjdk_version="b20"
24 openjdk_date="21_jun_2010"
25 JAXWS="jdk6-jaxws-${openjdk_version}.zip"
26 JAXP="jdk6-jaxp-${openjdk_version}.zip"
27 JAF="jdk6-jaf-${openjdk_version}.zip"
28 OPENJDK="openjdk-6-src-${openjdk_version}-${openjdk_date}.tar.gz"
29 WGETJAXWS="https://jax-ws.dev.java.net/files/documents/4202/150724"
30 WGETJAXP="https://jaxp.dev.java.net/files/documents/913/150648"
31 WGETJAF="https://jax-ws.dev.java.net/files/documents/4202/150725"
32 WGETOPENJDK="http://download.java.net/openjdk/jdk6/promoted/${openjdk_version}"
34 # Rules to configure and make the package.
35 compile_rules()
36 {
37 # Limit memory usage
38 ulimit -v $(awk '/MemTotal/ { print int(($2*80)/100) }' < /proc/meminfo)
40 local JVM_PREFIX
41 JVM_PREFIX="/usr/lib/jvm/java-icedtea"
43 # NOTE: This build does not seem to work with ECJ 3.5
44 local ECJ_VERSION
45 ECJ_VERSION="3.6"
47 cd $src
48 mkdir drops
49 sed -i -e 's/mkdir -p drops/true/' -e 's/ jar xf/ fastjar xf/' Makefile*
50 [ -L /usr/bin/wget ] && tazpkg get-install wget --forced
51 for i in $JAXWS $JAXP $JAF ; do
52 if [ -f $SOURCES_REPOSITORY/$i ]; then
53 cp $SOURCES_REPOSITORY/$i drops
54 elif [ "$i" == "$JAXWS" ]; then
55 wget -O $SOURCES_REPOSITORY/$JAXWS --no-check-certificate "$WGETJAXWS/$JAXWS"
56 cp $SOURCES_REPOSITORY/$JAXWS drops
57 elif [ "$i" == "$JAXP" ]; then
58 wget -O $SOURCES_REPOSITORY/$JAXP --no-check-certificate "$WGETJAXP/$JAXP"
59 cp $SOURCES_REPOSITORY/$JAXP drops
60 elif [ "$i" == "$JAF" ]; then
61 wget -O $SOURCES_REPOSITORY/$JAF --no-check-certificate "$WGETJAF/$JAF"
62 cp $SOURCES_REPOSITORY/$JAF drops
63 fi
65 done
67 for i in $OPENJDK ; do
68 if [ -f $SOURCES_REPOSITORY/$i ]; then
69 cp $SOURCES_REPOSITORY/$i .
70 else
71 wget -O $SOURCES_REPOSITORY/$OPENJDK "$WGETOPENJDK/$OPENJDK"
72 cp $SOURCES_REPOSITORY/$OPENJDK .
73 fi
74 done
75 [ -L /usr/bin/find ] && tazpkg get-install findutils --forced
76 [ -L /usr/bin/diff ] && tazpkg get-install diffutils --forced
77 [ "$(readlink /usr/bin/awk)" == "gawk" ] ||
78 tazpkg get-install gawk --forced
79 [ -L /usr/bin/sed ] && tazpkg get-install sed --forced
80 mem=$(free | awk '/Mem:/ { printf "%d\n",$2/1024 }')
81 cat > slitaz.sh <<EOT
82 # Busybox compatibility
83 #find -name Sanity.gmk | xargs sed -i 's/--sync -kP/-k/' Makefile
84 find -name Platform.gmk | xargs sed -i "s@MB_OF_MEMORY *:=.*free.*@MB_OF_MEMORY := $mem@" Makefile
85 EOT
86 sed -i -e 's|touch .*|&\n\tsh slitaz.sh|' \
87 -e 's/--check/-c/' \
88 -e 's/ln -sfv/ln -sf/' Makefile*
89 autoreconf &&
90 ./configure \
91 --prefix=/usr \
92 --disable-plugin \
93 --disable-docs \
94 --with-ecj \
95 --with-ecj-jar=/usr/share/java/ecj-$ECJ_VERSION.jar \
96 --with-gcj \
97 --with-gcj-home=/usr/lib/jvm/java-gcj \
98 --with-xalan2-jar=/usr/share/java/xalan.jar \
99 --with-xalan2-serializer-jar=/usr/share/java/serializer.jar \
100 --with-xerces2-jar=/usr/share/java/xercesImpl.jar \
101 --with-rhino=/usr/share/java/js.jar \
102 --with-abs-install-dir=$JVM_PREFIX \
103 $CONFIGURE_ARGS &&
104 make -j 1 ARCH_PREFIX= || return 1
106 # NOTE: don't build with -j 4. Only build with -j 1 or tank will crash
107 # NOTE: IcedTea6 does not define an "install" target
109 rm -r -f $src/_pkg
111 local JVM_BUILDDIR
112 JVM_BUILDDIR=$src/openjdk.build/j2sdk-image
113 local JVM_DESTDIR
114 JVM_DESTDIR=$src/_pkg$JVM_PREFIX
116 mkdir -p $JVM_DESTDIR
117 cp -a $JVM_BUILDDIR/bin $JVM_DESTDIR
118 cp -a $JVM_BUILDDIR/lib $JVM_DESTDIR
120 mkdir -p $JVM_DESTDIR/jre
121 cp -a $JVM_BUILDDIR/jre/bin $JVM_DESTDIR/jre
122 cp -a $JVM_BUILDDIR/jre/lib $JVM_DESTDIR/jre
124 # Delete duplicated executables from the JDK bin
125 for jbin in $(ls -1 $JVM_DESTDIR/jre/bin) ; do
126 rm -f $JVM_DESTDIR/bin/$jbin
127 done
129 # Create symlinks for JDK binaries
130 mkdir -p $src/_pkg/usr/jdk-bin
131 for jbin in $(ls -1 $JVM_DESTDIR/bin) ; do
132 ln -s $JVM_PREFIX/bin/$jbin $src/_pkg/usr/jdk-bin/$jbin
133 done
135 # Create symlinks for JRE binaries
136 mkdir -p $src/_pkg/usr/jre-bin
137 for jbin in $(ls -1 $JVM_DESTDIR/jre/bin) ; do
138 ln -s $JVM_PREFIX/jre/bin/$jbin $JVM_DESTDIR/bin/$jbin
139 ln -s $JVM_PREFIX/jre/bin/$jbin $src/_pkg/usr/jre-bin
140 done
141 }
143 # Rules to gen a SliTaz package suitable for Tazpkg.
144 genpkg_rules()
145 {
146 mkdir -p $fs/usr/lib/jvm/java-icedtea
147 cp -a $_pkg/usr/lib/jvm/java-icedtea/bin $fs/usr/lib/jvm/java-icedtea
148 cp -a $_pkg/usr/lib/jvm/java-icedtea/lib $fs/usr/lib/jvm/java-icedtea
149 }