I'm trying to build an RPM out of the MICO orb, and my %install section contains the following commands: pushd $RPM_BUILD_ROOT/usr/share/mico JAVA_CUP_DIR=dirname `locate lalr_item_set.class` cp -a $JAVA_CUP_DIR . The intent is to determine the location of another package, which is relocatable. Now, the actual bash script generated by RPM appears to be correct: pushd $RPM_BUILD_ROOT/usr/share/mico JAVA_CUP_DIR=dirname `locate lalr_item_set.class` cp -a $JAVA_CUP_DIR . However, when this script is actually run, it is not interpreted correctly: + pushd /var/tmp/mico-root/usr/share/mico /var/tmp/mico-root/usr/share/mico /usr/src/redhat/BUILD/mico ++ locate lalr_item_set.class + JAVA_CUP_DIR=dirname + /usr/lib/java/java_cup/lalr_item_set.class /var/tmp/rpm-tmp.25852: /usr/lib/java/java_cup/lalr_item_set.class: Permission denied Bad exit status from /var/tmp/rpm-tmp.25852 (%install) It appears that rpm interprets the script as follows: pushd $RPM_BUILD_ROOT/usr/share/mico `locate lalr_item_set.class` dirname # etc.
Fix your script: JAVA_CUP_DIR=$(dirname `locate lalr_item_set.class`)
Thanks....boy do I feel dumb....