I have a pre-made directory structure that I want to make an rpm from. In my spec file I specify all files from that directory structure that I want to include in the rpm, and when executing rpmbuild I set the buildroot to the (from what I can tell) correct directory:
%files
/usr/local/bin/test/Test
/usr/local/bin/test/something.awk
/usr/share/snmp/mibs
/etc/init.d/test
My rpmbuild command looks like this:
rpmbuild --rmspec --buildroot=bin/<files dir> -bb bin/tmp.spec
Both the buildroot directory & location of my spec file are relative. The directory structure looks like this:
/home/<me>/Projects/<project>/ <-- I execute rpmbuild from here
/home/<me>/Projects/<project>/bin/tmp.spec
/home/<me>/Projects/<project>/bin/<files dir>/ <-- All files/directories mentioned in spec file reside here
/home/<me>/Projects/<project>/bin/<files dir>/usr/local/bin/test/Test
/home/<me>/Projects/<project>/bin/<files dir>/usr/local/bin/test/something.awk
/home/<me>/Projects/<project>/bin/<files dir>/usr/share/snmp/mibs/ <-- directory with a few MIB files, which I all want to include
/home/<me>/Projects/<project>/bin/<files dir>/etc/init.d/test
However, when executing the rpmbuild command I get the following errors:
Processing files: <rpm>
error: File not found: /bin/<files dir>/usr/local/bin/test/Test
error: File not found: /bin/<files dir>/usr/local/bin/test/something.awk
error: File not found: /bin/<files dir>/usr/share/snmp/mibs
error: File not found: /bin/<files dir>/etc/init.d/test
RPM build errors:
File not found: /bin/<files dir>/usr/local/bin/test/Test
File not found: /bin/<files dir>/usr/local/bin/test/something.awk
File not found: /bin/<files dir>/usr/share/snmp/mibs
File not found: /bin/<files dir>/etc/init.d/test
The spec file does not contain any %prep, %build or %install directives, as the complete file structure is pre-made before building the rpm file. I am convinced it is some small thing that I am missing, and I suspect that it is a case of rpmbuild using a different directory than I am specifying. I've been toying around with the buildroot & _topdir directives, both with relative & absolute paths, but to no avail...