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.
Having been away from slackware/linux for a while I got a question concerning jdk-1_5_0_05. For educational reasons I need to use the jdk-1_5_0_05 rather than jdk-1_5_0_04 which is included in 10.2. Preferring installing from packages I wonder how this is possible as i've not been able to find a .tgz with the latest release. Any suggestions on how I get the .bin from sun converted to a .tgz would be greatly appreciated. Thanks in advance.
That's a bad package to convert from RPM. Your environment variables won't be setup that way and it won't work without manual tweaking.
Code:
#!/bin/sh
CWD=`pwd`
TMP=/tmp
PKG=$TMP/package-jdk
VERSION=1_5_0_05
DVER=1.5.0_05
ARCH=i586
BUILD=1
if [ -r $CWD/jdk-${VERSION}-linux-${ARCH}.bin ]; then
true
else
echo
echo "I can't locate the Java .bin file... Make sure it resides"
echo "in the same directory as this script and try again."
echo
exit
fi
if [ -s /var/log/packages/jre-1* ]; then
echo
echo "It seems that you have the Java Runtime Environment installed already."
echo "Make sure you un-install it before installing this package..."
echo
sleep 7
fi
rm -rf $PKG
mkdir -p $PKG/usr/lib
mkdir -p $PKG/etc/profile.d
mkdir -p $PKG/install
cd $PKG/usr/lib
sh $CWD/jdk-${VERSION}-linux-${ARCH}.bin
chown -R root.root $PKG
( cd $PKG
find . -perm 664 -exec chmod 644 {} \;
find . -perm 600 -exec chmod 644 {} \;
find . -perm 444 -exec chmod 644 {} \;
find . -perm 400 -exec chmod 644 {} \;
find . -perm 440 -exec chmod 644 {} \;
find . -perm 777 -exec chmod 755 {} \;
find . -perm 775 -exec chmod 755 {} \;
find . -perm 511 -exec chmod 755 {} \;
find . -perm 711 -exec chmod 755 {} \;
find . -perm 555 -exec chmod 755 {} \; )
( cd $PKG/usr/lib
mv jdk${DVER} jdk-${DVER}
ln -sf jdk-${DVER} java )
cat << EOF > $PKG/install/doinst.sh
#!/bin/sh
#
# Browser Check:
if [ -d /usr/lib/mozilla/plugins ]; then
( cd /usr/lib/mozilla/plugins
ln -sf ../../jdk-${DVER}/jre/plugin/i386/ns7/libjavaplugin_oji.so libjavaplugin_oji.so )
fi
if [ -d /usr/lib/firefox/plugins ]; then
( cd /usr/lib/firefox/plugins
ln -sf ../../jdk-${DVER}/jre/plugin/i386/ns7/libjavaplugin_oji.so libjavaplugin_oji.so )
fi
# Begin Symlinks:
EOF
cat << EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|' on
# the right side marks the last column you can put a character in. You must make
# exactly 11 lines for the formatting to be correct. It's also customary to
# leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
jdk: jdk (Java Development Kit)
jdk:
jdk: The Java 2 SDK software includes tools for developing, testing, and
jdk: running programs written in the Java programming language. This
jdk: package contains everything you need to run Java(TM).
jdk:
jdk: For additional information, refer to this Sun Microsystems web page:
jdk: http://java.sun.com/
jdk:
jdk:
jdk:
EOF
cat << EOF > $PKG/etc/profile.d/jdk.sh
#!/bin/sh
export JAVA_HOME=/usr/lib/java
export MANPATH="*MANPATH:/usr/lib/java/man"
export PATH="*PATH:/usr/lib/java/jre/bin"
EOF
sed -i 's@*@$@g' $PKG/etc/profile.d/jdk.sh
chmod 755 $PKG/etc/profile.d/jdk.sh
cd $PKG
makepkg -l y -c n $TMP/jdk-$DVER-$ARCH-$BUILD.tgz
Yea, it's just a modified .SlackBuild script. It does some hand-holding at the very top, creates the misc files for you (slack-desc, doinst.sh and jdk.sh) and sets up your browser java plugin instead of having that as a seperate package like Pat does (the plugin won't be indexed by pkgtool, tho it would be easy to do from a doinst.sh). It also doesn't make a .csh file in profile.d but who uses tcsh/csh anyway?
If you have problems, do it yourself....
I don't like the whole license argement thing interupting the build process but I don't think there is a way around that...
Well, you just have to download the self-extracting package from sun.java.com, extract it, put the extraced folder in /usr/lib, and then change /usr/lib/java to point to the new folder. That's all.
Well, I think the whole idea was for it to be cataloged by pkgtool. But yea, you could do that and then add the jdk.sh environment variables by hand to your /etc/profile or /etc/profile.d/.
Without $JAVA_HOME $MANPATH and $PATH appended to, programs that rely on Java aren't going to work. The .bin doesn't do that for you.
Originally posted by jong357 Well, I think the whole idea was for it to be cataloged by pkgtool. But yea, you could do that and then add the jdk.sh environment variables by hand to your /etc/profile or /etc/profile.d/.
Without $JAVA_HOME $MANPATH and $PATH appended to, programs that rely on Java aren't going to work. The .bin doesn't do that for you.
You don't remove the old Java package, and therefore /etc/profile.d/jre.sh still fixes all your variables! They all point to /usr/lib/java
This looks interresting but how would i use this slackbuild script to install java on my slack?
Kinda lame here, pretty new to slack...
Thanks in advance,
Ivo Encarnacao.
Quote:
Originally posted by jong357 That's a bad package to convert from RPM. Your environment variables won't be setup that way and it won't work without manual tweaking.
Code:
#!/bin/sh
CWD=`pwd`
TMP=/tmp
PKG=$TMP/package-jdk
VERSION=1_5_0_05
DVER=1.5.0_05
ARCH=i586
BUILD=1
if [ -r $CWD/jdk-${VERSION}-linux-${ARCH}.bin ]; then
true
else
echo
echo "I can't locate the Java .bin file... Make sure it resides"
echo "in the same directory as this script and try again."
echo
exit
fi
if [ -s /var/log/packages/jre-1* ]; then
echo
echo "It seems that you have the Java Runtime Environment installed already."
echo "Make sure you un-install it before installing this package..."
echo
sleep 7
fi
rm -rf $PKG
mkdir -p $PKG/usr/lib
mkdir -p $PKG/etc/profile.d
mkdir -p $PKG/install
cd $PKG/usr/lib
sh $CWD/jdk-${VERSION}-linux-${ARCH}.bin
chown -R root.root $PKG
( cd $PKG
find . -perm 664 -exec chmod 644 {} \;
find . -perm 600 -exec chmod 644 {} \;
find . -perm 444 -exec chmod 644 {} \;
find . -perm 400 -exec chmod 644 {} \;
find . -perm 440 -exec chmod 644 {} \;
find . -perm 777 -exec chmod 755 {} \;
find . -perm 775 -exec chmod 755 {} \;
find . -perm 511 -exec chmod 755 {} \;
find . -perm 711 -exec chmod 755 {} \;
find . -perm 555 -exec chmod 755 {} \; )
( cd $PKG/usr/lib
mv jdk${DVER} jdk-${DVER}
ln -sf jdk-${DVER} java )
cat << EOF > $PKG/install/doinst.sh
#!/bin/sh
#
# Browser Check:
if [ -d /usr/lib/mozilla/plugins ]; then
( cd /usr/lib/mozilla/plugins
ln -sf ../../jdk-${DVER}/jre/plugin/i386/ns7/libjavaplugin_oji.so libjavaplugin_oji.so )
fi
if [ -d /usr/lib/firefox/plugins ]; then
( cd /usr/lib/firefox/plugins
ln -sf ../../jdk-${DVER}/jre/plugin/i386/ns7/libjavaplugin_oji.so libjavaplugin_oji.so )
fi
# Begin Symlinks:
EOF
cat << EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|' on
# the right side marks the last column you can put a character in. You must make
# exactly 11 lines for the formatting to be correct. It's also customary to
# leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
jdk: jdk (Java Development Kit)
jdk:
jdk: The Java 2 SDK software includes tools for developing, testing, and
jdk: running programs written in the Java programming language. This
jdk: package contains everything you need to run Java(TM).
jdk:
jdk: For additional information, refer to this Sun Microsystems web page:
jdk: http://java.sun.com/
jdk:
jdk:
jdk:
EOF
cat << EOF > $PKG/etc/profile.d/jdk.sh
#!/bin/sh
export JAVA_HOME=/usr/lib/java
export MANPATH="$MANPATH:/usr/lib/java/man"
export PATH="$PATH:/usr/lib/java/jre/bin"
EOF
chmod 755 $PKG/etc/profile.d/jdk.sh
cd $PKG
makepkg -l y -c n $TMP/jdk-$DVER-$ARCH-$BUILD.tgz
I just noticed something with that script. I don't ussually make all the extra files from within the build script. I thought it would be nice to do it here on LQ, just because it cuts down on the steps needed. The problem is with jdk.sh. If you use the script, it turns out like this:
They both do the same thing so it will still work, but man that looks like hell. Maybe I'll fix it, maybe I won't. Atleast it has been mentioned...
To use that script ivoencarnacao, copy/paste all of it into a text editor and save it as "jdk.SlackBuild". Then throw the JDK .bin file in the same directory as the script. The .bin file should be called "jdk-1_5_0_05-linux-i586.bin". Then open up a terminal and:
Code:
cd /path/to/jdk.SlackBuild
sh jdk.SlackBuild
When it's done, you'll have a Slackware package sitting it /tmp that you can install by:
Code:
installpkg /tmp/name-of-slackware-package.tgz
Thats it. You can 'removepkg' and 'upgradepkg' as well after you install it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.