Results 1 to 6 of 6

Thread: 11.2 : BuildRoot tag incorrect

  1. #1

    Exclamation 11.2 : BuildRoot tag incorrect

    Hi all !
    I've just added 11.2 repo to my OBS project and I'm having a problem with building.
    I make Java applications, which have built fine with 11.1 repositories. Now that I've tried the 11.2, I see a little error when the rpm builder collects files. RPM_BUILD_ROOT is not my
    Code:
    BuildRoot: %{_builddir}/%{name}-root
    , instead I get something like if that was interpreted like RPM_BUILD_ROOT=%{_builddir}/%{name}-%{version}-%{rpmbuildnumber}... Which is not possible to access within my ant pre-rpm-build-install task, that uses a /usr/src/packages/BUILD/${name}-root string.
    Visit my OBS repository w/ various packages (java apps, some devices modules) !
    http://download.opensuse.org/repositories/home://broumbroum23/
    openSUSE_11.1_oss/
    openSUSE_11.2_oss/


  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    28,140
    Blog Entries
    15

    Default Re: 11.2 : BuildRoot tag incorrect

    Quote Originally Posted by broumbroum23
    Hi all !
    I've just added 11.2 repo to my OBS project and I'm having a problem
    with building.
    I make Java applications, which have built fine with 11.1 repositories.
    Now that I've tried the 11.2, I see a little error when the rpm builder
    collects files. RPM_BUILD_ROOT is not my
    Code:
    --------------------
    BuildRoot: %{_builddir}/%{name}-root
    --------------------
    , instead I get something like if that was interpreted like
    RPM_BUILD_ROOT=%{_builddir}/%{name}-%{version}-%{rpmbuildnumber}...
    Which is not possible to access within my ant pre-rpm-build-install
    task, that uses a /usr/src/packages/BUILD/${name}-root string.
    Hi
    For 1120> it uses the BUILDROOT now, for < 1120 it should work fine,
    let OBS take care of the build like so;
    Code:
    %if 0%{?suse_version} < 1120
    BuildRoot:  %{_tmppath}/%{name}-%{version}-build
    %endif
    
    and instead of %clean use
    
    %if 0%{?suse_version} < 1120
    %clean
    %{__rm} -rf '%{buildroot}'
    %endif
    You will need to modify to use above....

    --
    Cheers Malcolm (Linux Counter #276890)
    SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.37-0.1-default
    up 5 days 19:43, 2 users, load average: 0.38, 0.23, 0.20
    GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18


  3. #3

    Default Re: 11.2 : BuildRoot tag incorrect

    For 1120> it uses the BUILDROOT now,
    thx,but is that possible to define a self build root path for >= 1120, for I' not able to get the OBS release number within ant scripts, am I?
    Visit my OBS repository w/ various packages (java apps, some devices modules) !
    http://download.opensuse.org/repositories/home://broumbroum23/
    openSUSE_11.1_oss/
    openSUSE_11.2_oss/


  4. #4

    Default Re: 11.2 : BuildRoot tag incorrect

    see how it logs from osc build .spec openSUSE_11.2_non-oss

    This is ANT :
    Code:
    <property name="rpm-build-root.dir" location="/usr/src/packages/BUILD/${ant.project.name}-root"/>
    
        <target name="pre-rpm-build-install" depends="build-jar" description="compile and install into ${rpm-build-root.dir}/usr
    /share/games/${ant.project.name}">
            <copy overwrite="true" file="${resources.props.all.dir}/run-${ant.project.name}" tofile="${rpm-build-root.dir}/usr/g
    ames/${ant.project.name}">
                <filterset refid="filtertokens"/>
            </copy>
            <exec dir="${dist}" executable="chmod">
                <arg line="a+x '${rpm-build-root.dir}/usr/games/${ant.project.name}'"/>
            </exec>
            <mkdir dir="${rpm-build-root.dir}/usr/share/games/${ant.project.name}"/>
            <copy overwrite="true" todir="${rpm-build-root.dir}/usr/share/games/${ant.project.name}">
                <fileset refid="resources.os.all.jars"/>
                <fileset refid="resources.all.jars"/>
                <fileset refid="installed.files"/>
            </copy>
        </target>
    This is .SPEC :
    Code:
    %prep
    %setup -q
    %build
    %ant clean
    %ant build-jar
    %install
    %ant pre-rpm-build-install
    then OBS log :
    Code:
    pre-rpm-build-install:
         [copy] Copying 1 file to /usr/src/packages/BUILD/sf3jswing-jxakernel-root/usr/games
        [mkdir] Created dir: /usr/src/packages/BUILD/sf3jswing-jxakernel-root/usr/share/games/sf3jswing-jxakernel
         [copy] Copying 1 file to /usr/src/packages/BUILD/sf3jswing-jxakernel-root/usr/share/games/sf3jswing-jxakernel
    
    BUILD SUCCESSFUL
    Total time: 8 seconds
    + /usr/lib/rpm/find-debuginfo.sh /usr/src/packages/BUILD/sf3jswing-jxakernel-1.0.5
    + RPM_BUILD_ROOT=/usr/src/packages/BUILDROOT/sf3jswing-jxakernel-1.0.5-02.i386    
    + export RPM_BUILD_ROOT
    Code:
    RPM build errors:
        File not found: /usr/src/packages/BUILDROOT/sf3jswing-jxakernel-1.0.5-02.i386/usr/games/sf3jswing-jxakernel
        File not found: /usr/src/packages/BUILDROOT/sf3jswing-jxakernel-1.0.5-02.i386/usr/share/games/sf3jswing-jxakernel
    Visit my OBS repository w/ various packages (java apps, some devices modules) !
    http://download.opensuse.org/repositories/home://broumbroum23/
    openSUSE_11.1_oss/
    openSUSE_11.2_oss/


  5. #5

    Default Re: 11.2 : BuildRoot tag incorrect

    OH sorry for my oddness, I know how to change the ant code... ain't no OBS release number...
    thank you anyway !
    BUILDROOT/sf3jswing-jxakernel-1.0.5-02.i386 => <property name="rpm-build-root.dir" location="/usr/src/packages/BUILD/${ant.project.name}-${version}-${release}.${unix-arch}"/>
    Visit my OBS repository w/ various packages (java apps, some devices modules) !
    http://download.opensuse.org/repositories/home://broumbroum23/
    openSUSE_11.1_oss/
    openSUSE_11.2_oss/


  6. #6

    Default Re: 11.2 : BuildRoot tag incorrect

    Quote Originally Posted by myself
    thx,but is that possible to define a self build root path for >= 1120, for I' not able to get the OBS release number within ant scripts, am I?
    finally, i had to export an environment variable from within the .spec script to get it read with the ant script.

    Code:
    (...)
    %if 0%{?suse_version} < 1120
    BuildRoot:  %{_builddir}/%{name}-%{version}-%{release}.build
    %endif
    BuildRequires: java-1_6_0-sun-devel, ant
    Requires: java-1_6_0-sun
    %prep
    %setup -q
    %build
    %ant clean
    %ant build-jar
    %install
    export MYRPM_BUILDROOT=%{buildroot}
    %ant pre-rpm-build-install
    %if 0%{?suse_version} < 1120
    %clean
    %{__rm} -rf '%{buildroot}'
    %endif
    %ant clean
    %files
    %defattr(-,root,root)
    /usr/games/%name
    /usr/share/games/%name/
    %changelog
    ant :
    Code:
    <property environment="env"/>
    <property name="MYRPM_BUILDROOT" value="${env.MYRPM_BUILDROOT}"/>
    <property name="rpm-build-root.dir" value="${MYRPM_BUILDROOT}"/>
        
        <target name="pre-rpm-build-install" depends="build-jar" description="compile and install into ${rpm-build-root.dir}/usr/share/games/${ant.project.name}">
            <copy overwrite="true" file="${resources.props.all.dir}/run-${ant.project.name}" tofile="${rpm-build-root.dir}/usr/games/${ant.project.name}">
                <filterset refid="filtertokens"/>
            </copy>
            <exec dir="${dist}" executable="chmod">
                <arg line="a+x '${rpm-build-root.dir}/usr/games/${ant.project.name}'"/>
            </exec>
            <mkdir dir="${rpm-build-root.dir}/usr/share/games/${ant.project.name}"/>
            <copy overwrite="true" todir="${rpm-build-root.dir}/usr/share/games/${ant.project.name}">
                <fileset refid="resources.os.all.jars"/>
                <fileset refid="resources.all.jars"/>
                <fileset refid="installed.files"/>
            </copy> 
        </target>
    Thanks for all your help !
    Visit my OBS repository w/ various packages (java apps, some devices modules) !
    http://download.opensuse.org/repositories/home://broumbroum23/
    openSUSE_11.1_oss/
    openSUSE_11.2_oss/


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •