0

I'm writing a spec file and getting slightly unexpected results when I install the rpm. I'd like to see what the install process thinks it's doing.

Contrived example, suppose I have:

   %install
   mkdir -p %{buildroot}%{somedir}
   cp nice.file %{buildroot}%{somedir}

and the rpm install succeeds but nice.file is not where I expect it to be - yes in this contrived example that surely can't happen, but I have a fair few more things going on ...

So add some diagnostic:

   %install
   mkdir -p %{buildroot}%{somedir}
   echo "about to copy to %{buildroot}%{somedir}"
   cp nice.file %{buildroot}%{somedir}
   ls %{buildroot}%{somedir}

which all shows up nicely when I build the rpm, but at install time I see nothing.

Is there a way to get some diagnostic output? Better still an explicit trace of the execution steps?

I'm on Centos 7 right now, but interested across any platform that uses rpms.

2

%install section does nothing during installation. This section is used to install build artifact into the proper location in %buildroot so %files section can pick them up later.

See https://stackoverflow.com/questions/21557015/build-rpm-to-just-install-files and https://rpm-packaging-guide.github.io/#working-with-spec-files

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.