Bug 15638

Summary: new %make macro for RPM.
Product: [Retired] Red Hat Linux Reporter: Geoffrey Lee <snailtalk>
Component: rpm-buildAssignee: Jeff Johnson <jbj>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2EEKeywords: FutureFeature
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-01-18 17:24:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Geoffrey Lee 2000-08-07 14:11:31 UTC
RPM would probably benefit from a %make macro which runs make but only 
that we detect the number of processors with some shell script code and 
then pass the number of processer to make -j$NUMPROC.

below is the code that should go in macros.

if [ -z "$NPROCS" ]; then NPROCS=`egrep -c ^cpu[0-9]+ /proc/stat || :`; fi
if [ -z "$NPROCS" -o "$NPROCS" -le "0" ]; then
  NPROCS=1
fi
make -j$NPROCS

Comment 1 Jeff Johnson 2001-01-08 17:36:31 UTC
This is a good idea, but I can't change rpm's default configuration adding
implicit dependencies
on /proc in this fashion. Please send me a patch to add this in Mandrake
per-platform
macro configuration files, as I'd like to add this (and other Mandrake specific
rpm
configuration to the rpm distribution.)

Comment 2 Jeff Johnson 2001-01-18 17:25:07 UTC
This is being added as a Mandrake specific per-platform macro configuration,
initial
attempts are in rpm-4.0.1 and later.

Comment 3 Andrew Bartlett 2001-01-20 03:43:03 UTC
Can't you just test if /proc/stat exists first?  That way there is no proc
dependency.