Description of Problem: In a kernel spec file, to represent the "pre?" version component of one of Linus's test kernels, I defined the symbol: %define pre 3 which I then used like: %if "%{pre}" == "" %define ver 2.4.%{sublevel} %else %define ver 2.4.%{sublevel}pre%{pre} %endif So, an rpm build dies because I have: %clean rm -f $RPM_BUILD_ROOT %pre # pre-install actions which rpm-build dutifully translates to" 3 # pre-install actions Either don't allow defining that variable, or recognize that %pre is a directive and handle it differently.
I think this should apply to %post, %dir, and whatever else rpm may need to distinguish on a context basis, or else disallow defining.
This is a feature, not a bug, as it permits overloading other uses of % (like the %pre section marker as you describe) with a macro expansion. This permits, for example, all %build sections in a spec file to include a per-buildsystem preface if necessary.