Linux %在CentOS 7上构建RPM时的准备问题
以下是网上甚至网上的所有随机指南: Centos 7似乎不起任何作用(令人惊讶!) 如果将%prep保留在spec文件中,rpmbuild将尽最大努力进行配置和制作。我不确定。 这是一个超级基本的.spec文件,我正在尝试制作一个rpm,以便在文件中进行复制Linux %在CentOS 7上构建RPM时的准备问题,linux,rpmbuild,centos7,Linux,Rpmbuild,Centos7,以下是网上甚至网上的所有随机指南: Centos 7似乎不起任何作用(令人惊讶!) 如果将%prep保留在spec文件中,rpmbuild将尽最大努力进行配置和制作。我不确定。 这是一个超级基本的.spec文件,我正在尝试制作一个rpm,以便在文件中进行复制 $more newpackage.spec Name: hello Version: 1.2 Release: 1%{?dist} Summary: Testing testing 1 2 3 License: Beer URL: N
$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这两个行。一切正常这是RPM的一个真正的PITA错误。
%build
是“注释掉”的,但它仍在扩展,因此实际上您只注释掉了宏的第一行!要将其注释掉,您需要将其设置为:#%%build
以退出%
。