错误退出状态从/var/tmp/rpm-tmp.ajKra4(%prep) [英] Bad exit status from /var/tmp/rpm-tmp.ajKra4 (%prep)
问题描述
我有一个奇怪的RPM问题,我是新的它,所以忍受我...我有spec文件创建,当我运行做生成我得到一个错误:
/var/tmp/rpm-tmp.ajKra4:第36行:cd:hero-01:没有这样的文件或目录
错误:退出状态从/ var / tmp / rpm-tmp .ajKra4(%prep)
然后我检查临时文件,它试图CD到一个不存在的目录..如果它是在规范中创建文件?
$ b
总结:安装英雄
名称:hero
版本:01
发布:1
组:记帐报告
来源:%{name} - %{version} .tar。 gz
许可证:SLA
%description
英语计费报告系统
%预备
rm -rf%{_ topdir} / BUILD / *
%setup
%install
mkdir -p / opt /%{name}
cp -r * / opt /%{name}
%post
find / opt /%{name} -type d -exec chmod 755 {} \;
find / opt /%{name} -type f -exec chmod 644 {} \;
chmod -R 755 / opt /%{name} / bin
%files
/ opt /%{name}
%defattr( - ,root,root,0755)
%clean
rm -rf $ RPM_BUILD_ROOT
%postun
rm -rf / %{name}
也许我错过了什么?不会是第一个lol,谢谢
这也是tmp文件输出的内容:
#!/ bin / sh
RPM_SOURCE_DIR =/ root / rpmbuild / SOURCES
RPM_BUILD_DIR =/ root / 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 =hero
RPM_PACKAGE_VERSION =01
RPM_PACKAGE_RELEASE =1
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
LANG = C
export LANG
unset CDPATH DISPLAY ||:
RPM_BUILD_ROOT =/ root / rpmbuild / BUILDROOT / hero-01-1.x86_64
export RPM_BUILD_ROOT
PKG_CONFIG_PATH =/ usr / lib64 / pkgconfig:/ usr / share / pkgconfig
export PKG_CONFIG_PATH
set -x
umask 022
cd/ root / rpmbuild / BUILD
rm -rf / root / rpmbuild / BUILD / *
cd'/ root / rpmbuild / BUILD'
rm -rf'hero-01'
/ usr / bin / gzip -dc'/root/rpmbuild/SOURCES/hero-01.tar.gz'| / bin / tar -xvvf -
STATUS = $?
if [$ STATUS -ne 0];那么
退出$ STATUS
fi
cd'hero-01'
/ bin / chmod -Rf a + rX,u + w,g-w,o-w。
exit 0
http://www.rpm.org/max-rpm/s1-rpm-inside -macros.html ,特别是-n - Build目录的名称部分。
%setup宏在取消tar之后是期望的。 gz,会有一个hero-01目录可用,但是你的hero-01.tar.gz可能会创建一些其他目录名,可能是一个没有版本包含在名称中。
因此,例如,如果在解压后的/ root / rpmbuild / BUILD中有一个hero目录而不是hero-01目录,那么更新spec文件以使用'%setup -n hero'只是'%setup'。
I am having a weird RPM issue, I am new to it so bear with me... I have the spec file created and when I run to do the build I get an error:
/var/tmp/rpm-tmp.ajKra4: line 36: cd: hero-01: No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.ajKra4 (%prep)
Then I check that temp file and it is trying to CD to a directory that does not exist.. Should it be creating this in the spec file? if so where?
Here is my spec file:
Summary: Install Hero
Name: hero
Version: 01
Release: 1
Group: Billing reporting
Source: %{name}-%{version}.tar.gz
License: SLA
%description
Hero billing reports system
%prep
rm -rf %{_topdir}/BUILD/*
%setup
%install
mkdir -p /opt/%{name}
cp -r * /opt/%{name}
%post
find /opt/%{name} -type d -exec chmod 755 {} \;
find /opt/%{name} -type f -exec chmod 644 {} \;
chmod -R 755 /opt/%{name}/bin
%files
/opt/%{name}
%defattr(-,root,root,0755)
%clean
rm -rf $RPM_BUILD_ROOT
%postun
rm -rf /opt/%{name}
Perhaps I am missing something? Would not be the first lol, thanks
Here is also what that tmp file is outputting:
#!/bin/sh
RPM_SOURCE_DIR="/root/rpmbuild/SOURCES"
RPM_BUILD_DIR="/root/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="hero"
RPM_PACKAGE_VERSION="01"
RPM_PACKAGE_RELEASE="1"
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
LANG=C
export LANG
unset CDPATH DISPLAY ||:
RPM_BUILD_ROOT="/root/rpmbuild/BUILDROOT/hero-01-1.x86_64"
export RPM_BUILD_ROOT
PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/share/pkgconfig"
export PKG_CONFIG_PATH
set -x
umask 022
cd "/root/rpmbuild/BUILD"
rm -rf /root/rpmbuild/BUILD/*
cd '/root/rpmbuild/BUILD'
rm -rf 'hero-01'
/usr/bin/gzip -dc '/root/rpmbuild/SOURCES/hero-01.tar.gz' | /bin/tar -xvvf -
STATUS=$?
if [ $STATUS -ne 0 ]; then
exit $STATUS
fi
cd 'hero-01'
/bin/chmod -Rf a+rX,u+w,g-w,o-w .
exit 0
Check out http://www.rpm.org/max-rpm/s1-rpm-inside-macros.html, specifically the "-n — Set Name of Build Directory" section.
The %setup macro is expecting that after untaring the tar.gz, there will be a hero-01 directory available, but your hero-01.tar.gz probably creates some other directory name, probably one without the version included in the name.
So, for example, if there's a 'hero' directory instead of a 'hero-01' directory in /root/rpmbuild/BUILD after the untarring, then update the spec file to use '%setup -n hero' instead of just '%setup'.
这篇关于错误退出状态从/var/tmp/rpm-tmp.ajKra4(%prep)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!