gpt4 book ai didi

linux - 在 CentOS 7 上构建 RPM 时%prep 问题

转载 作者:太空宇宙 更新时间:2023-11-04 03:44:25 26 4
gpt4 key购买 nike

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

Centos 7 似乎不起作用(惊讶!)

如果你在规范文件中留下 %prep ,rpmbuild 将尽最大努力 ./configure 并进行一些操作。我不确定什么。这是一个 super 基本的 .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

最佳答案

看起来注释掉 %build 实际上并没有阻止 rpmbuild 尝试构建源代码...所以如果我删除 %build 和 %configure 就可以了。一切正常

关于linux - 在 CentOS 7 上构建 RPM 时%prep 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28688304/

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