My spec files path looks like below :
/opt/OV
/opt/OV/NonOV
/opt/OV/NonOV/ABCD
/opt/OV/NonOV/ABCD/ABC
/opt/OV/NonOV/ABCD/ABC/Test1
/opt/OV/NonOV/ABCD/ABC/Test1/test1.txt
/opt/OV/NonOV/ABCD/ABC/Test2
/opt/OV/NonOV/ABCD/ABC/Test2/test2.txt
/opt/OV/newconfig
/opt/OV/newconfig/inventory
/opt/OV/newconfig/inventory/HPOvXYZ.xml
I don't want to this path to be included in spec file
/opt/OV/newconfig/inventory
" because if more than one rpm has this common path it gives error "conflict with file from package."
I have checked with %excludes
command like below:
%files
%exclude /opt/OV/newconfig/inventory
So problem with this command is, it is excluding directly and files recursively. The rpm.spec files path look like this:
/opt/OV
/opt/OV/NonOV
/opt/OV/NonOV/ABCD
/opt/OV/NonOV/ABCD/ABC
/opt/OV/NonOV/ABCD/ABC/Test1
/opt/OV/NonOV/ABCD/ABC/Test1/test1.txt
/opt/OV/NonOV/ABCD/ABC/Test2
/opt/OV/NonOV/ABCD/ABC/Test2/test2.txt
/opt/OV/newconfig
It is excluding /opt/OV/newconfig/inventory/HPOvXYZ.xml
this path as well.
Is there any command so the I an exclude/delete only directory path.
Thanks in Advance.
The section of the . spec file following the %build section is the %install section. This script installs the binaries, man pages, configuration files, and all other components that belong in your RPM package to their respective locations in our virtual build root directory.
The BUILD directory is where the software is unpacked and built. The RPMS directory is where the newly created binary package files are written. The SOURCES directory contains the original sources, patches, and icon files. The SPECS directory contains the spec files for each package to be built.
Macros set for the RPM (and SRPM) build process spec files is %{buildroot} , which points to the root of the installation target directory. It is used for setting DESTDIR in the package's %install step. The other macros are usually only used outside . spec files.
%files
/opt/OV
%exclude %dir /opt/OV/newconfig/inventory
This will leave /opt/OV/newconfig/inventory/HPOvXYZ.xml
in the file list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With