Excluding file types when packing rpm

In my spec file for rpm python packaging, I want to delete certain file types in certain directories:

for example, I want to exclude * .py source files in these directories:

lib/*.py

comm/*.py

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

+5
source share
3 answers

- , , %file, . , , RPM . RPM , , , , - . , dpkg.

+5

% exclude, ..

%files
%exclude /lib/*.py
%exclude /comm/*.py
+19

Or just remove them from buildroot:

%install
...
find %{buildroot} -name ".py" -delete
+3
source

All Articles