Subject: | PREFIX? rpmbuild writes to wrong location |
I had a RHEL3 box with an old version of ExtUtils::MakeMaker (6.03) that
I wanted to upgrade. However the newest version(s) 6.52 and 6.50 and
perhaps further back than that are dangerously incompatible with this
system due to the fact that the PREFIX is no longer being used properly
by rpmbuild. I tried to build an rpm from a source of SpamAssassin
(spamassassin.apache.org) using the newly upgraded version of
ExtUtils::MakeMaker and it started writing to the *live* install
directories rather than the destination in /var/tmp/. This had worked
properly with the older version of ExtUtils::MakeMaker, so I know that
the problem lies with that upgrade, unless it's simply not backward
compatible with older spec files and I don't know where this would be
documented.
Notice where it goes wrong:
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.41625
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd Mail-SpamAssassin-3.1.9
+ LANG=C
+ export LANG
+ unset DISPLAY
+ '[' /var/tmp/spamassassin-root '!=' / ']'
+ rm -rf /var/tmp/spamassassin-root
+ make prefix=/var/tmp/spamassassin-root/usr
exec_prefix=/var/tmp/spamassassin-root/usr
bindir=/var/tmp/spamassassin-root/usr/bin
sbindir=/var/tmp/spamassassin-root/usr/sbin
sysconfdir=/var/tmp/spamassassin-root/etc
datadir=/var/tmp/spamassassin-root/usr/share
includedir=/var/tmp/spamassassin-root/usr/include
libdir=/var/tmp/spamassassin-root/usr/lib
libexecdir=/var/tmp/spamassassin-root/usr/libexec
localstatedir=/var/tmp/spamassassin-root/var
sharedstatedir=/var/tmp/spamassassin-root/usr/com
mandir=/var/tmp/spamassassin-root/usr/share/man
infodir=/var/tmp/spamassassin-root/usr/share/info install
INSTALLMAN1DIR=/usr/share/man/man1 INSTALLMAN3DIR=/usr/share/man/man3
INSTALLSITEMAN1DIR=/usr/share/man/man1
INSTALLSITEMAN3DIR=/usr/share/man/man3
INSTALLVENDORMAN1DIR=/usr/share/man/man1
INSTALLVENDORMAN3DIR=/usr/share/man/man3
Installing ...<snip>
Appending installation info to
/var/tmp/spamassassin-root/usr/lib/perl5/5.8.0/i386-linux-thread-multi/perllocal.pod
/usr/bin/perl "-MExtUtils::Command" -e mkpath /etc/mail/spamassassin
<snip>
/usr/bin/perl "-MExtUtils::Command" -e mkpath /usr/share/spamassassin
/usr/bin/perl -e "map unlink, </usr/share/spamassassin/*>"
/usr/bin/perl build/preprocessor -Mvars -DVERSION="3.001009"
-DPREFIX="/usr" -DDEF_RULES_DIR="/usr/share/spamassassin"
-DLOCAL_RULES_DIR="/etc/mail/spamassassin"
-DLOCAL_STATE_DIR="/var/lib/spamassassin"
-DINSTALLSITELIB="/usr/lib/perl5/site_perl/5.8.0" -DCONTACT_ADDRESS="the
administrator of that system" -m644 -Irules -O/usr/share/spamassassin
10_misc.cf [...]
chmod 755 /usr/share/spamassassin
+ install -d /var/tmp/spamassassin-root//etc/rc.d/init.d
+ install -d /var/tmp/spamassassin-root//usr/include
+ install -m 0755 spamd/redhat-rc-script.sh
/var/tmp/spamassassin-root//etc/rc.d/init.d/spamassassin
+ /bin/mv spamd/README spamd/README.spamd
+ mkdir -p /var/tmp/spamassassin-root/etc/mail/spamassassin
<snip>
Processing files: perl-Mail-SpamAssassin-3.1.9-1
error: File not found: /var/tmp/spamassassin-root/usr/share/spamassassin
This is of course where the build dies.
When attempted with the older version of MakeMaker, it proceeded in a
similar manner but maintaining the correct PREFIX. This is the expected
behavior:
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.27877
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd Mail-SpamAssassin-3.1.9
+ LANG=C
+ export LANG
+ unset DISPLAY
+ '[' /var/tmp/spamassassin-root '!=' / ']'
+ rm -rf /var/tmp/spamassassin-root
+ make prefix=/var/tmp/spamassassin-root/usr
exec_prefix=/var/tmp/spamassassin-root/usr
bindir=/var/tmp/spamassassin-root/usr/bin
sbindir=/var/tmp/spamassassin-root/usr/sbin
sysconfdir=/var/tmp/spamassassin-root/etc
datadir=/var/tmp/spamassassin-root/usr/share
includedir=/var/tmp/spamassassin-root/usr/include
libdir=/var/tmp/spamassassin-root/usr/lib
libexecdir=/var/tmp/spamassassin-root/usr/libexec
localstatedir=/var/tmp/spamassassin-root/var
sharedstatedir=/var/tmp/spamassassin-root/usr/com
mandir=/var/tmp/spamassassin-root/usr/share/man
infodir=/var/tmp/spamassassin-root/usr/share/info install
INSTALLMAN1DIR=/usr/share/man/man1 INSTALLMAN3DIR=/usr/share/man/man3
INSTALLSITEMAN1DIR=/usr/share/man/man1
INSTALLSITEMAN3DIR=/usr/share/man/man3
INSTALLVENDORMAN1DIR=/usr/share/man/man1
INSTALLVENDORMAN3DIR=/usr/share/man/man3
Installing ...<snip>
Writing
/var/tmp/spamassassin-root/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/Mail/SpamAssassin/.packlist
Appending installation info to
/var/tmp/spamassassin-root/usr/lib/perl5/5.8.0/i386-linux-thread-multi/perllocal.pod
/usr/bin/perl "-MExtUtils::Command" -e mkpath
/var/tmp/spamassassin-root/etc/mail/spamassassin
<snip>
/usr/bin/perl "-MExtUtils::Command" -e mkpath
/var/tmp/spamassassin-root/usr/share/spamassassin
/usr/bin/perl -e "map unlink,
</var/tmp/spamassassin-root/usr/share/spamassassin/*>"
/usr/bin/perl build/preprocessor -Mvars -DVERSION="3.001009"
-DPREFIX="/usr" -DDEF_RULES_DIR="/usr/share/spamassassin"
-DLOCAL_RULES_DIR="/etc/mail/spamassassin"
-DLOCAL_STATE_DIR="/var/lib/spamassassin"
-DINSTALLSITELIB="/usr/lib/perl5/site_perl/5.8.0" -DCONTACT_ADDRESS="the
administrator of that system" -m644 -Irules
-O/var/tmp/spamassassin-root/usr/share/spamassassin 10_misc.cf [...]
chmod 755 /var/tmp/spamassassin-root/usr/share/spamassassin
+ install -d /var/tmp/spamassassin-root//etc/rc.d/init.d
+ install -d /var/tmp/spamassassin-root//usr/include
+ install -m 0755 spamd/redhat-rc-script.sh
/var/tmp/spamassassin-root//etc/rc.d/init.d/spamassassin
+ /bin/mv spamd/README spamd/README.spamd
+ mkdir -p /var/tmp/spamassassin-root/etc/mail/spamassassin
<snip>
Processing files: spamassassin-3.1.9-1
Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.31039
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd Mail-SpamAssassin-3.1.9
+ DOCDIR=/var/tmp/spamassassin-root/usr/share/doc/spamassassin-3.1.9
+ export DOCDIR
+ rm -rf /var/tmp/spamassassin-root/usr/share/doc/spamassassin-3.1.9
+ /bin/mkdir -p /var/tmp/spamassassin-root/usr/share/doc/spamassassin-3.1.9
+ cp -pr README Changes sample-nonspam.txt sample-spam.txt
spamd/README.spamd INSTALL BUGS LICENSE TRADEMARK USAGE sql UPGRADE
/var/tmp/spamassassin-root/usr/share/doc/spamassassin-3.1.9
+ exit 0
What is the version that introduced this change in behavior, and where
lies the fault? If there is an incompatibility it is not
well-documented. And it shouldn't be the case that newer versions of
MakeMaker would break rpmbuild in this manner.