创建用于解压缩文件的rpm包

问题描述 投票:-2回答:2

我想创建一个执行以下操作的rpm软件包:

设置时:

  1. 将脚本复制到rpm

  2. 将文件解压缩到rpm

运行时:

  1. 运行script.sh

  2. 运行提取到rpm中的install文件

当用户运行rpm时,应该执行2和3,因为rpm中已经存在文件。

我知道如何进行设置,*。spec文件为:

%description
# lets skip this for now

%prep
# lets skip this for now

%build
# lets skip this for now

%install
cd ${RPM_BUILD_ROOT}
cp -v /home/methuselah/script.sh ${RPM_BUILD_ROOT}
tar xvpf /home/methuselah/bin.tar
chmod 775 -R ${RPM_BUILD_ROOT}/*

%files
/*

%changelog
* Tue Jan 28 2014 Pavel Šimerda  - 3.0.9-14
- Resolves: #1052814 - rsync command is terminated with SIGSEGV
- Resolves: #1052814 - add missing patch file

我不确定执行rpm时运行的实际安装步骤在哪里。您能帮忙吗?

rpm rpm-spec
2个回答
3
投票
在[[rpm build root]]中的

rpm build过程中,%install部分位于install文件中。在目标计算机上的安装过程中不会运行此部分。这是spec文件的混乱部分。[C0的建立过程中(按此顺序):

    %prep
  • %build
  • %install
  • %check
  • [安装rpm期间(按此顺序):

    %pre
  • ((实际安装:安装了rpm部分中的文件)
  • %post
  • 注意:%files

更多说明:

    两个this page on the full rpm scripts order不能拥有相同的文件/文件夹,因此请确保您不打包rpm/home或类似的东西(在/usr下指定/*时,您要打包整个树)
  • 不要打包用户%files目录中的文件。软件包是在系统范围内安装的,因此,仅打包通用目录(例如/home/etc,...
  • )中的文件

1
投票
也许您想将文件(script.sh和bin.tar)放在“%files”部分下,并用%install保留所有安装。
© www.soinside.com 2019 - 2024. All rights reserved.