当前位置: 技术问答>linux和unix
rpmbuild打包问题,spec文件编写问题
来源: 互联网 发布时间:2017-05-01
本文导语: 为了将源码生成安装包 rpmbuild 目录在~/rpmbuild 预期结果:打包后所有文件安装到指定目录下如/usr/local/ast_pr/ 实际结果:etc文件跑到/etc 下, 其他安装到了/usr/下,如/usr/lib 等 BuildRoot: %{_tmppath}/%{name}-%{ver}-build...
为了将源码生成安装包
rpmbuild 目录在~/rpmbuild
预期结果:打包后所有文件安装到指定目录下如/usr/local/ast_pr/
实际结果:etc文件跑到/etc 下, 其他安装到了/usr/下,如/usr/lib 等
BuildRoot: %{_tmppath}/%{name}-%{ver}-buildroot
我在make后面加了prefix=/usr/local/ast_pr 能够生成安装包
再在make install 或的prefix=/usr 改为/usr/local/ast_pr 则找不到文件报错
spec 摘选文件如下:
....
%build
make prefix=/usr/local/ast_pr modules modules="%MYSQL_MODULES" cfg-target=/%{_sysconfdir}/ast/
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
make install-modules modules="%MYSQL_MODULES"
basedir=$RPM_BUILD_ROOT
prefix=/usr
cfg-prefix=$RPM_BUILD_ROOT
cfg-target=/%{_sysconfdir}/ast/
...
%files
%defattr(-,root,root)
%dir %{_docdir}/ast
%doc %{_docdir}/ast/AUTHO
...
修改%install的prefix出错如下:
Processing files: ast-1.1-0.x86
error: File not found: /root/rpmbuild/BUILDROOT/ast-1.1-0.x86/usr/share/doc/ast
error: File not found: /root/rpmbuild/BUILDROOT/ast-1.1-0.x86/usr/share/doc/ast/AUTHO
RPM build errors:
File not found: /root/rpmbuild/BUILDROOT/ast-1.1-0.x86/usr/share/doc/ast
File not found: /root/rpmbuild/BUILDROOT/ast-1.1-0.x86/usr/share/doc/ast/AUTHO
rpmbuild 目录在~/rpmbuild
预期结果:打包后所有文件安装到指定目录下如/usr/local/ast_pr/
实际结果:etc文件跑到/etc 下, 其他安装到了/usr/下,如/usr/lib 等
BuildRoot: %{_tmppath}/%{name}-%{ver}-buildroot
我在make后面加了prefix=/usr/local/ast_pr 能够生成安装包
再在make install 或的prefix=/usr 改为/usr/local/ast_pr 则找不到文件报错
spec 摘选文件如下:
....
%build
make prefix=/usr/local/ast_pr modules modules="%MYSQL_MODULES" cfg-target=/%{_sysconfdir}/ast/
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
make install-modules modules="%MYSQL_MODULES"
basedir=$RPM_BUILD_ROOT
prefix=/usr
cfg-prefix=$RPM_BUILD_ROOT
cfg-target=/%{_sysconfdir}/ast/
...
%files
%defattr(-,root,root)
%dir %{_docdir}/ast
%doc %{_docdir}/ast/AUTHO
...
修改%install的prefix出错如下:
Processing files: ast-1.1-0.x86
error: File not found: /root/rpmbuild/BUILDROOT/ast-1.1-0.x86/usr/share/doc/ast
error: File not found: /root/rpmbuild/BUILDROOT/ast-1.1-0.x86/usr/share/doc/ast/AUTHO
RPM build errors:
File not found: /root/rpmbuild/BUILDROOT/ast-1.1-0.x86/usr/share/doc/ast
File not found: /root/rpmbuild/BUILDROOT/ast-1.1-0.x86/usr/share/doc/ast/AUTHO
|