Hello.
I have to modify a *.spec file before recreating a rpm file because I need vendor name when the package is installed.
I have an error in the last step ( calling rpmbuild ) after directories are create and files are copied into the right folders.
From the tar file ( project_name-version_number.tar.bz2 ) I get all the stuff in :
~/project_name-version_number
~/project_name-version_number/doc
~/project_name-version_number/src
~/project_name-version_number/test
~/project_name.spec
In ~/project_name-version_number directory are the makefile., configure., libtools
First :
I modify project_name.spec by adding :
%define vendor vendor_name
and after other macro definitions
Vendor: %{vendor}
this spec file contains :
%define name project_name
%define version version_number
%define release release_number
%define major major_number
then
I use a macro file “.rpmmacros” which contain :
%_topdir /tmp/rpmbuild/project_name/rpm
this redirect all the files in
/tmp/rpmbuild/project_name/rpm/BUILD
/tmp/rpmbuild/project_name/rpm/SOURCE
/tmp/rpmbuild/project_name/rpm/SPECS
/tmp/rpmbuild/project_name/rpm/RPMS
/tmp/rpmbuild/project_name/rpm/SRPMS
and then
I use a shell file which delete and recreate all directories,
from /tmp/rpmbuild/project_name/rpm/SOURCE
copy all files from ~/project_name-version_number
cp ~/project_name-version_number/*
/tmp/rpmbuild/project_name/rpm/SOURCE/project_name-version_number
there is no project_name.spec file in that directory
from /tmp/rpmbuild/project_name/rpm/SOURCE
tar -cvjf /tmp/rpmbuild/project_name/rpm/SOURCE/project_name-version_number.tar.bz2
/tmp/rpmbuild/project_name/rpm/SOURCE/project_name-version_number
cp ~/project_name.spec /tmp/rpmbuild/project_name/rpm/SPECS
Then call
rpmbuild -ba /tmp/rpmbuild/project_name/rpm/SPECS/project_name.spec
Here is the error :
...............
no errors
..............
+ /usr/bin/bzip2 -dc /tmp/rpmbuild/project_name/rpm/SOURCES/project_name-project_numpber.tar.bz2
+ /bin/tar -xf -
+ STATUS=0
+ '' 0 -ne 0 ']'
+ cd project_name-project_number
/var/tmp/rpm-tmp.S6sP4v: line 32: cd: project_name-project_number: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.S6sP4v (%prep)
in /var/tmp/rpm-tmp.S6sv I can read
cd '/tmp/rpmbuild/project_name/rpm/BUILD'
rm -rf 'project_name-project_number'
/usr/bin/bzip2 -dc '/tmp/rpmbuild/project_name/rpm/SOURCES/project_name-project_number.tar.bz2' | /bin/tar -xf -
STATUS=$?
if $STATUS -ne 0 ]; then
exit $STATUS
fi
cd 'project_name-project_number'
There is no project_name-project_number in the directory /tmp/rpmbuild/project_name/rpm/BUILD
But there is a directory project_name
I think that rpmbuild using project_name.spec parameters use the directory project_name in /tmp/rpmbuild/project_name/rpm/BUILD instead of project_name-project_number
Assistance would be welcome.