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

awm: needs GConf-dev
author Christophe Lincoln <pankso@slitaz.org>
date Fri Apr 27 15:57:34 2012 +0200 (2012-04-27)
parents 97048f202b98
children 3cc862ed2129
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 if [ -x /usr/bin/cook ]; then
50 for i in jdk6-jaxws jdk6-jaxp jdk6-jaf; do
51 cp $SOURCES_REPOSITORY/$i-$openjdk_version.zip drops || return 1
52 done
53 # openjdk-6-src is in BUILD_DEPENDS and must be build like jdk6-* pkgs.
54 cp $SOURCES_REPOSITORY/openjdk-6-src-$openjdk_version-$openjdk_date.tar.gz .
55 else
56 report open-bloc
57 for i in jdk6-jaxws jdk6-jaxp jdk6-jaf openjdk-6-src; do
58 tazwok get-src $i
59 cp $SOURCES_REPOSITORY/$i-$openjdk_version.zip drops
60 done
61 cp $SOURCES_REPOSITORY/openjdk-6-src-$openjdk_version-$openjdk_date.tar.gz .
62 report step "Running compilation"
63 fi
65 mem=$(free | awk '/Mem:/ { printf "%d\n",$2/1024 }')
66 cat > slitaz.sh <<EOT
67 # Busybox compatibility
68 #find -name Sanity.gmk | xargs sed -i 's/--sync -kP/-k/' Makefile
69 find -name Platform.gmk | xargs sed -i "s@MB_OF_MEMORY *:=.*free.*@MB_OF_MEMORY := $mem@" Makefile
70 EOT
71 sed -i -e 's|touch .*|&\n\tsh slitaz.sh|' \
72 -e 's/--check/-c/' \
73 -e 's/ln -sfv/ln -sf/' Makefile*
74 autoreconf &&
75 ./configure \
76 --prefix=/usr \
77 --disable-plugin \
78 --disable-docs \
79 --with-ecj \
80 --with-ecj-jar=/usr/share/java/ecj-$ECJ_VERSION.jar \
81 --with-gcj \
82 --with-gcj-home=/usr/lib/jvm/java-gcj \
83 --with-xalan2-jar=/usr/share/java/xalan.jar \
84 --with-xalan2-serializer-jar=/usr/share/java/serializer.jar \
85 --with-xerces2-jar=/usr/share/java/xercesImpl.jar \
86 --with-rhino=/usr/share/java/js.jar \
87 --with-abs-install-dir=$JVM_PREFIX \
88 $CONFIGURE_ARGS || return 1
89 make -j 1 ARCH_PREFIX= 2>&1 | sed s/ERROR/error/
91 echo "Copying needed files to install dir..."
92 rm -rf $DESTDIR
94 local JVM_BUILDDIR
95 JVM_BUILDDIR=$src/openjdk.build/j2sdk-image
96 local JVM_DESTDIR
97 JVM_DESTDIR=${DESTDIR}$JVM_PREFIX
98 echo "OpenJDK build : source/openjdk.build/j2sdk-image"
99 echo "OpenJDK install : install/$JVM_PREFIX"
101 echo "Copying JDK files : bin/ lib/"
102 mkdir -p $JVM_DESTDIR
103 cp -a $JVM_BUILDDIR/bin $JVM_DESTDIR
104 cp -a $JVM_BUILDDIR/lib $JVM_DESTDIR
106 echo "Copying JRE files : bin/ lib/"
107 mkdir -p $JVM_DESTDIR/jre
108 cp -a $JVM_BUILDDIR/jre/bin $JVM_DESTDIR/jre
109 cp -a $JVM_BUILDDIR/jre/lib $JVM_DESTDIR/jre
111 # Delete duplicated executables from the JDK bin
112 echo "Deleting duplicated files..."
113 for jbin in $(ls -1 $JVM_DESTDIR/jre/bin) ; do
114 rm -f $JVM_DESTDIR/bin/$jbin
115 done
117 # Create symlinks for JDK binaries
118 echo "Creating symlinks for JDK binaries..."
119 mkdir -p $DESTDIR/usr/jdk-bin
120 for jbin in $(ls -1 $JVM_DESTDIR/bin) ; do
121 ln -s $JVM_PREFIX/bin/$jbin $DESTDIR/usr/jdk-bin/$jbin
122 done
124 # Create symlinks for JRE binaries
125 echo "Creating symlinks for JRE binaries..."
126 mkdir -p $DESTDIR/usr/jre-bin
127 for jbin in $(ls -1 $JVM_DESTDIR/jre/bin) ; do
128 ln -s $JVM_PREFIX/jre/bin/$jbin $JVM_DESTDIR/bin/$jbin
129 ln -s $JVM_PREFIX/jre/bin/$jbin $DESTDIR/usr/jre-bin
130 done
131 if [ ! -x /usr/bin/cook ]; then
132 report close-bloc
133 fi
134 }
136 # Rules to gen a SliTaz package suitable for Tazpkg.
137 genpkg_rules()
138 {
139 mkdir -p $fs/usr/lib/jvm/java-icedtea
140 cp -a $_pkg/usr/lib/jvm/java-icedtea/bin $fs/usr/lib/jvm/java-icedtea
141 cp -a $_pkg/usr/lib/jvm/java-icedtea/lib $fs/usr/lib/jvm/java-icedtea
142 }