I have a question about rpm spec.
by jonjet from LinuxQuestions.org on (#5EMRP)
<Current spec specifications>
%define debug_package %{nil}
Name: thearmor
Version: 1.0.0
Release: 1%{?Dist}
Summary: A test package
Group: thearmor Package
License: GPL
URL: http://test.example.com
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmpath}/%{name}-%{version}-%{release}-root
%Description
Demo package for deployment of one single file
%prep
%setup -q
%pre
find /home/nfs/$USER -name 'thearmor*' | xargs rm -rf
%post
find /home/$USER/Desktop -name 'thearmor*.tar.gz' -exec tar -xvf {} -C /home/nfs/$USER \;
chown -R sychungsichung /home/nfs/$USER/thearmor
%build
#configure
#make %{? _smp_mflags}
%install
cp -r thearmor $RPM_BUILD_ROOT/usr/local/bin
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr (-,root,root,-)
#%doc
%attr(755,root,root)/usr/local/bin/thearmor
<The order of execution >
1. cd~
2. rpmbuild thearmor.spec
3. cp thearmor-1.0.tar.gz rpmbuild/SOURCES
4. cp thearmor.spec rpmbuild/SPESCS
5. cd rpmbuild/SPECS
6. rpmbuild --sign -ba thearmor.spec
<Error screen
+ umask 022
+ cd /home/sychung/rpmbuild/BUILD
+ cd /home/sychung/rpmbuild/BUILD
+ rm -rf thearmor-1.0.0
+ /usr/bin/gzip -dc /home/sychung/rpmbuild/SOURCES/thearmor-1.0.0.tar.gz
+ /usr/bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd thearmor-1.0.0
/var/tmp/rpm-tmp.T54OBf: line 35: cd: thearmor-1.0.0: No sum file or directory
Error: Bad exit status from /var/tmp/rpm-tmp.T54OBf (%prep)
Bad exit status from /var/tmp/rpm-tmp.T54OBf (%prep)
<Purpose>
When sending the file, thearmor.tar.gz
Compression Path:/home/sychung/Desktop copy, change permissions on the copied path (/home/nfs/sychung) and create an rpm package to minimize and automatically execute this operation.
How can I make it the way I want it to?


%define debug_package %{nil}
Name: thearmor
Version: 1.0.0
Release: 1%{?Dist}
Summary: A test package
Group: thearmor Package
License: GPL
URL: http://test.example.com
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmpath}/%{name}-%{version}-%{release}-root
%Description
Demo package for deployment of one single file
%prep
%setup -q
%pre
find /home/nfs/$USER -name 'thearmor*' | xargs rm -rf
%post
find /home/$USER/Desktop -name 'thearmor*.tar.gz' -exec tar -xvf {} -C /home/nfs/$USER \;
chown -R sychungsichung /home/nfs/$USER/thearmor
%build
#configure
#make %{? _smp_mflags}
%install
cp -r thearmor $RPM_BUILD_ROOT/usr/local/bin
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr (-,root,root,-)
#%doc
%attr(755,root,root)/usr/local/bin/thearmor
<The order of execution >
1. cd~
2. rpmbuild thearmor.spec
3. cp thearmor-1.0.tar.gz rpmbuild/SOURCES
4. cp thearmor.spec rpmbuild/SPESCS
5. cd rpmbuild/SPECS
6. rpmbuild --sign -ba thearmor.spec
<Error screen
+ umask 022
+ cd /home/sychung/rpmbuild/BUILD
+ cd /home/sychung/rpmbuild/BUILD
+ rm -rf thearmor-1.0.0
+ /usr/bin/gzip -dc /home/sychung/rpmbuild/SOURCES/thearmor-1.0.0.tar.gz
+ /usr/bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd thearmor-1.0.0
/var/tmp/rpm-tmp.T54OBf: line 35: cd: thearmor-1.0.0: No sum file or directory
Error: Bad exit status from /var/tmp/rpm-tmp.T54OBf (%prep)
Bad exit status from /var/tmp/rpm-tmp.T54OBf (%prep)
<Purpose>
When sending the file, thearmor.tar.gz
Compression Path:/home/sychung/Desktop copy, change permissions on the copied path (/home/nfs/sychung) and create an rpm package to minimize and automatically execute this operation.
How can I make it the way I want it to?