I build a simple rpm based on spec file but my target is after I installed the rpm by rpm -Uvh , is to put the test.sh file under /home directory, please advice what I need to change in the spec file in order to put the test.sh after I installed the rpm ?
remark: test.sh defined under /usr/src/redhat/SOURCES
[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?)
Well, you need an install step where you copy the script to the home directory something like that, not tested !