Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

excluding file types when packaging an rpm

In my spec file for packaging a python rpm, I want to remove certain filetypes in certain directories:

e.g., I want to exclude source *.py files in these directories:

lib/*.py

comm/*.py

I think I should do this in the %file section of my spec. Any suggestions?

like image 983
jedierikb Avatar asked Jan 24 '11 19:01

jedierikb


People also ask

Which file specifies how an RPM source package is compiled?

The BUILD directory is used during the build process of the RPM package. This is where the temporary files are stored, moved around, etc. The RPMS directory holds RPM packages built for different architectures and noarch if specified in . spec file or during the build.

What is %install in RPM spec file?

in the %install section, you are supposed to install all your files in the %{buildroot] directory; just the way they will be installed on the final system. there seems to have been a %{_prefix} variable declared; he just creates that directory.

What is buildroot in RPM spec file?

By using Buildroot: in your spec file you are indicating that your package can be built (installed into and packaged from) a user-definable directory. This helps package building by normal users. RPM will use the buildroot listed in the spec file as the default buildroot.

What is a .spec file?

Spec files are plain-text files that are used to construct spec strings. They consist of a sequence of directives separated by blank lines. The type of directive is determined by the first non-whitespace character on the line, which can be one of the following: % command. Issues a command to the spec file processor.


1 Answers

You need to use %exclude macro, i.e.

%files
%exclude /lib/*.py
%exclude /comm/*.py
like image 134
Leandro Avatar answered Nov 08 '22 19:11

Leandro