gpt4 book ai didi

linux - 临时文件中的 rpmbuild 错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:57:08 24 4
gpt4 key购买 nike

我对 RPM 和 RPM 构建完全陌生。

这是我得到的错误:

[impulse@localhost SPECS]$ rpmbuild -bp pa_connector.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.71097
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ $'\r'
: command not found097: line 27:
error: Bad exit status from /var/tmp/rpm-tmp.71097 (%prep)


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

我不确定该临时文件是如何或何时创建的,也不确定它的用途。如果有人也能为我澄清这一点,我将不胜感激!

这是我的规范文件:

Summary:  PA_Connector
Name: PA_Connector
Provides: PA_Connector
Version: 1.0
Release: 1.0
License: GPLv2+ and LGPLv2+
Group: System Environment/Daemons
URL: http://www.impulse.com/

Source: pa_connector.tar.gz

%define initddir %{?_initddir:%{_initddir}}%{!?_initddir:%{_initrddir}}
%define scriptdir ./script\\\ src
%define installdir $RPM_BUILD_ROOT/opt/pa_connector
%define libdir %{installdir}/lib
%define builddir %{installdir}/build
%define configdir config


#BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

#BuildRequires: ant

%description
Testing PA building

%prep
%setup -q -n PA_Connector -c PA_Connector pa_connector

%build
# Right now no build is really taking place, the build.xml file is executed first.
/usr/bin/ant -Djava.io.tmpdir=/tmp/PA_CONNECTOR-CORE-JOB1 -f build.xml jar

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p %{installdir}
install -D -m 755 %{scriptdir}/pa_connector $RPM_BUILD_ROOT/%{initddir}/pa_connector
install -D -m 755 %{scriptdir}/pa_connector.sh %{installdir}/pa_connector.sh
install -D -m 644 %{configdir}/config.xml %{installdir}/config.xml
install -D -m 644 %{configdir}/log4j.properties %{installdir}/log4j.properties
install -D -d lib %{libdir}
install -D -m 644 pa_connector.jar %{libdir}/pa_connector.jar
install -D -m 644 lib/commons-logging-1.1.1.jar %{libdir}/commons-logging-1.1.1.jar
install -D -m 644 lib/log4j-1.2.17.jar %{libdir}/log4j-1.2.17.jar


%clean
rm -rf $RPM_BUILD_ROOT

# Make sure our user/group is present prior to any package or subpackage installation
%pre
if [ $1 -eq 1 ];then #Install
getent group impulse >/dev/null || /usr/sbin/groupadd -r -g 500 impulse > /dev/null 2>&1
getent passwd impulse >/dev/null || /usr/sbin/useradd -r -g impulse -u 500 -c "impulse user" -s /sbin/nologin impulse > /dev/null 2>&1
elif [ $1 -eq 2 ];then #Upgrade
# Stop the service before upgrading
/sbin/service pa_connector stop &> /dev/null
fi
exit 0

%files
%defattr(-,root,root)
%{initddir}/pa_connector
%dir %attr(755,impulse,impulse) /opt/pa_connector
attr(755,impulse,impulse) /opt/pa_connector/pa_connector.sh
%dir %attr(755,impulse,impulse) /opt/pa_connector/lib
attr(644,impulse,impulse) /opt/pa_connector/lib/pa_connector.jar
attr(644,impulse,impulse) /opt/pa_connector/lib/commons-logging-1.1.1.jar
attr(644,impulse,impulse) /opt/pa_connector/lib/log4j-1.2.17.jar
attr(644,impulse,impulse) /opt/pa_connector/log4j.properties
attr(644,impulse,impulse) /opt/pa_connector/config.xml

压缩包包含以下内容:

[impulse@localhost SPECS]$ tar -tvf ../SOURCES/pa_connector.tar.gz
drwxr-xr-x root/root 0 2013-04-05 16:24:52 pa_connector/
drwxr-xr-x root/root 0 2013-03-29 14:22:33 pa_connector/lib/
-rwxr-xr-x root/root 489883 2013-03-29 14:22:33 pa_connector/lib/log4j-1.2.17.jar
-rwxr-xr-x root/root 60841 2013-03-29 14:22:33 pa_connector/lib/commons-logging-1.1.1.jar
drwxr-xr-x root/root 0 2013-03-29 14:22:33 pa_connector/src/
drwxr-xr-x root/root 0 2013-03-29 14:22:33 pa_connector/src/com/
drwxr-xr-x root/root 0 2013-03-29 14:22:33 pa_connector/src/com/impulse/
drwxr-xr-x root/root 0 2013-03-29 14:22:33 pa_connector/src/com/impulse/connector/
drwxr-xr-x root/root 0 2013-03-29 14:22:34 pa_connector/src/com/impulse/connector/paloalto/
-rw-r--r-- root/root 2389 2013-03-29 14:22:34 pa_connector/src/com/impulse/connector/paloalto/AuthDeltaBroker.java
... etc

如有任何帮助,我们将不胜感激!

最佳答案

我能够修复它。这个错误不断出现的原因是因为我最初是在 Windows 文本编辑器上创建我的规范文件的,该编辑器插入了那些回车符。我在 CentOS 盒子上重新制作了文件,现在可以正常工作了。希望对遇到此问题的其他人有所帮助!

关于linux - 临时文件中的 rpmbuild 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15879973/

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