building java rpm

From: Peter Lesterhuis (
Date: 06/25/05

  • Next message: Richard E Miles: "Re: How can I change my file to allow sending mail from localhost.localdomain"
    Date: Sat, 25 Jun 2005 22:40:51 +0200

    I am trying to build a java rpm based on the nosrc.rpm from
    and the source from (the
    I have never built rpms before; however I did some homework by reading
    the tutorial from Guru Labs on this subject.

    It seems like I have to make some adjustments in the specs-file. The
    first 2 errors after <rpmbuild -ba specfile> I could solve myself, but
    the next one is too complicated for me to understand.

    $ rpmbuild -ba java-1.5.0-sun.spec
    Executing(%prep): /bin/sh -e /home/peter/rpmbuild/tmp/rpm-tmp.27537
    + umask 022
    + cd /home/peter/rpmbuild/BUILD
    + rm -rf /home/peter/rpmbuild/BUILD/jre1.5.0_03
    + export MORE=10000
    + MORE=10000
    + sh /home/peter/rpmbuild/SOURCES/jre-1_5_0_03-linux-i586.bin
    + cd /home/peter/rpmbuild/BUILD
    + cd jre1.5.0_03
    ++ /usr/bin/id -u
    + '[' 500 = 0 ']'
    ++ /usr/bin/id -u
    + '[' 500 = 0 ']'
    + /bin/chmod -Rf a+rX,u+w,g-w,o-w .
    + chmod -R go=u-w bin CHANGES COPYRIGHT javaws lib LICENSE man plugin
    + chmod -R u+w bin CHANGES COPYRIGHT javaws lib LICENSE man plugin
    ++ echo
    ++ sed 's|/usr/lib/jvm/java-1.5.0-sun-|jre|'
    + _OJI_PLUGIN=jre/plugin/i386/ns7/
    + '[' '!' -f jre/plugin/i386/ns7/ ']'
    + exit 1
    error: Bad exit status from /home/peter/rpmbuild/tmp/rpm-tmp.27537 (%prep)

    RPM build errors:
        Bad exit status from /home/peter/rpmbuild/tmp/rpm-tmp.27537 (%prep)

    The /home/peter/rpmbuild/tmp/rpm-tmp.27537 is a part %prep section of
    the specs-file. The (first part of the) spec-file looks like this:

    %define section non-free

    %define origin sun
    %define priority 1503
    %define javaver 1.5.0
    %define cvsver 1_5_0
    %define buildver 03

    %define name java-%{javaver}-%{origin}
    %define release 1jpp

    # TODO: Think about using conditionals for version variants.

    %define version %{javaver}.%{buildver}
    #define version %{javaver}

    %define cvsversion %{cvsver}_%{buildver}
    #define cvsversion %{cvsver}

    %define javaws_ver %{javaver}
    %define javaws_version %{cvsversion}

    %define toplevel_dir jre%{javaver}_%{buildver}
    #define toplevel_dir jdk%{javaver}

    %define sdklnk java-%{javaver}-%{origin}
    %define jrelnk jre-%{javaver}-%{origin}
    %define sdkdir %{name}-%{version}
    %define jredir %{sdkdir}/jre
    %define sdkbindir %{_jvmdir}/%{sdklnk}/bin
    %define sdklibdir %{_jvmdir}/%{sdklnk}/lib
    %define jrebindir %{_jvmdir}/%{jrelnk}/bin
    %define jvmjardir %{_jvmjardir}/%{name}-%{version}

    %define x11bindir %{_prefix}/X11R6/bin
    %define x11encdir %{_prefix}/X11R6/lib/X11/fonts/encodings
    %define fontconfigdir %{_sysconfdir}/fonts
    %define fontdir %{_datadir}/fonts/java
    %define xsldir %{_datadir}/xml/%{name}-%{version}

    %ifarch %ix86
    %define target_cpu i586
    %define pluginname
    %ifarch x86_64%define target_cpu amd64

    %define cgibindir %{_var}/www/cgi-bin

    # Avoid RPM 4.2+'s internal dep generator, it may produce bogus
    # Provides/Requires here.
    %define _use_internal_dependency_generator 0

    # This prevents aggressive stripping.
    %define debug_package %{nil}

    Name: %{name}
    Version: %{version}
    Release: %{release}
    Epoch: 0
    Summary: Java Runtime Environment for %{name}
    License: Sun Binary Code License
    Group: Development/Interpreters
    Vendor: JPackage Project
    Distribution: JPackage
    Source2: %{name}-unregister-java-fonts.xsl
    NoSource: 0
    Provides: jre-%{javaver}-%{origin} = %{epoch}:%{version}-%{release}
    Provides: jre-%{origin} = %{epoch}:%{version}-%{release}
    Provides: jre-%{javaver}, java-%{javaver}, jre = %{epoch}:%{javaver}
    Provides: java-%{origin} = %{epoch}:%{version}-%{release}
    Provides: java = %{epoch}:%{javaver}
    Requires: /usr/sbin/update-alternatives
    Requires: jpackage-utils >= 0:1.5.38
    Conflicts: kaffe
    BuildArch: i586 x86_64
    BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
    BuildRequires: jpackage-utils >= 0:1.5.38, sed, %{_bindir}/perl
    %ifnarch x86_64
    Provides: javaws = %{epoch}:%{javaws_ver}
    %endifProvides: jdbc-stdext = %{epoch}:3.0, jdbc-stdext =
    Provides: java-sasl = %{epoch}:%{version}
    %ifnarch x86_64
    Obsoletes: javaws-menu

    This package contains the Java Runtime Environment for %{name}

    %package devel
    Summary: Java Development Kit for %{name}
    Group: Development/Compilers
    Requires: /usr/sbin/update-alternatives
    Provides: java-sdk-%{javaver}-%{origin} =
    Provides: java-sdk-%{origin} = %{epoch}:%{version}-%{release}
    Provides: java-sdk-%{javaver}, java-sdk = %{epoch}:%{javaver}
    Provides: java-devel-%{origin} = %{epoch}:%{version}-%{release}
    Provides: java-%{javaver}-devel, java-devel = %{epoch}:%{javaver}
    Requires: %{name} = %{epoch}:%{version}-%{release}

    %description develwritten using the Java programming language.

    %package src
    Summary: Source files for %{name}
    Group: Development/Interpreters
    Requires: %{name} = %{epoch}:%{version}-%{release}

    %description src
    This package contains source files for %{name}.

    %package demo
    Summary: Demonstration files for %{name}
    Group: Development/Interpreters
    Requires: %{name} = %{epoch}:%{version}-%{release}
    # Without this a requirement on is added which
    # is not in the main java package. is but not "_g".
    AutoReq: 0
    Summary: Browser plugin files for %{name}
    Group: Internet/WWW/Browsers
    Requires: %{name} = %{epoch}:%{version}-%{release}
    Requires: %{_bindir}/find, sed
    Provides: java-plugin = %{epoch}:%{javaver},
    java-%{javaver}-plugin = %{epoch}:%{version}
    Conflicts: java-%{javaver}-ibm-plugin, java-%{javaver}-blackdown-plugin
    Conflicts: java-%{javaver}-bea-plugin
    Obsoletes: java-1.3.1-plugin, java-1.4.0-plugin, java-1.4.1-plugin,

    %description plugin
    This package contains browser plugin files for %{name}.
    Note! This package supports browsers built with GCC 3.2 and later.

    %package fonts
    Summary: TrueType fonts for %{origin} JVMs
    Group: Text Processing/Fonts
    Requires: %{name} = %{epoch}:%{version}-%{release},
    Requires: %{_sbindir}/chkfontpath, %{x11bindir}/mkfontdir, mktemp
    Requires: %{_bindir}/xsltproc, %{_bindir}/perl
    Provides: java-fonts = %{epoch}:%{javaver}, java-%{javaver}-fonts
    Conflicts: java-%{javaver}-ibm-fonts, java-%{javaver}-blackdown-fonts
    Conflicts: java-%{javaver}-bea-fonts
    Obsoletes: java-1.3.1-fonts, java-1.4.0-fonts, java-1.4.1-fonts,

    %description fonts
    This package contains the TrueType fonts for %{origin} JVMs.

    %package alsa
    Summary: ALSA support for %{name}
    Group: Development/Libraries/Java
    Requires: %{name} = %{epoch}:%{version}-%{release}

    %description alsa
    This package contains Advanced Linux Sound Architecture (ALSA) support
    libraries for %{name}.

    %package jdbc
    Summary: JDBC/ODBC bridge driver for %{name}
    Group: Development/Libraries/Java
    AutoReq: 0
    Requires: %{name} = %{epoch}:%{version}-%{release}%description jdbc
    This package contains the JDBC/ODBC bridge driver for %{name}.

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

    %ifnarch x86_64
    # make sure the plugin exists
    _OJI_PLUGIN=$(echo %pluginname | sed 's|%{_jvmdir}/%{jredir}|jre|')
    if [ ! -f $_OJI_PLUGIN ]; then
      exit 1

    What does the error mean? Any help would be appreciated.

    fedora-list mailing list
    To unsubscribe:

  • Next message: Richard E Miles: "Re: How can I change my file to allow sending mail from localhost.localdomain"

    Relevant Pages

    • Re: [opensuse] mp3
      ... 32-bit Flash plugin, ... ITYM no 64bit Flash or Java plugins. ... fine with 64bit Java package. ... uses Firefox under XP, she keeps going for Firefox and then complaining ...
    • Re: Ubunto
      ... developing Java on Fedora? ... The javadoc is in a third package, ... The lower layer is RPM - RPM files and the 'rpm' command, which is all about taking RPM files and unpacking them into the filesystem. ... It will then transactionally install all of them ...
    • Re: [opensuse] Java plugin for Firefox?
      ... directory I see nothing suggesting anything useful for installing a plugin. ... plugins for each of the the three Java releases. ... An attempt to d/l and install ... JRE is a 64bit package, and it is also showing me 64bit packages. ...
    • Re: Cant install java properly in FC3
      ... You install a package via rpm by the filename and remove it by the package ... > I have a feeling there are a couple of different instances of java in my ...
    • Re: Eclipse-Plugin zum Aufspüren von unbenutzten public-Methoden
      ... Package und Klassen und auch projektübergreifend anwendba. ... Nun, da in Java alles öffentlich und extern nutzbar ist, was public ... Woher soll das Plugin denn ...