building java rpm

From: Peter Lesterhuis (peterlesterhuis_at_tiscali.nl)
Date: 06/25/05

  • Next message: Richard E Miles: "Re: How can I change my sendmail.mc file to allow sending mail from localhost.localdomain"
    Date: Sat, 25 Jun 2005 22:40:51 +0200
    To: fedora-list@redhat.com
    
    

    Hi,
    I am trying to build a java rpm based on the nosrc.rpm from jpackage.org
    and the source from http://java.sun.com/j2se/1.5.0/download.jsp (the
    .bin-file).
    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
    README THIRDPARTYLICENSEREADME.txt Welcome.html
    + chmod -R u+w bin CHANGES COPYRIGHT javaws lib LICENSE man plugin
    README THIRDPARTYLICENSEREADME.txt Welcome.html
    ++ echo
    /usr/lib/jvm/java-1.5.0-sun-1.5.0.03/jre/plugin/i386/ns7/libjavaplugin_oji.so
    ++ sed 's|/usr/lib/jvm/java-1.5.0-sun-1.5.0.03/jre|jre|'
    + _OJI_PLUGIN=jre/plugin/i386/ns7/libjavaplugin_oji.so
    + '[' '!' -f jre/plugin/i386/ns7/libjavaplugin_oji.so ']'
    + 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
    %{_jvmdir}/%{jredir}/plugin/i386/ns7/libjavaplugin_oji.so
    %endif
    %ifarch x86_64%define target_cpu amd64
    %endif

    %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
    URL: http://java.sun.com/j2se/%{javaver}/Source1:
    %{name}-register-java-fonts.xsl
    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 =
    %{epoch}:%{version}
    Provides: java-sasl = %{epoch}:%{version}
    %ifnarch x86_64
    Obsoletes: javaws-menu
    %endif

    %description
    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} =
    %{epoch}:%{version}-%{release}
    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 libjava_crw_demo_g.so is added which
    # is not in the main java package. libjava_crw_demo.so 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,
    java-1.4.2-plugin

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

    %package fonts
    Summary: TrueType fonts for %{origin} JVMs
    Group: Text Processing/Fonts
    Requires: %{name} = %{epoch}:%{version}-%{release},
    %{_bindir}/ttmkfdir
    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,
    java-1.4.2-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}.

    %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 *

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

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

    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    

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