On CentOS5 I was used to create a simple spec file where at the end I'll declare files and directories I wan't to package:
%files
%dir /opt/myapp
%dir /opt/myapp/bin
%dir /opt/myapp/etc
/opt/myapp/bin/exec01
/opt/myapp/etc/myapp.conf
I'll copy the file in /usr/src/redhat/SPECS and run "rpmbuild -bb myapp.spec".
On CentOS6 rpm-build package no longer creates the /usr/src/redhat/... directory tree. I followed the CentOS6 Wiki instructions to setup my rpmbuild environment for a regular user.
When I try to build the package on CentOS6 I'm getting this error for every single file and directory:
File not found:
/home/myhome/rpmbuild/BUILDROOT/myapp-5.2-1el6.x86_64/opt/myapp/bin/exec01
I tried to override buildroot:
rpmbuild -bb --define="buildroot /" myapp.spec
error: %{buildroot} can not be "/"
As a workaround I can manually create /home/myhome/rpmbuild/BUILDROOT/myapp-5.2-1el6.x86_64/ and copy all my file in there but that's a lot of extra work.
Is there a way to get the same functionality on CentOS6 where rpmbuild will collect the files from the main / directory and build the rpm package?