从规范文件使用rpmbuild创建rpm软件包时出错

时间:2019-12-28 10:09:51

标签: linux rpm rpmbuild rpm-spec

我想从规格文件(hello-world.spec)构建一个rpm包。命令和错误输出如下 Command1:

rpmbuild -ba hello-world.spec

ErrorOutput1:

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.z4GoQn
+ umask 022
+ cd /root/rpmbuild/BUILD
+ 
: not foundm-tmp.z4GoQn: 28: /var/tmp/rpm-tmp.z4GoQn: 
error: Bad exit status from /var/tmp/rpm-tmp.z4GoQn (%prep)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.z4GoQn (%prep)

我的规格文件的内容是

Name:       hello-world
Version:    1
Release:    1
Summary:    Most simple RPM package
License:    FIXME

%description
This is my first RPM package, which does nothing.

%prep
# we have no source, so nothing here

%build
cat > hello-world.sh <<EOF
#!/usr/bin/bash
echo Hello world
EOF

%install
mkdir -p %{buildroot}/usr/bin/
install -m 755 hello-world.sh %{buildroot}/usr/bin/hello-world.sh

%files
/usr/bin/hello-world.sh

%changelog
# let's skip this for now

我的系统/软件详细信息是

  • 操作系统:Ubuntu 16.04
  • RPM版本:4.12.0.1

rpmbuild文件夹中的内容列表为


Command2:

:~/rpmbuild# ls

Output2:

BUILD  BUILDROOT  RPMS  SOURCES  SPECS  SRPMS

有人可以帮助解决这个问题吗?

0 个答案:

没有答案