Saya perlu saran tentang hal berikut
Saya membuat file spec sederhana dan membangun rpm
Saya mentransfer rpm baru ke mesin Linux lain untuk menginstal rpm baru
sesuai dengan file spesifikasi rpm baru - & gt; test.sh-6.2-2.i386.rpm harus membuat / tmp / MY_RPM_TESTS direktori, tetapi rpm ini tidak membuat MY_RPM_TESTS dan sub direktori tolong saran mengapa, apa yang harus saya perbaiki dalam file spesifikasi?
Instalasi RPM:
[root@linux1 rpm -Uvh /root/rpmbuild/RPMS/i386/test.sh-6.2-2.i386.rpm
Preparing... ########################################### [100%]
This is preinstall script
Linux linux 2.6.18-164.2.1.el5PAE #1 SMP Mon Sep 21 04:45:05 EDT 2009 i686 i686 i386 GNU/Linux
1:test.sh ########################################### [100%]
Linux linux 2.6.18-164.2.1.el5PAE #1 SMP Mon Sep 21 04:45:05 EDT 2009 i686 i686 i386 GNU/Linux
Now we wait for sleep
100
[root@linux1 ls /tmp
preinstall_dir
file SPEC saya:
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
Source0: /root/test.sh
Source1: /root/urim.sh
Group: Development/Debuggers
BuildRoot:/tmp/MY_RPM_TESTS
License: OtherLicense
%description
%pre -p /bin/ksh
print "This is preinstall script"
uname -a
rm -rf /tmp/preinstall_dir
mkdir /tmp/preinstall_dir
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}
mkdir -p %{buildroot}/home
mkdir -p %{buildroot}/home/home1
cp %SOURCE0 %{buildroot}/home
cp %SOURCE0 %{buildroot}/home/home1
cp %SOURCE1 %{buildroot}/home
%files
/home/test.sh
/home/home1/test.sh
/home/urim.sh
%post -p /bin/ksh
uname -a
print "Now we wait for sleep" ; sleep 1
NUM=100
print $NUM
Bangun rpm:
[root@linux /usr/src/redhat/SPECS]# rpm -ba /usr/src/redhat/SPECS/my_spec.spec
Executing(%install): /bin/sh -e /root/rpmbuild/tmp/rpm-tmp.83360
+ umask 022
+ cd /root/rpmbuild/BUILD
+ rm -rf /tmp/MY_RPM_TESTS
+ mkdir -p /tmp/MY_RPM_TESTS
+ mkdir -p /tmp/MY_RPM_TESTS/home
+ mkdir -p /tmp/MY_RPM_TESTS/home/home1
+ cp /root/rpmbuild/SOURCES/test.sh /tmp/MY_RPM_TESTS/home
+ cp /root/rpmbuild/SOURCES/test.sh /tmp/MY_RPM_TESTS/home/home1
+ cp /root/rpmbuild/SOURCES/urim.sh /tmp/MY_RPM_TESTS/home
+ /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: test.sh-6.2-2
Requires(interp): /bin/ksh /bin/ksh
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib (PayloadFilesHavePrefix) <= 4.0-1
Requires(pre): /bin/ksh
Requires(post): /bin/ksh
Checking for unpackaged file(s): /usr/lib/rpm/check-files /tmp/MY_RPM_TESTS
Wrote: /root/rpmbuild/SRPMS/test.sh-6.2-2.src.rpm
Wrote: /root/rpmbuild/RPMS/i386/test.sh-6.2-2.i386.rpm