rpmbuild ignores /usr/lib/macros if option --macros=file is used
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
rpm (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Building on Ubuntu 15.10 with RPM version 4.12.0.
I expect that specifying a macros file with --macros <filename> should allow me to add or redefine the existing macros.
Instead it seems that only the macros file I specify is read, and the macros in the "official" macros file are no longer able to be evaluated.
# Simple test case: Command fails when any macros file is specified, even an empty one:
fhanson@
%{__spec_
# expected output:
fhanson@
#!/bin/sh
RPM_SOURCE_
RPM_BUILD_
RPM_OPT_
RPM_ARCH="x86_64"
RPM_OS="linux"
export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS
RPM_DOC_
export RPM_DOC_DIR
RPM_PACKAGE_
RPM_PACKAGE_
RPM_PACKAGE_
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
LANG=C
export LANG
unset CDPATH DISPLAY ||:
RPM_BUILD_
export RPM_BUILD_ROOT
PKG_CONFIG_
export PKG_CONFIG_PATH
exec > /dev/null
umask 022
cd "/ssd/home/
I attempted to reproduce this on SLES11Sp2 (rpm 4.4.2.3) and could not.
This causes all of my rpm builds to fail that use a macros file, because all stage scripts are created with un-expanded macros.
Instead of my prep stage looking like this:
#!/bin/sh
...stuff
It looks like this:
%{__spec_
cd '/ssd/home/
rm -rf 'define-0.1'
%{__gzip} -dc '/ssd/home/
STATUS=$?
if [ $STATUS -ne 0 ]; then
exit $STATUS
fi
cd 'define-0.1'
This results in a failed build, because of course %{__spec_
%{__spec_
Building rpm package version 0.1 ...
mkdir -p build
cp -r rpmbuild build/
rpm --initdb --dbpath /ssd/home/
tar xzf rpmbuild/
cd build/rpmbuild/; rpmbuild -vv --macros=rpmmacros --define="_topdir /ssd/home/
ufdio: 1 reads, 15439 total bytes in 0.000006 secs
Executing(%prep): %{__spec_prep_cmd} /ssd/home/
error: Exec of /ssd/home/
error: Bad exit status from /ssd/home/
RPM build errors:
Bad exit status from /ssd/home/
Makefile:91: recipe for target 'rpm' failed
make: *** [rpm] Error 1
summary: |
- rpmbuild fails with /usr/lib/macros syntax error if option --macros=file - is used + rpmbuild ignores /usr/lib/macros if option --macros=file is used |
description: | updated |
affects: | rpm → rpm (Ubuntu) |