Discussion:
rpm as non root user
Adam Miller
2007-12-18 19:08:57 UTC
Permalink
Hi,
I'm trying to allow a non root user build rpms and having a bit of
trouble.

created ~/.rpmmacros

%packager testlscsoft
%_topdir /home/testlscsoft
%_rpmtopdir /home/testlscsoft/usr/src/redhat
%_builddir /home/testlscsoft/usr/src/redhat/BUILD
%_rpmdir /home/testlscsoft/usr/src/redhat/RPMS
%_sourcedir /home/testlscsoft/usr/src/redhat/SOURCES
%_specdir /home/testlscsoft/usr/src/redhat/SPECS
%_srcrpmdir /home/testlscsoft/usr/src/redhat/SRPMS
%_tmppath /home/testlscsoft/usr/src/redhat/var/tmp
%_buildroot /home/testlscsoft/usr/src/redhat/var/tmp/%{name}-root


created dir structures

/home/testlscsoft
/home/testlscsoft/usr/src/redhat
/home/testlscsoft/usr/src/redhat/BUILD
/home/testlscsoft/usr/src/redhat/RPMS
/home/testlscsoft/usr/src/redhat/SOURCES
/home/testlscsoft/usr/src/redhat/SPECS
/home/testlscsoft/usr/src/redhat/SRPMS
/home/testlscsoft/usr/src/redhat/var/tmp


installed src rpm

rpm --root /home/testlscsoft/ -Uvh lscsoft-user-env-1.12-1.src.rpm


fails when running rpmbuild

rpmbuild --root /home/testlscsoft/ -ba /home/testlscsoft/usr/src/redhat/SPECS/lscsoft-user-env.spec
error: File /usr/src/redhat/SOURCES/lscsoft-user-env-1.12.tar.gz: No such file or directory


It seems to be ignoring the --root option and looking in the systems rpm
directories.

Any thoughts/suggestions/remarks would be appreciated.

Thanks
Adam Miller
Jos Vos
2007-12-18 19:45:48 UTC
Permalink
Post by Adam Miller
I'm trying to allow a non root user build rpms and having a bit of
trouble.
This is all way too complex, you shouldn't use --root or define all
those variables, %_topdir is enough. Just do (for example):

Put in ~/.rpmmacros (only):

%_topdir /home/testlscsoft/rpm

Then use the following commands:

mkdir -p /home/testlscsoft/rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
rpm -ivh lscsoft-user-env-1.12-1.src.rpm
cd /home/testlscsoft/rpm/SPECS
rpm -ba lscsoft-user-env.spec
--
-- Jos Vos <***@xos.nl>
-- X/OS Experts in Open Systems BV | Phone: +31 20 6938364
-- Amsterdam, The Netherlands | Fax: +31 20 6948204
Tony Earnshaw
2007-12-18 19:56:48 UTC
Permalink
Post by Adam Miller
I'm trying to allow a non root user build rpms and having a bit of
trouble.
created ~/.rpmmacros
%packager testlscsoft
[...]
Post by Adam Miller
%_topdir /home/testlscsoft
All the rest is crap, set it up properly.

Try it out!

Below %_topdir should be the five necessary main
directories/architectures (and even then, not even the architecture is
necessary).

[...]
Post by Adam Miller
%_rpmtopdir /home/testlscsoft/usr/src/redhat
%_builddir /home/testlscsoft/usr/src/redhat/BUILD
%_rpmdir /home/testlscsoft/usr/src/redhat/RPMS
%_sourcedir /home/testlscsoft/usr/src/redhat/SOURCES
%_specdir /home/testlscsoft/usr/src/redhat/SPECS
%_srcrpmdir /home/testlscsoft/usr/src/redhat/SRPMS
%_tmppath /home/testlscsoft/usr/src/redhat/var/tmp
%_buildroot /home/testlscsoft/usr/src/redhat/var/tmp/%{name}-root
created dir structures
/home/testlscsoft
/home/testlscsoft/usr/src/redhat
/home/testlscsoft/usr/src/redhat/BUILD
/home/testlscsoft/usr/src/redhat/RPMS
/home/testlscsoft/usr/src/redhat/SOURCES
/home/testlscsoft/usr/src/redhat/SPECS
/home/testlscsoft/usr/src/redhat/SRPMS
/home/testlscsoft/usr/src/redhat/var/tmp
installed src rpm
rpm --root /home/testlscsoft/ -Uvh lscsoft-user-env-1.12-1.src.rpm
fails when running rpmbuild
rpmbuild --root /home/testlscsoft/ -ba
/home/testlscsoft/usr/src/redhat/SPECS/lscsoft-user-env.spec
error: File /usr/src/redhat/SOURCES/lscsoft-user-env-1.12.tar.gz: No such file or directory
--Tonni
--
Tony Earnshaw
Email: tonni at hetnet dot nl
Adam Miller
2007-12-18 20:51:30 UTC
Permalink
Hi,

Thanks all, I've now got it working.

The problem was that I was missing the "s" in the filename rpmmacros.

Adam
Post by Tony Earnshaw
Post by Adam Miller
I'm trying to allow a non root user build rpms and having a bit of
trouble.
created ~/.rpmmacros
%packager testlscsoft
[...]
Post by Adam Miller
%_topdir /home/testlscsoft
All the rest is crap, set it up properly.
Try it out!
Below %_topdir should be the five necessary main directories/architectures
(and even then, not even the architecture is necessary).
[...]
Post by Adam Miller
%_rpmtopdir /home/testlscsoft/usr/src/redhat
%_builddir /home/testlscsoft/usr/src/redhat/BUILD
%_rpmdir /home/testlscsoft/usr/src/redhat/RPMS
%_sourcedir /home/testlscsoft/usr/src/redhat/SOURCES
%_specdir /home/testlscsoft/usr/src/redhat/SPECS
%_srcrpmdir /home/testlscsoft/usr/src/redhat/SRPMS
%_tmppath /home/testlscsoft/usr/src/redhat/var/tmp
%_buildroot /home/testlscsoft/usr/src/redhat/var/tmp/%{name}-root
created dir structures
/home/testlscsoft
/home/testlscsoft/usr/src/redhat
/home/testlscsoft/usr/src/redhat/BUILD
/home/testlscsoft/usr/src/redhat/RPMS
/home/testlscsoft/usr/src/redhat/SOURCES
/home/testlscsoft/usr/src/redhat/SPECS
/home/testlscsoft/usr/src/redhat/SRPMS
/home/testlscsoft/usr/src/redhat/var/tmp
installed src rpm
rpm --root /home/testlscsoft/ -Uvh lscsoft-user-env-1.12-1.src.rpm
fails when running rpmbuild
rpmbuild --root /home/testlscsoft/ -ba
/home/testlscsoft/usr/src/redhat/SPECS/lscsoft-user-env.spec
error: File /usr/src/redhat/SOURCES/lscsoft-user-env-1.12.tar.gz: No such
file or directory
--Tonni
Loading...