QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 840|回复: 0

关于RPM打包时spec文件的问题。

[复制链接]
发表于 2005-12-8 15:23:06 | 显示全部楼层 |阅读模式
Summary: GNU myproj
Name: myproj
Version: 1.0.0
Release: 1
Source: %{name}-%{version}.tar.gz
License: GPL
Group: Development/Tools
%description
The GNU indent program reformats C code to any of a variety of
formatting standards, or you can define your own.
%prep
%setup -q -n %{name}-%{version}
%build
./configure
make
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/usr/local/bin/myrpoj
%doc COPYING AUTHORS README NEWS


这是我的SPEC文件内容,我的myproj-1.0.0.tar.gz已经放在/usr/src/redhat/SOURCES/目录下了。
当我执行rpmbuild -ba myproj.spec时出现以下错误,请各位大侠指点。

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.19174
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ $'\r'
: command not found174: line 24:
error: Bad exit status from /var/tmp/rpm-tmp.19174 (%prep)


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

rpm-tmp.19174文件的内容如下:
#!/bin/sh

  RPM_SOURCE_DIR="/usr/src/redhat/SOURCES"
  RPM_BUILD_DIR="/usr/src/redhat/BUILD"
  RPM_OPT_FLAGS="-O2 -g -pipe -march=i386 -mcpu=i686"
  RPM_ARCH="i386"
  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="myproj"
  RPM_PACKAGE_VERSION="1.0.0"
  RPM_PACKAGE_RELEASE="1"
  export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
  
  
  
  set -x
  umask 022
  cd /usr/src/redhat/BUILD
LANG=C
export LANG
unset DISPLAY

cd /usr/src/redhat/BUILD
rm -rf myproj-1.0.0
/usr/bin/gzip -dc /usr/src/redhat/SOURCES/myproj-1.0.0.tar.gz | tar -xf -
STATUS=$?
if [ $STATUS -ne 0 ]; then
  exit $STATUS
fi
cd myproj-1.0.0
[ `/usr/bin/id -u` = '0' ] && /bin/chown -Rhf root .
[ `/usr/bin/id -u` = '0' ] && /bin/chgrp -Rhf root .
/bin/chmod -Rf a+rX,u+w,g-w,o-w .

exit 0

我的OS的版本是
Fedora Core release 2 (Tettnang)
Kernel 2.6.5-1.358 on an i686
您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-3 02:25 , Processed in 0.038339 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表