wok-next view icedtea6-jdk/receipt @ rev 13492

Add; mondo$
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Fri Oct 12 23:26:16 2012 +0200 (2012-10-12)
parents 0adddcc6b227
children b2a632fc9587
line source
1 # SliTaz package receipt.
3 PACKAGE="icedtea6-jdk"
4 SOURCE="icedtea6"
5 VERSION="1.9.7"
6 CATEGORY="development"
7 SHORT_DESC="A Free Software harness for OpenJDK."
8 MAINTAINER="rcx@zoominternet.net"
9 TARBALL="$SOURCE-$VERSION.tar.gz"
10 WEB_SITE="http://www.iced-tea.org/"
11 WGET_URL="http://icedtea.classpath.org/download/source/$TARBALL"
13 DEPENDS="icedtea6-jre xorg xorg-libXtst xorg-libXp cups"
14 BUILD_DEPENDS="gcc+gcj autoconf automake m4 diffutils gawk cups-dev wget cpio \
15 coreutils-file-special coreutils-file-summarize alsa-lib-dev file patch perl \
16 zip unzip findutils bzip2 tar glib-dev fastjar rhino ecj apache-ant jpeg-dev \
17 xalan-xerces-j gtk+-dev giflib-dev libpng-dev xorg-dev xorg-libXtst-dev \
18 xorg-libXp-dev xorg-dev-proto nss nss-dev jdk6-jaxws jdk6-jaxp jdk6-jaf \
19 openjdk-6-src"
21 # Note to icedtea6 updaters,
22 # You should check version into receipts:
23 # * jdk6-jaxws (version: $openjdk_version)
24 # * jdk6-jaxp (version: $openjdk_version)
25 # * jdk6-jaf (version: $openjdk_version)
26 # * openjdk-6-src (version: $openjdk_version-$openjdk_date)
27 # Theses receipts allow to have source tarballs in SRC.
28 openjdk_version="b20"
29 openjdk_date="21_jun_2010"
31 # Rules to configure and make the package.
32 compile_rules()
33 {
34 # Limit memory usage
35 ulimit -v $(awk '/MemTotal/ { print int(($2*80)/100) }' < /proc/meminfo)
37 local JVM_PREFIX
38 JVM_PREFIX="/usr/lib/jvm/java-icedtea"
40 # NOTE: This build does not seem to work with ECJ 3.5
41 local ECJ_VERSION
42 ECJ_VERSION="3.6"
44 cd $src
45 mkdir drops
46 sed -i -e 's/mkdir -p drops/true/' -e 's/ jar xf/ fastjar xf/' Makefile*
48 # Check than all sources files are available, or exit.
49 REPO=http://icedtea.classpath.org/download/drops
50 if [ -x /usr/bin/cook ]; then
51 for i in jdk6-jaxws jdk6-jaxp jdk6-jaf; do
52 [ -s $SOURCES_REPOSITORY/$i-$openjdk_version.zip ] ||
53 wget -P $SOURCES_REPOSITORY $REPO/$i-$openjdk_version.zip
54 cp $SOURCES_REPOSITORY/$i-$openjdk_version.zip drops || return 1
55 done
56 # openjdk-6-src is in BUILD_DEPENDS and must be build like jdk6-* pkgs.
57 [ -s $SOURCES_REPOSITORY/openjdk-6-src-$openjdk_version-$openjdk_date.tar.gz ] ||
58 wget -P $SOURCES_REPOSITORY $REPO/openjdk-6-src-$openjdk_version-$openjdk_date.tar.gz
59 cp $SOURCES_REPOSITORY/openjdk-6-src-$openjdk_version-$openjdk_date.tar.gz .
60 else
61 report open-bloc
62 for i in jdk6-jaxws jdk6-jaxp jdk6-jaf openjdk-6-src; do
63 tazwok get-src $i
64 cp $SOURCES_REPOSITORY/$i-$openjdk_version.zip drops
65 done
66 cp $SOURCES_REPOSITORY/openjdk-6-src-$openjdk_version-$openjdk_date.tar.gz .
67 report step "Running compilation"
68 fi
70 mem=$(free | awk '/Mem:/ { printf "%d\n",$2/1024 }')
71 cat > slitaz.sh <<EOT
72 # Busybox compatibility
73 #find -name Sanity.gmk | xargs sed -i 's/--sync -kP/-k/' Makefile
74 find -name Platform.gmk | xargs sed -i "s@MB_OF_MEMORY *:=.*free.*@MB_OF_MEMORY := $mem@" Makefile
75 EOT
76 sed -i -e 's|touch .*|&\n\tsh slitaz.sh|' \
77 -e 's/--check/-c/' \
78 -e 's/ln -sfv/ln -sf/' Makefile*
79 autoreconf &&
80 ./configure \
81 --prefix=/usr \
82 --disable-plugin \
83 --disable-docs \
84 --with-ecj \
85 --with-ecj-jar=/usr/share/java/ecj-$ECJ_VERSION.jar \
86 --with-gcj \
87 --with-gcj-home=/usr/lib/jvm/java-gcj \
88 --with-xalan2-jar=/usr/share/java/xalan.jar \
89 --with-xalan2-serializer-jar=/usr/share/java/serializer.jar \
90 --with-xerces2-jar=/usr/share/java/xercesImpl.jar \
91 --with-rhino=/usr/share/java/js.jar \
92 --with-abs-install-dir=$JVM_PREFIX \
93 $CONFIGURE_ARGS || return 1
94 make -j 1 ARCH_PREFIX= 2>&1 | sed s/ERROR/error/
96 echo "Copying needed files to install dir..."
97 rm -rf $DESTDIR
99 local JVM_BUILDDIR
100 JVM_BUILDDIR=$src/openjdk.build/j2sdk-image
101 local JVM_DESTDIR
102 JVM_DESTDIR=${DESTDIR}$JVM_PREFIX
103 echo "OpenJDK build : source/openjdk.build/j2sdk-image"
104 echo "OpenJDK install : install/$JVM_PREFIX"
106 echo "Copying JDK files : bin/ lib/"
107 mkdir -p $JVM_DESTDIR
108 cp -a $JVM_BUILDDIR/bin $JVM_DESTDIR
109 cp -a $JVM_BUILDDIR/lib $JVM_DESTDIR
111 echo "Copying JRE files : bin/ lib/"
112 mkdir -p $JVM_DESTDIR/jre
113 cp -a $JVM_BUILDDIR/jre/bin $JVM_DESTDIR/jre
114 cp -a $JVM_BUILDDIR/jre/lib $JVM_DESTDIR/jre
116 # Delete duplicated executables from the JDK bin
117 echo "Deleting duplicated files..."
118 for jbin in $(ls -1 $JVM_DESTDIR/jre/bin) ; do
119 rm -f $JVM_DESTDIR/bin/$jbin
120 done
122 # Create symlinks for JDK binaries
123 echo "Creating symlinks for JDK binaries..."
124 mkdir -p $DESTDIR/usr/jdk-bin
125 for jbin in $(ls -1 $JVM_DESTDIR/bin) ; do
126 ln -s $JVM_PREFIX/bin/$jbin $DESTDIR/usr/jdk-bin/$jbin
127 done
129 # Create symlinks for JRE binaries
130 echo "Creating symlinks for JRE binaries..."
131 mkdir -p $DESTDIR/usr/jre-bin
132 for jbin in $(ls -1 $JVM_DESTDIR/jre/bin) ; do
133 ln -s $JVM_PREFIX/jre/bin/$jbin $JVM_DESTDIR/bin/$jbin
134 ln -s $JVM_PREFIX/jre/bin/$jbin $DESTDIR/usr/jre-bin
135 done
136 if [ ! -x /usr/bin/cook ]; then
137 report close-bloc
138 fi
139 }
141 # Rules to gen a SliTaz package suitable for Tazpkg.
142 genpkg_rules()
143 {
144 mkdir -p $fs/usr/lib/jvm/java-icedtea
145 cp -a $_pkg/usr/lib/jvm/java-icedtea/bin $fs/usr/lib/jvm/java-icedtea
146 cp -a $_pkg/usr/lib/jvm/java-icedtea/lib $fs/usr/lib/jvm/java-icedtea
147 }