gpt4 book ai didi

linux - 找到已安装(但未打包)的文件

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

我想使用此规范文件创建 RPM 包:

Name: some-agent
Version: 1.0
Release: 1%{?dist}
Summary: Linux Agent installation script

Group: Utilities
License: license

Source0: some-agent-1.0.tar.gz
BuildArch: x86_64
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)


%description

%prep

%build
%install
mkdir -p %{buildroot}/opt/agent
#install -m 0755 -d $RPM_BUILD_ROOT/opt/agent
cp -a * %{buildroot}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%dir
/opt/agent

%defattr(-,root,root,-)
%doc
%changelog

我运行这个命令:

user@laptop ~]$ 
[user@laptop ~]$ rpmbuild -bb -v ~/rpm/SPECS/kernel.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.f1O2AV
+ umask 022
+ cd /home/rcbandit/rpm/BUILD
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.ozgVAb
+ umask 022
+ cd /home/rcbandit/rpm/BUILD
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.SrwYCr
+ umask 022
+ cd /home/rcbandit/rpm/BUILD
+ mkdir -p /home/rcbandit/rpm/BUILDROOT/some-agent-1.0-1.el6.x86_64/opt/agent
+ cp -a some-agent-1.0.tar.gz /home/rcbandit/rpm/BUILDROOT/some-agent-1.0-1.el6.x86_64
+ /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip
+ /usr/lib/rpm/brp-strip-static-archive
+ /usr/lib/rpm/brp-strip-comment-note
Processing files: some-agent-1.0-1.el6.x86_64
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/rcbandit/rpm/BUILDROOT/some-agent-1.0-1.el6.x86_64
error: Installed (but unpackaged) file(s) found:
/some-agent-1.0.tar.gz


RPM build errors:
Installed (but unpackaged) file(s) found:
/some-agent-1.0.tar.gz
[user@laptop ~]$ ^C
[user@laptop ~]$

我在 tar.gz 包中有一个 Java 文件,因此不需要任何编译,只需将文件解压到目标目录即可。

你能帮我解决这个问题吗?

最佳答案

您需要在(当前为空)%build 部分中提取这些文件,然后将 %install 部分中的它们复制到 %{buildroot} 下的目标位置。网络上有许多入门读物。

关于linux - 找到已安装(但未打包)的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31638267/

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