SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Has anyone built a package for 13.37 with the latest version of Oracle Java (6 Update 31)? I read a thread where AlienBob built an OpenJAVA package, but unfortunately I cannot use OpenJAVA. I've found a couple of places (work related) that do not work at all using OpenJAVA, therefore the reason for askign for Oracle Java. Any help will be appreciated.
Click here to see the post LQ members have rated as the most helpful post in this thread.
You'll need the contents from the jdk/jre source directory (i.e jre.SlackBuild, slack-desc, etc) from your favorite Slackware mirror and the jdk/jre .bin file from Oracle. Then run upgradepkg on the newly created package in /tmp.
Last edited by mats_b_tegner; 02-24-2012 at 11:57 AM.
Now you can create a patch for the SlackBuild to upgrade the version number(s), "source" package and add man pages (that was missing for the original SlackBuild):
Code:
$ cat << PATCHEND > jre.SlackBuild.patch
--- jre.SlackBuild.orig
+++ jre.SlackBuild
@@ -23,8 +23,8 @@
# Note that the slack-desc file mentions the JRE version (edit when upgrading)!
-VERSION=6u25
-DVER=1.6.0_25
+VERSION=7u4
+DVER=1.7.0_04
ARCH=i586
BUILD=\${BUILD:-1}
@@ -57,7 +57,7 @@
cd \$PKG
mkdir -p usr/lib\${LIBDIRSUFFIX}
cd usr/lib\${LIBDIRSUFFIX}
-yes yes | sh \$( ls --indicator-style none \$CWD/jre-\${VERSION}-linux-\${JAVA_ARCH}*.bin | tail -1) || exit 1
+tar xf \$CWD/jre-\${VERSION}-linux-\${JAVA_ARCH}.tar.gz || exit 1
mkdir -p \$PKG/etc/profile.d
for file in \$(ls \$CWD/profile.d/*) ; do
cat \$file | sed -e "s#lib/java#lib\${LIBDIRSUFFIX}/java#" \\
@@ -84,6 +84,13 @@
ln -sf ./java/lib/\${LIB_ARCH}/server/libjvm.so .
)
+# Move and compress any man pages
+if [ -d "\$PKG/usr/lib\${LIBDIRSUFFIX}/java/man" ]; then
+ mv \$PKG/usr/lib\${LIBDIRSUFFIX}/java/man \$PKG/usr
+ find \$PKG/usr/man -type f -exec gzip -9 {} \;
+ for i in \$( find \$PKG/usr/man -type l ) ; do ln -s \$( readlink \$i ).gz \$i.gz ; rm \$i ; done
+fi
+
mkdir -p \$PKG/install
cat \$CWD/slack-desc > \$PKG/install/slack-desc
PATCHEND
Now apply this patch.
If Slackware, then:
Code:
$ patch < jre.SlackBuild.patch
If Slackware64, then:
Code:
$ sed -i 's/^\( ARCH=\)i586/\1x86_64/' jre.SlackBuild.patch
$ patch < jre.SlackBuild.patch
Finally make jre.SlackBuild executable, run and install it:
I see that Oracle Java updated to 1.7.0_05 and I've realised that manually patching jre.SlackBuild again and again for every update is boring. So I wrote a short shell script to do it. Nothing fancy but I figured I'd post it here nonetheless as others must also be encountering this issue. Save the code below into an appropriately named file (e.g. updatejreslackbuild.sh) in the same directory as jre.SlackBuild (or an empty directory, as it will fetch jre.SlackBuild and associated files). Then run it and it will update jre.SlackBuild for the latest available version (along with downloading the binary package from Oracle).
Code:
#!/bin/sh
ARCH=${ARCH:-$(uname -m)}
case "$ARCH" in
i?86) ARCH=i586 ;;
*) ARCH=$ARCH ;;
esac
if [ "$ARCH" = "i586" ]; then
JAVA_ARCH=i586
PKGURL=$(wget -qO- http://java.com/en/download/manual.jsp | grep 'Download Java software for Linux"' | head -n1 | sed -rn 's@.*href="(http.*BundleId=[0-9]+)" .*@\1@p')
elif [ "$ARCH" = "x86_64" ]; then
JAVA_ARCH=x64
PKGURL=$(wget -qO- http://java.com/en/download/manual.jsp | grep 'Download Java software for Linux x64"' | head -n1 | sed -rn 's@.*href="(http.*BundleId=[0-9]+)" .*@\1@p')
else
echo "The architecture $ARCH is not provided as a binary Java (jre) package; exiting"
exit 1
fi
if [ -z "$PKGURL" ]; then
echo "Could not work out the download link for the latest Java (jre) package; exiting"
exit 1
fi
SOURCE=$(wget --spider "$PKGURL" 2>&1 | grep '^Location' | sed -rn 's@.*File=(jre-.*\.tar.gz)&.*@\1@p')
if [ -z "$SOURCE" ]; then
echo "Could not work out the name for the binary package; exiting"
exit 1
fi
if [ ! -e "$SOURCE" ]; then
echo "Fetching $SOURCE"
if ! wget "$PKGURL" -O "$SOURCE"; then
echo "There were problems downloading $SOURCE"
exit 1
fi
fi
VERSION=$(/bin/ls -tr jre-*-linux-$JAVA_ARCH.tar.gz | tail -n1 | cut -d- -f2)
if [ -z "$VERSION" ]; then
echo "Could not work out the short jre version number; exiting"
exit 1
fi
DVER=$(tar tf jre-$VERSION-linux-$JAVA_ARCH.tar.gz | head -n 1 | sed -r 's@jre([0-9_\.]+)/.*@\1@')
if [ -z "$DVER" ]; then
echo "Could not work out the long jre version number; exiting"
exit 1
fi
if [ ! -e jre.SlackBuild ]; then
echo "Fetching jre.SlackBuild"
if ! wget -r -np -nH -Rbin --cut-dirs=6 ftp://ftp.osuosl.org/pub/slackware/slackware-13.37/source/l/jre/; then
echo "There were problems fetching the original jre.SlackBuild (and associated files) from:"
echo "ftp://ftp.osuosl.org/pub/slackware/slackware-13.37/source/l/jre/"
exit 1
fi
chmod +x jre.SlackBuild
fi
sed -i.previous "s/^VERSION=.*/VERSION=$VERSION/;s/^DVER=.*/DVER=$DVER/;s/^ARCH=.*/ARCH=$ARCH/;s/JAVA_ARCH:-i586/JAVA_ARCH:-$JAVA_ARCH/;s@^yes yes.*@tar xf \$CWD/jre-\$\{VERSION\}-linux-\$\{JAVA_ARCH\}.tar.gz || exit 1@" jre.SlackBuild
if [ "$?" = "0" ]; then
chmod -x jre.SlackBuild.previous
echo "jre.SlackBuild has been updated to build Oracle Java version $VERSION ($DVER) for $ARCH"
fi
I see that Oracle Java updated to 1.7.0_05 and I've realised that manually patching jre.SlackBuild again and again for every update is boring. So I wrote a short shell script to do it. Nothing fancy but I figured I'd post it here nonetheless as others must also be encountering this issue. Save the code below into an appropriately named file (e.g. updatejreslackbuild.sh) in the same directory as jre.SlackBuild (or an empty directory, as it will fetch jre.SlackBuild and associated files). Then run it and it will update jre.SlackBuild for the latest available version (along with downloading the binary package from Oracle).
Tested here:
I placed the file in a folder named "New Folder" and it would not run.
Changed the folder name to "New_Folder" and it ran.
The resulting slackbuild built the package okay but at the end I got this warning
(not sure why - so I did not install):
WARNING: zero length file usr/lib/java/lib/security/trusted.libraries
I placed the file in a folder named "New Folder" and it would not run.
Changed the folder name to "New_Folder" and it ran.
My script should run just fine in a directory with a space in the name, however jre.SlackBuild will not as it is missing appropriate quoting in some places. This is actually the case with quite a few SlackBuild scripts, so I would generally avoid spacing in directory names anyway.
Last edited by ruario; 06-19-2012 at 02:04 AM.
Reason: Added the word 'avoid' so that my final sentance makes sense! ;)
My script should run just fine in a directory with a space in the name, however jre.SlackBuild will not as it is missing appropriate quoting in some places. This is actually the case with quite a few SlackBuild scripts, so I would generally spacing in directory names anyway.
Correct. My bad. After I wrote my original post...I read it again and noticed it was written as if your script was the issue.
So I went back and edited the post to make it clear that the issue was with the slackbuild script but I forgot to edit both parts. Sorry.
My script should run just fine in a directory with a space in the name, however jre.SlackBuild will not as it is missing appropriate quoting in some places. This is actually the case with quite a few SlackBuild scripts, so I would generally avoid spacing in directory names anyway.
Using spaces in directory names is not supported by Slackware's scripts. I also do not support it in any of my own scripts. I even have a script (massconvert32.sh) which aborts when it detects a space in the directory name.
Spaces in directory names is an abomination introduced by MS Windows and lazy-ass GUI programs. Real UNIX men avoid space.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.