gpt4 book ai didi

bash - RPM 构建错误 :Bad exit status from/var/tmp/rpm-tmp. 32XJLX (%install)

转载 作者:行者123 更新时间:2023-11-29 09:38:09 25 4
gpt4 key购买 nike

我试图在 centos 6.5 上创建一个简单的 rpm 包。但我无法完成它,因为它给我错误。我已经关注了这两个线程。。Bad exit status from /var/tmp/rpm-tmp.b1DgAt (%build)Bad exit status from /var/tmp/rpm-tmp.ajKra4 (%prep) .. 但没有运气......

我不知道我在这里错过了什么..请帮我解决这个问题..

这是我的

Name:   test
Version: 1.0
Release: 1%{?dist}
Summary: A test package

Group: Testing
License: GPL
URL: http://www.yahoo.com
Source0: test-1.0.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

BuildRequires: /bin/rm, /bin/mkdir, /bin/cp
Requires: /bin/bash, /bin/date

%description
this is the test package build for rhche

%prep
%setup -q

%build
./configure
%install
rm -rf $RPM_BUILD_ROOT
make -p $RPM_BUILD_ROOT/usr/local/bin
cp myscriptdate $RPM_BUILD_ROOT/usr/local/bin

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%attr(0755,root,root)/usr/local/bin/myscriptdate

%changelog
* Thu Dec 09 2010 Forrest <forrest@redhat.com> 1.0-1
-Initial RPM
-Added /usr/local/bin/myscript

源目录是/test1

[ara@catshit test1]$ pwd
/test1
[ara@catshit test1]$ ls -ls
total 12
4 drwxrwxrwx. 2 ara ara 4096 Dec 7 00:02 test-1.0
4 -rw-rw-r--. 1 ara ara 210 Dec 7 00:09 test-1.0.tar.gz
4 -rwxrwxrwx. 1 ara ara 742 Dec 7 00:17 test.spec
[ara@catshit test1]$

test-1.0 被压缩为 test-1.0.tar.gz。在 test-1.0 中,我有一个名为 myscriptdate 的脚本,它包含以下简单代码。

'#!/bin/bash

日期

当我尝试 rpmbuild -ba test.spec 时,它给了我

# Not a target:
.f:
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
# commands to execute (built-in):
$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@

# Not a target:
.f.o:
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
# commands to execute (built-in):
$(COMPILE.f) $(OUTPUT_OPTION) $<

# files hash-table stats:
# Load=70/1024=7%, Rehash=0, Collisions=278/1660=17%
# VPATH Search Paths

# No `vpath' search paths.

# No general (`VPATH' variable) search path.

# # of strings in strcache: 0
# # of strcache buffers: 0
# strcache size: total = 0 / max = 0 / min = 4096 / avg = 0
# strcache free: total = 0 / max = 0 / min = 4096 / avg = 0

# Finished Make data base on Sun Dec 7 00:51:01 2014

error: Bad exit status from /var/tmp/rpm-tmp.ZFlmeu (%install)


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

/var/tmp/rpm-tmp.ZFlmeu内容如下

#!/bin/sh

RPM_SOURCE_DIR="/home/ara/rpmbuild/SOURCES"
RPM_BUILD_DIR="/home/ara/rpmbuild/BUILD"
RPM_OPT_FLAGS="-O2 -g"
RPM_ARCH="x86_64"
RPM_OS="linux"
export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS
RPM_DOC_DIR="/usr/share/doc"
export RPM_DOC_DIR
RPM_PACKAGE_NAME="test"
RPM_PACKAGE_VERSION="1.0"
RPM_PACKAGE_RELEASE="1.el6"
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
LANG=C
export LANG
unset CDPATH DISPLAY ||:
RPM_BUILD_ROOT="/home/ara/rpmbuild/BUILDROOT/test-1.0-1.el6.x86_64"
export RPM_BUILD_ROOT

PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/share/pkgconfig"
export PKG_CONFIG_PATH

set -x
umask 022
cd "/home/ara/rpmbuild/BUILD"
cd 'test-1.0'
rm -rf $RPM_BUILD_ROOT
make -p $RPM_BUILD_ROOT/usr/local/bin
cp myscriptdate $RPM_BUILD_ROOT/usr/local/bin





/usr/lib/rpm/brp-compress
/usr/lib/rpm/brp-strip
/usr/lib/rpm/brp-strip-static-archive
/usr/lib/rpm/brp-strip-comment-note

最佳答案

make -p $RPM_BUILD_ROOT/usr/local/bin 行是你的问题。

虽然这不是问题,但您几乎肯定不希望在该行上使用 -p。因为它在编译期间对您没有任何用处,并且您的 rpm 构建过程不需要查看 make 规则数据库。

真正的问题是你告诉 make 你希望它构建 $RPM_BUILD_ROOT/usr/local/bin 目标,而 make 难以置信不太可能实际上知道如何构建(因此导致 make 无法构建它并给你一个错误)。删除 -p 将帮助您看到 make 吐出的实际错误,因为它不会同时吐出规则数据库内容。

认为你的意思是mkdir -p。 (它应该作为 %{__mkdir_p} 宏可用。)

关于bash - RPM 构建错误 :Bad exit status from/var/tmp/rpm-tmp. 32XJLX (%install),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27340598/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com