首页 文章

CentOS上的rpmbuild问题 - 来自/home/me/rpmbuild/tmp/rpm-tmp.58942的错误退出状态

提问于
浏览
6

我正在尝试创建一个只更新系统上文件的软件包,但是在运行rpmbuild时我一直遇到错误 . 该错误表示文件丢失 .

我在CentOS 5和6上尝试过这个,结果相同 .

我使用 rpmdev-setuptree 来设置文件系统,它也设置了 ~/.rpmmacros 文件 . 然后我使用 rpmdev-newspec 来初始化spec文件 .

我作为非root用户运行 .

我在 ~/rpmbuild/SPECS/test.spec 中有spec文件,我的来源是: ~/rpmbuild/SOURCES/test-1.tar.gz . 提取此文件会创建一个名为 test-1 的目录,其中包含2个文件 . 我已经确认在我尝试构建软件包时它会被提取到 ~/rpmbuild/BUILD/test-1 .

我跑: rpmbuild -ba ~/rpmbuild/SPECS/test.spec

然后我收到这个错误:

./configure --build = x86_64-redhat-linux-gnu --host = x86_64-redhat-linux-gnu --target = x86_64-redhat-linux-gnu --program-prefix = --prefix = / usr - -exec-prefix = / usr --bindir = / usr / bin --sbindir = / usr / sbin --sysconfdir = / etc --datadir = / usr / share --includedir = / usr / include --libdir = / usr / lib64 --libexecdir = / usr / libexec --localstatedir = / var --sharedstatedir = / usr / com --mandir = / usr / share / man --infodir = / usr / share / info / home / me / rpmbuild / tmp / rpm-tmp.58942:第37行:./ configure:没有此类文件或目录错误:/home/me/rpmbuild/tmp/rpm-tmp.58942(%build)RPM构建错误导致退出状态错误:来自/home/me/rpmbuild/tmp/rpm-tmp.58942(%build)的退出状态不佳

这是我的spec文件:

Name:           test
Version:        1
Release:        1%{?dist}
Summary:        Test

Group:          Test
License:        GPL
URL:            http://example.com 
Source0:        test-1.tar.gz 
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

#BuildRequires:  
#Requires:       

%description
This is a test to push files.

%prep
%setup -q

%build
#%configure
#make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
#make install DESTDIR=$RPM_BUILD_ROOT
install -m 0755 -d $RPM_BUILD_ROOT/opt/test

%clean
rm -rf $RPM_BUILD_ROOT

%files
%dir /opt/test
%defattr(-,root,root,-)
%doc

关于我可能做错的任何想法?

1 回答

  • 5

    看起来默认的GNU“ ./configure ”脚本不是't there, so you can' t使用spec文件中的默认 %setup 宏,需要一个自定义的 %prep 部分... (One source) (mirror)

相关问题