Bug 487591 - "make local" fails to build noarch subpackages
Summary: "make local" fails to build noarch subpackages
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: buildsystem
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-26 21:23 UTC by Hans Ulrich Niedermann
Modified: 2010-06-28 11:21 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-06-28 11:21:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Hans Ulrich Niedermann 2009-02-26 21:23:49 UTC
Description of problem:

  common/Makefile.common determines the rpm --target parameter
  in a way which breaks builds of spec files generating noarch
  subpackages.

  As soon as there is a "Buildarch: noarch" like ANYwhere in
  the spec file (i.e. within a "%package foo" section),
  common/Makefile.common just builds the WHOLE package as noarch.
  
  The relevant lines from common/Makefile.common:

    LOCALARCH := $(if $(shell grep -i '^BuildArch:.*noarch' $(SPECFILE)), noarch, $(shell uname -m))

    local: $(LOCALARCH)

    $(ARCHES) : sources $(TARGETS)
           $(RPM_WITH_DIRS) --target $@ -ba $(SPECFILE) 2>&1 | tee .build-$(VERSION)-$(RELEASE).log ; exit $${PIPESTATUS[0]}

Version-Release number of selected component (if applicable):

  2009-02-26 package CVS

How reproducible:

  100%

Steps to Reproduce:
1. cvs co libxcb
2. cd libxcb/devel
3. make local
  
Actual results:

  rpmbuild --define "_sourcedir /home/uli/src/fedora/FEDORA/libxcb/devel" --define "_specdir /home/uli/src/fedora/FEDORA/libxcb/devel" --define "_builddir /home/uli/src/fedora/FEDORA/libxcb/devel" --define "_srcrpmdir /home/uli/src/fedora/FEDORA/libxcb/devel" --define "_rpmdir /home/uli/src/fedora/FEDORA/libxcb/devel" --define "dist .fc11" --define "fedora 11" --define "fc11 1" --target noarch -ba libxcb.spec 2>&1 | tee .build-1.2-2.fc11.log ; exit ${PIPESTATUS[0]}
  [...]
  [ some error ]

Expected results:

  rpmbuild --define "_sourcedir /home/uli/src/fedora/FEDORA/libxcb/devel" --define "_specdir /home/uli/src/fedora/FEDORA/libxcb/devel" --define "_builddir /home/uli/src/fedora/FEDORA/libxcb/devel" --define "_srcrpmdir /home/uli/src/fedora/FEDORA/libxcb/devel" --define "_rpmdir /home/uli/src/fedora/FEDORA/libxcb/devel" --define "dist .fc11" --define "fedora 11" --define "fc11 1" --target <XXXX> -ba libxcb.spec 2>&1 | tee .build-1.2-2.fc11.log ; exit ${PIPESTATUS[0]}
  [...]
  [ eventual success ]

  with an <XXXX> of e.g. i386 or i686 or something similar.

Additional info:

  While you have Makefile.common open in your editor,
  would you mind adding a comment line at the beginning
  to the effect of

  # Common Makefile for building RPMs
  [...]
  # Fedora bugzilla component: buildsystem

  ?

Comment 1 Florian Festi 2009-02-27 08:57:44 UTC
May be the following line could fix the problem as it ignores the BuildArch line if it is after the first %package directive.

LOCALARCH := $(if $(shell grep -m 1 -i '^BuildArch:.*noarch\|^%package' $(SPECFILE) | grep -i -v '^%package'),
noarch, $(shell uname -m))

Comment 2 Hans Ulrich Niedermann 2009-02-28 13:30:24 UTC
I have successfully checked "make --dry-run local" with

LOCALARCH := $(if $(shell sed -n '/^%package/I q; /^buildarch:.*noarch/I {p;q}' $(SPECFILE)), noarch, $(shell uname -m))

locally with one pure-arch package (cstream), one pure-noarch package (terminus-fonts), and one arch package with noarch subpackage (nted).

Comment 3 Hans Ulrich Niedermann 2009-03-05 14:39:26 UTC
Note that both proposed new LOCALARCH definitions should also work fine with a spec file suitable for building on F9, F10, and F11, looking similar to:


# Only build noarch subpackages if distribution supports it
%if 0%{?fedora} >= 11
%global noarch_subpackage BuildArch: noarch
%else
%global noarch_subpackage %{nil}
%endif


Name:           something
Version:        1.5.0
Release:        5%{?dist}
Summary:        Something

Group:          Applications/Stuff
License:        GPLv2+
URL:            ...
Source0:        .../%{name}-%{version}.tar.gz
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

%description
...

%package doc
Group:          Applications/Stuff
Summary:        Something's documentation and online help
%{noarch_subpackage}


%description doc
Something's documentation and online help.

Comment 4 Bug Zapper 2009-06-09 11:40:19 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Bug Zapper 2010-04-27 13:03:42 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Bug Zapper 2010-06-28 11:21:23 UTC
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.