我想创建一个执行以下操作的rpm软件包:
设置时:
将脚本复制到rpm
将文件解压缩到rpm
运行时:
运行script.sh
运行提取到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 build过程中,%install
部分位于install文件中。在目标计算机上的安装过程中不会运行此部分。这是spec
文件的混乱部分。[C0的建立过程中(按此顺序):
rpm
期间(按此顺序):rpm
部分中的文件)%files
更多说明:
rpm
,/home
或类似的东西(在/usr
下指定/*
时,您要打包整个树)%files
目录中的文件。软件包是在系统范围内安装的,因此,仅打包通用目录(例如/home
,/etc
,...