我有一個預製的目錄結構,我想從中創建rpm。 在我的規格文件我指定從目錄結構,我想在rpm到包括所有文件,以及執行的rpmbuild當我設置的buildroot到(從我可以告訴)正確的目錄:無法從spec文件生成rpm:未找到文件錯誤
%files
/usr/local/bin/test/Test
/usr/local/bin/test/something.awk
/usr/share/snmp/mibs
/etc/init.d/test
我的rpmbuild命令如下:
rpmbuild --rmspec --buildroot=bin/<files dir> -bb bin/tmp.spec
我的兩個規範文件的目錄的buildroot位置&是相對的。 目錄結構是這樣的:
/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
但是,執行的rpmbuild命令時,我得到了以下錯誤:
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
該規範文件不包含任何%準備,%建立或%安裝指令,因爲完整的文件結構是在構建rpm文件之前預先製作的。 我相信這是我錯過的一些小事情,我懷疑這是一個rpmbuild使用不同於我指定的目錄的情況。 我一直在玩弄與周圍的buildroot的& _topdir指示,既相對&絕對路徑,但無濟於事...
用實際的目錄名替換''......如果你真的想用'';你至少應該逃離這個空間...... –