这是我的spec文件:http://pastebin.com/MtzxC1kv
当我尝试运行rpmbuild -ba myfile.spec
时,出现以下错误:
+ /usr/lib/rpm/brp-python-bytecompile
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: PA_Connector-1.0-1.0
error: File must begin with "/": %{_initddir}/pa_connector
error: File must begin with "/": attr(755,impulse,impulse)
error: File must begin with "/": attr(644,impulse,impulse)
error: File must begin with "/": attr(644,impulse,impulse)
error: File must begin with "/": attr(644,impulse,impulse)
error: File must begin with "/": attr(644,impulse,impulse)
error: File must begin with "/": attr(644,impulse,impulse)
error: File must begin with "/": attr(644,impulse,impulse)
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/PA_Connector-1.0-1.0-root
error: Installed (but unpackaged) file(s) found:
/%{_initddir}/pa_connector
/opt/pa_connector/config.xml
/opt/pa_connector/lib/commons-logging-1.1.1.jar
/opt/pa_connector/lib/log4j-1.2.17.jar
/opt/pa_connector/lib/pa_connector.jar
/opt/pa_connector/log4j.properties
/opt/pa_connector/pa_connector.sh
RPM build errors:
File must begin with "/": %{_initddir}/pa_connector
File must begin with "/": attr(755,impulse,impulse)
File must begin with "/": attr(644,impulse,impulse)
File must begin with "/": attr(644,impulse,impulse)
File must begin with "/": attr(644,impulse,impulse)
File must begin with "/": attr(644,impulse,impulse)
File must begin with "/": attr(644,impulse,impulse)
File must begin with "/": attr(644,impulse,impulse)
Installed (but unpackaged) file(s) found:
/%{_initddir}/pa_connector
/opt/pa_connector/config.xml
/opt/pa_connector/lib/commons-logging-1.1.1.jar
/opt/pa_connector/lib/log4j-1.2.17.jar
/opt/pa_connector/lib/pa_connector.jar
/opt/pa_connector/log4j.properties
/opt/pa_connector/pa_connector.sh
我已经阅读了一些有关正确的BuildRoot应该是什么的帖子,并修复了它,但它仍然不起作用。
答案 0 :(得分:2)
看起来_initddir
未定义,或者它会在最终文件名中展开,而您似乎有一个名为“/%{_initddir}/pa_connector
”的文件。
此外,您需要在%
前面attr
才能使用%attr
宏。