I'm trying to build a RHEL 6 rpm of nginx server. But, I get the following error:
+ /usr/lib/rpm/brp-strip-comment-note
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:
/usr/local/nginx/conf/fastcgi.conf
/usr/local/nginx/conf/fastcgi.conf.default
...
....
.
/usr/local/nginx/html/50x.html
/usr/local/nginx/html/index.html
/usr/local/nginx/sbin/nginxRPM build errors:
Installed (but unpackaged) file(s) found:
/usr/local/nginx/conf/fastcgi.conf
/usr/local/nginx/conf/fastcgi.conf.default
...
..
.
/usr/local/nginx/html/50x.html
/usr/local/nginx/html/index.html
/usr/local/nginx/sbin/nginx
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
Recommend readings:
- The RPM Package Manager project website.
- man page - rpmbuild
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop



![RHEL / CentOS Yum Command: Blacklist Packages [ Disable Certain Packages ]](http://s13.cyberciti.org/images/shared/rp/3/20.jpg)









{ 5 comments… read them below or add one }
You have to tell rpm to include your config files. A great place to beging learning this is at:http://www.ibm.com/developerworks/library/l-rpm1/
I got this error for a different reason. I defined my BuildRoot as %{_topdir}/%{name}-%{version}-root . rpmbuild had left some files in my BuildRoot , and didn’t remove them. I had to remove these files manually.
Several people on IBM Developerworks had the same problem. See http://www.ibm.com/developerworks/linux/library/l-rpm1/index.html#icomments. The solution proposed by bluebloodpole worked for me, but so did a simple `rm`.
In fact, the instructions in that article didn’t work for me without some modifications.
nginx.org has binary rpms on their website with the basic modules installed. If you want extra modules just add them in the src rpm spec file and rebuild it.
http://wiki.nginx.org/Install
A had the same issue as Stefan Lasiewski. Simply cleaning the buildroot dir solves the problem (of course, steps described in the article should be done too).
If you don’t need those files/directories then just add %exclude macros with the paths and you are sorted – no need to delete from within spec file as when the RPM is built the buld and buildroot are deleted anyway …