Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am try to create a RPM for the Perl Module YAML::Tiny and in my spec file I have this ...
%build /usr/perl/bin/perl Build.PL INSTALLDIRS=vendor ./Build ./Build test %install rm -rf $RPM_BUILD_ROOT ./Build install destdir=$RPM_BUILD_ROOT
... and when I run rpmbuild I get this error:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! ERROR: Can't create '/usr/perl-5.14.1/lib/red_perl/YAML' mkdir /usr/perl-5.14.1/lib/red_perl/YAML: Permission denied at /usr/pe +rl-5.14.1/lib/5.14.1/ExtUtils/Install.pm line 494 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!
Any help is appreciated. Thanks

Replies are listed 'Best First'.
Re: Why is ./Build install destdir=$RPM_BUILD_ROOT ignoring the destdir?
by taint (Chaplain) on Jan 09, 2014 at 21:12 UTC

    I don't mean to sound mean, or anything. But You've already been told what the problem is:

    Permission denied
    Should it not already be obvious to you; this is a system error. Your system (the one your building this on) is trying to tell you that you don't have write privileges to the directory you are attempting to write to.

    I'ts also possible that "Perl", itself is associated with some user/group, and wouldn't have permission. But, in almost any case, it's you, the user, whos permissions are inherited, that determine what can, and cannot be done on the system.

    Perhaps doing an su before attempting the install?

    HTH

    --Chris

    UPDATE: I should also add; that you can also make the install, install to a lib within your home directory.

    make install PREFIX=~/lib
    assuming that the directory lib already exists within your ~ (Home) directory.

    ¡λɐp ʇɑəɹ⅁ ɐ əʌɐɥ puɐ ʻꜱdləɥ ꜱᴉɥʇ ədoH

      Thanks for your response taint. I learned that YAML::Tiny uses Module::Build::Tiny which does not like
      ./Build install destdir=$RPM_BUILD_ROOT
      so I had to change that line in my spec file to ...
      ./Build install --destdir=$RPM_BUILD_ROOT