Rebuilding Sun 1.6.0_04 Using JPackage.org "nosrc" rpm

Support for the other architectures (X86_64, IA-64, and PowerPC)

Rebuilding Sun 1.6.0_04 Using JPackage.org "nosrc" rpm

Postby BobCochran » 2008/02/16 03:44:42

[color=0000FF][font=Arial]After downloading this file

java-1.6.0-sun-1.6.0.4-1jpp.nosrc.rpm

and installing it, and separately providing this file in the redhat/SOURCES directory:

jdk-6u4-linux-x64.bin <-- came from java.sun.com

I was able build new x86_64 rpms from it, specifically these:

[rlcl@deafeng2 ~]$ ls -al redhat/RPMS/x86_64
total 69452
drwxr-xr-x 2 rlcl rlcl 4096 Feb 15 21:33 .
drwxrwxr-x 3 rlcl rlcl 4096 Feb 15 21:03 ..
-rw-rw-r-- 1 rlcl rlcl 35253361 Feb 15 21:33 java-1.6.0-sun-1.6.0.4-1jpp.x86_64.rpm
-rw-rw-r-- 1 rlcl rlcl 36643 Feb 15 21:33 java-1.6.0-sun-alsa-1.6.0.4-1jpp.x86_64.rpm
-rw-rw-r-- 1 rlcl rlcl 5619576 Feb 15 21:33 java-1.6.0-sun-demo-1.6.0.4-1jpp.x86_64.rpm
-rw-rw-r-- 1 rlcl rlcl 11078580 Feb 15 21:33 java-1.6.0-sun-devel-1.6.0.4-1jpp.x86_64.rpm
-rw-rw-r-- 1 rlcl rlcl 1259715 Feb 15 21:33 java-1.6.0-sun-fonts-1.6.0.4-1jpp.x86_64.rpm
-rw-rw-r-- 1 rlcl rlcl 28422 Feb 15 21:33 java-1.6.0-sun-jdbc-1.6.0.4-1jpp.x86_64.rpm
-rw-rw-r-- 1 rlcl rlcl 17728184 Feb 15 21:33 java-1.6.0-sun-src-1.6.0.4-1jpp.x86_64.rpm

Attempting to install them all results in these rpm errors:[/color]
[color=ff0000]
[root@deafeng2 ~]# rpm -Uvh --test /home/rlcl/redhat/RPMS/x86_64/java-1.6.0-sun-*
error: Failed dependencies:
libXp.so.6()(64bit) is needed by java-1.6.0-sun-1.6.0.4-1jpp.x86_64
/usr/lib64/libodbcinst.so is needed by java-1.6.0-sun-jdbc-1.6.0.4-1jpp.x86_64
libodbcinst.so()(64bit) is needed by java-1.6.0-sun-jdbc-1.6.0.4-1jpp.x86_64
libodbc.so()(64bit) is needed by java-1.6.0-sun-jdbc-1.6.0.4-1jpp.x86_64[/color]
[color=0000ff]
Does anyone know where I can find the missing files? Or is the spec file from Jpackage.org out of date with respect to JDK 1.6, update 4?

Finally, suppose I had installed these files successfully. Would they have installed correctly under the Java alternatives system (since I am not installing a "sun-compat" package with them)?

Thanks

Bob Cochran
Greenbelt, Maryland, USA


[/font][/color]
BobCochran
 
Posts: 18
Joined: 2006/09/23 22:30:35

Rebuilding Sun 1.6.0_04 Using JPackage.org "nosrc" rpm

Postby jowa » 2008/02/16 10:07:15

[...]
Attempting to install them all results in these rpm errors:[/color]
[color=ff0000]
[root@deafeng2 ~]# rpm -Uvh --test /home/rlcl/redhat/RPMS/x86_64/java-1.6.0-sun-*
error: Failed dependencies:
libXp.so.6()(64bit) is needed by java-1.6.0-sun-1.6.0.4-1jpp.x86_64
/usr/lib64/libodbcinst.so is needed by java-1.6.0-sun-jdbc-1.6.0.4-1jpp.x86_64
libodbcinst.so()(64bit) is needed by java-1.6.0-sun-jdbc-1.6.0.4-1jpp.x86_64
libodbc.so()(64bit) is needed by java-1.6.0-sun-jdbc-1.6.0.4-1jpp.x86_64[/color]
[color=0000ff]
Does anyone know where I can find the missing files? Or is the spec file from Jpackage.org out of date with respect to JDK 1.6, update 4?
The spec file is probably fine. You're just missing a few packages on your machine that these packages depend on.

You can have the Yum package manager resolve those dependencies for you by installing the packages using yum:
Code: Select all
yum localinstall /home/rlcl/redhat/RPMS/x86_64/java-1.6.0-sun-*

I'm not sure if yum localinstall accepts wildcards like that. If not, try
Code: Select all
ls /home/rlcl/redhat/RPMS/x86_64/java-1.6.0-sun-* | xargs yum localinstall


Finally, suppose I had installed these files successfully. Would they have installed correctly under the Java alternatives system (since I am not installing a "sun-compat" package with them)?
No idea. Check afterwards using
Code: Select all
alternatives --config java
and see if it looks OK.
jowa
 
Posts: 75
Joined: 2005/07/10 14:42:39

Re: Rebuilding Sun 1.6.0_04 Using JPackage.org "nosrc" rpm

Postby akagalford » 2009/02/11 18:00:37

Same issue still exist even with the later versions of Java, currently building the same with Java 1.60 u11 and getting the same errors with the java-jdbc package.

I followed the instructions on how to build the RPM packages from http://wiki.centos.org/HowTos/JavaOnCen ... 2bca6eae5c

When attempting to install the java-1.6.0-sun-jdbc-1.6.0.11-1jpp.x86_64.rpm package the following error is given during install:

error: Failed dependencies:
libodbcinst.so()(64bit) is needed by java-1.6.0-sun-jdbc-1.6.0.11-1jpp.x86_64
libodbc.so()(64bit) is needed by java-1.6.0-sun-jdbc-1.6.0.11-1jpp.x86_64

Yet a quick check for these files shows that they are there. These files are part of unixODBC and are installed in both x86 and x86_64 on my system. (files exsist in both /usr/lib and /usr/lib64)

Anyone know how to fix this? Haven't found a clear solution as of yet.
akagalford
 
Posts: 6
Joined: 2007/09/05 16:54:42
Location: Boulder, CO

Re: Rebuilding Sun 1.6.0_04 Using JPackage.org "nosrc" rpm

Postby jowa » 2009/02/23 14:11:59

Option 1 - the quick fix
First, manually install the unixODBC and unixODBC-devel packages.:
Code: Select all
$ yum install unixODBC unixODBC-devel

Next, Install the JDBC package using --nodeps parameter with rpm:
Code: Select all
rpm -ivh --nodeps java-1.6.0-sun-jdbc-1.6.0.11-1jpp.x86_64.rpm


Option 2 - "fix" the problem
To stop the dependency problem you'll have to alter the SPEC file that's used when building the RPM packages.
In order to do so, you'll first have to install the source RPM into your own RPM build tree (Which should be at ~/rpmbuild). As your normal user (ie not root):
Code: Select all
rpm -ivh java-1.6.0-sun-1.6.0.10-1jpp.nosrc.rpm

Next, edit the file ~/rpmbuild/SPECS/java-1.6.0-sun.spec in your favourite text editor. Scroll down to the part that says:
Code: Select all
%package        jdbc
Summary:        JDBC/ODBC bridge driver for %{name}
Group:          Development/Libraries/Java
Requires:       %{name} = %{epoch}:%{version}-%{release}
Requires:       %{_libdir}/libodbc.so, %{_libdir}/libodbcinst.so
We'll add a directive there that will stop the auto-generation of "requires" info for the jdbc subpackage:
Code: Select all
%package        jdbc
Summary:        JDBC/ODBC bridge driver for %{name}
Group:          Development/Libraries/Java
[b][color=55BB00]AutoReqProv:   no[/color][/b]
Requires:       %{name} = %{epoch}:%{version}-%{release}
Requires:       %{_libdir}/libodbc.so, %{_libdir}/libodbcinst.so
Now rebuild the JDK fileset again:
Code: Select all
rpmbuild -bb ~/rpmbuild/SPECS/java-1.6.0-sun.spec
Once that's done, you'll have a JDBC package that can be installed without the missing dependencies.
jowa
 
Posts: 75
Joined: 2005/07/10 14:42:39

Re: Rebuilding Sun 1.6.0_04 Using JPackage.org "nosrc" rpm

Postby bchapman » 2009/03/10 17:45:09

Excellent solution!

I cobbled together a more complicated one based on other posts; basically, you change the way that the RPMs look for the ODBC driver - here's a link, although I would certainly go with either of the solutions mentioned above in preference to the one that I describe: http://tinyurl.com/b5b37d

Thanks!

Ben Chapman
bchapman
 
Posts: 1
Joined: 2009/03/10 17:31:21

Re: Rebuilding Sun 1.6.0_04 Using JPackage.org "nosrc" rpm

Postby linx » 2010/05/30 23:38:02

Will setting the AutoReqProv to "no" in the spec file make it so the jdk can't find the odbc stuff when it actually needs it when running the jdk later? I'm trying to decide if I should just change the AutoReqProv or if I need to do the more complex spec file change described elsewhere.

The more complex spec file change says to add the following (as well as some other things I don't list here):

Code: Select all
# Kludge to remove bogus odbc dependencies
cat <<EOF >%{our_find_requires}
#!/bin/sh
echo unixODBC
exec %{__find_requires} | /bin/egrep -v ‘^(libodbc(inst)?\.so)$’
exit 0
EOF
chmod +x %{our_find_requires}
%define __find_requires %{our_find_requires}


I am using the 1.6.0.14 spec file from the jpackage no src rpm and this is what is in that spec file under %prep:

Code: Select all
%prep
rm -rf $RPM_BUILD_DIR/%{toplevel_dir}
export MORE=10000
sh %{SOURCE0} <<EOF >/dev/null
yes
EOF
%setup -T -D -n %{toplevel_dir}
chmod -R go=u-w *
chmod -R u+w *


So I am not sure if I need to replace some of that code or just add it after the last line of this %prep section. Has anyone done this before?
linx
 
Posts: 1
Joined: 2010/05/30 23:23:41


Return to CentOS 5 - X86_64,s390(x) and PowerPC Support

Who is online

Users browsing this forum: No registered users and 1 guest