I'm trying to build a RHEL 6 rpm of nginx server. But, I get the following error:
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/nginx-1.0.5-1.el6.x86_64
error: Installed (but unpackaged) file(s) found:
RPM build errors:
Installed (but unpackaged) file(s) found:
How do I fix this problem and build rpm file?
To fix this error you need to specify the list of files that will be installed. This is done usong "%files" section. The syntax is as follows:
%files %defattr(-,root,root,-) /path/to/dir/ /path/to/file/
The above files can be set as follows in your .spec file (add before %changelog):
%files %defattr(-,root,root,-) %config(noreplace) /usr/local/nginx/conf/* /usr/local/nginx/html/ /usr/local/nginx/sbin/nginx
The %files section identifies what files and directories were added by the package. Save and close the file. Now, you can rebuild an rpm as follows:
$ rpmbuild --bb nginx.spec
- The RPM Package Manager project website.
- man page - rpmbuild