【问题标题】:%prep problems when building RPMs on CentOS 7在 CentOS 7 上构建 RPM 时出现 %prep 问题
【发布时间】:2015-04-25 15:12:38
【问题描述】:

遵循网络上的所有随机指南,甚至在这里: What is the minimum I have to do to create an RPM file?

Centos 7 似乎无法使用(惊喜!)

似乎如果你在你的规范文件中保留 %prep,rpmbuild 会尽最大努力去 ./configure 做一些事情。我不确定。 这是一个超级基本的 .spec 文件,我正在尝试制作一个 rpm 以复制到一个文件中。

$more newpackage.spec 

Name: hello
Version: 1.2
Release: 1%{?dist}
Summary: Testing testing 1 2 3
License: Beer
URL: No
#so apparently now you have to have version numbers everywhere, even the tar files, uhg
Source0: hello-1.2.tar.gz
#and the breaking begins :-( why everything broke with you centos 7?
# BuildRoot: %{_tmppath}/%{name}-%{version}-root
# BuildRequires:
# Requires:
%description
nothing to see here folks


#well here is some of the confusion
#%prep
%setup -q

# ./configure missing? um yeahhhh
# %build
# %configure
# make %{?_smp_mflags}

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}


%files
#/usr/bin/hello.sh
%{_bindir}/hello.sh

# %doc


# %changelog

在 tar 文件中是 /usr/bin/hello.sh 这是只运行 echo "hello world" 的 shell 脚本

如果我评论 %prep rpmbuild 抱怨 ./configure 未找到。

rpmbuild -v -bb newpackage.spec

【问题讨论】:

    标签: linux rpmbuild centos7


    【解决方案1】:

    看起来注释掉 %build 并不能真正阻止 rpmbuild 尝试构建源代码... 因此,如果我删除了 %build 和 %configure 以及那一行。一切正常

    【讨论】:

    • 这是一个真正的 RPM PITA 错误。 %build 被“注释掉”,但它仍在扩展,所以您实际上只注释掉了宏的第一行!要将其注释掉,您需要将其设为:# %%build 以避开 %
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-07-03
    • 2016-08-18
    • 1970-01-01
    • 1970-01-01
    • 2020-11-19
    • 1970-01-01
    • 2017-11-04
    相关资源
    最近更新 更多