我build立了一个基于spec文件的简单的rpm,但是我的目标是在我通过rpm -Uvh安装rpm之后,就是把test.sh文件放在/ home目录下,请指出我需要在spec文件中进行更改以便把我的安装rpm后的test.sh?
备注:在/ usr / src / redhat / SOURCES下定义的test.sh
[root@linux /usr/src/redhat]# ls BUILD RPMS SOURCES SPECS SRPMS [root@linux /usr/src/redhat]# ls SOURCES test.sh [root@linux /usr/src/redhat/SPECS]# more my_spec.spec Summary: An example tool. To show a simple rpm build of the tool. Name: test.sh Version: 6.2 Release: 2 Source: /root/test.sh URL: http://www.gnomovision.com/cdplayer/cdplayer.html Group: Development/Debuggers BuildRoot:/var/test.sh License: OtherLicense %description %files [root@linux /usr/src/redhat/SPECS]# rpm -ba /usr/src/redhat/SPECS/my_spec.spec Processing files: test.sh-6.2-2 Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/test.sh Wrote: /root/rpmbuild/SRPMS/test.sh-6.2-2.src.rpm Wrote: /root/rpmbuild/RPMS/i386/test.sh-6.2-2.i386.rpm [root@linux /usr/src/redhat/SPECS]# rpm -Uvh /root/rpmbuild/RPMS/i386/test.sh-6.2- 2.i386.rpm Preparing... ########################################### [100%] 1:test.sh ########################################### [100%] [root@linux /usr/src/redhat]# rpm2cpio /root/rpmbuild/RPMS/i386/test.sh-6.2-2.i386.rpm | cpio -idmv 1 block ( I dont get the test.sh file?)
那么,你需要一个安装步骤,您将脚本复制到主目录的东西,没有testing!
%install rm -rf %{buildroot} mkdir -p %{buildroot}/home cp %SOURCE0 %{buildroot}/home %file /home/test.sh