2
votes

I'm working on packaging a library in an RPM. Fedora's RPM Build manual, 8.2.3.2, The PREP Section states:

The prep section, short for prepare, defines the commands necessary to prepare for the build. If you are starting with a compressed tar archive (a tarball) of the sources, the prep section needs to extract the sources.

For example:
%prep
%setup -q

The prep section starts with a %prep statement.

This example uses the %setup RPM macro, which knows about tar archives, to extract the files. In most cases, this will be all you need in your spec file prep section.

We have a ZIP, and it needs to be extracted with the -a option. Otherwise, the patch step fails due to line endings.

How do I pass the -a option to the zip program through the PREP or SETUP section? (I'm not sure which section or stage needs it, but I know its one of them).

1

1 Answers

0
votes

%prep is the section of the specfile.

%setup is a macro within the %prep section. You don't need to use it. Take it out and manually write out all the commands you need to unzip the source into a directory named packagename-versionnumber.

An example of what %setup expands to, along with more options it accepts, can be found at rpm.org.