检查CHECK_RPATHS后rpmbuild失败

时间:2016-06-29 11:39:45

标签: rpm rpmbuild rpm-spec

运行check rpath后,当rpmbuild失败时,我遇到了几次问题。我无法理解它何时以及为何发生。现在它可以运行localy但是当我在docker中运行它失败了。我没有看到任何具体的错误。 当rpmbuild成功时,它会检查更多的rpath。例如,好的是:

+ '[' '%{buildarch}' = noarch ']'  

+ QA_CHECK_RPATHS=1
+ case "${QA_CHECK_RPATHS:-}" in
+ /usr/lib/rpm/check-rpaths
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars

spec文件:

%define app_home /usr/share/nginx/html/pmp
Name: pmp
Version: 0.0.2 
Release: 1%{?dist}
Summary: PHP application

Group: Applications/System
License: GPLv2+
URL: http://www.something/
Source: bin
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%description

PHP application

%prep
%build

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{app_home}
rsync -vr --exclude 'rpm' %{_sourcedir}/ $RPM_BUILD_ROOT%{app_home}/

%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,nginx,nginx,-)
%{app_home}/*

运行失败rpmbuild -ba SPEC/my.spec

的rpmbuild后

rpmbuild -ba --sign /home/makerpm/rpmbuild/SPECS/my.spec

+ umask 022 
+ cd /home/makerpm/rpmbuild/BUILD
+ exit 0
+ umask 022
+ cd /home/makerpm/rpmbuild/BUILD
+ exit 0 
+ umask 022
+ cd /home/makerpm/rpmbuild/BUILD
+ '[' /home/makerpm/rpmbuild/BUILDROOT/pmp-sprint10-1.el7.centos.x86_64 '!=' / ']'
+ rm -rf /home/makerpm/rpmbuild/BUILDROOT/pmp-sprint10-1.el7.centos.x86_64
+ dirname /home/makerpm/rpmbuild/BUILDROOT/pmp-sprint10-1.el7.centos.x86_64
+ mkdir -p /home/makerpm/rpmbuild/BUILDROOT
+ mkdir /home/makerpm/rpmbuild/BUILDROOT/pmp-sprint10-1.el7.centos.x86_64
+ rm -rf /home/makerpm/rpmbuild/BUILDROOT/pmp-sprint10-1.el7.centos.x86_64
+ mkdir -p /home/makerpm/rpmbuild/BUILDROOT/pmp-front-basket-sprint10-1.el7.centos.x86_64/usr/share/nginx/html/pmp
+ rsync -vr --exclude rpm /home/makerpm/rpmbuild/SOURCES/ /home/makerpm/rpmbuild/BUILDROOT/pmp-sprint10-1.el7.centos.x86_64/usr/share/nginx/html/pmp/

+ '[' '%{buildarch}' = noarch ']'
+ QA_CHECK_RPATHS=1
+ case "${QA_CHECK_RPATHS:-}" in
+ /usr/lib/rpm/check-rpaths

Paswwor12s

+ cp -u '/home/makerpm/rpmbuild/RPMS/x86_64/*' /home/makerpm/rpmbuild/SOURCES/rpm/
  cp: cannot stat '/home/makerpm/rpmbuild/RPMS/x86_64/*': No such file or directory
+ exit 0

1 个答案:

答案 0 :(得分:1)

已发现此问题。在.rpmmacross中指定了noarch。

 %__arch_install_post \
  [ "%{buildarch}" = "noarch" ] || QA_CHECK_RPATHS=1 ; \
  case "${QA_CHECK_RPATHS:-}" in [1yY]*) /usr/lib/rpm/check-rpaths ;; esac \
/usr/lib/rpm/check-buildroot

将变量添加到*.spec文件中,现在正在使用

BuildArch: noarch