Discussion:
How do I change the tmppath
Linux
2008-04-11 18:42:56 UTC
Permalink
_______________________________________________
Rpm-list mailing list
Rpm-***@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
Panu Matilainen
2008-04-16 21:25:52 UTC
Permalink
How do I change the tmp path that RPM uses? I am trying to build the RPM
in my local user account but bases it off of root ('/'). With my own
macros, I change the tmp path, during the build process, I can echo the
tmp path and see that I changed it but it always adds '/' in the front.
For example, if I set the path to ./my_temp, it becomes /./my_temp.
One reason for the change, is I did a build and it put it in /tmp (not
./tmp). Well it failed and left the structure in /tmp/package-1.0.3. A
co-worker started a build on the same computer but was prevented from
doing the build since I owned /tmp/package-1.0.3. He had to wait until I
deleted the directory tree in /tmp
Yup, the commonly used "BuildRoot: %{_tmppath}/%{name}-%{version}"
and variants dont work very well in multiuser environment.
Just put something like this into ~/.rpmmacros to make your builds
private:

%_tmppath %(echo $HOME)/tmp/

- Panu -
Valery Reznic
2008-04-17 05:34:18 UTC
Permalink
How do I change the tmp path that RPM uses? I am
trying to build the RPM
in my local user account but bases it off of root
('/'). With my own
macros, I change the tmp path, during the build
process, I can echo the
tmp path and see that I changed it but it always
adds '/' in the front.
For example, if I set the path to ./my_temp, it
becomes /./my_temp.
One reason for the change, is I did a build and it
put it in /tmp (not
./tmp). Well it failed and left the structure in
/tmp/package-1.0.3. A
co-worker started a build on the same computer but
was prevented from
doing the build since I owned /tmp/package-1.0.3.
He had to wait until I
deleted the directory tree in /tmp
%{_tmppath}/%{name}-%{version}"
and variants dont work very well in multiuser
environment.
Just put something like this into ~/.rpmmacros to
make your builds
%_tmppath %(echo $HOME)/tmp/
In my specfiles I use
Buildroot: %{_builddir}/%{_buildsubdir}-install-root
So it can be built in the multiuser environment
without
changing anyones ~/.rpmmacros

Valery.
- Panu -
_______________________________________________
Rpm-list mailing list
https://www.redhat.com/mailman/listinfo/rpm-list
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
devzero2000
2008-04-17 09:08:00 UTC
Permalink
Or, perhaps better, in ~/.rpmmacros put this lines

%_topdir %(echo $HOME)/rpmbuild
%_tmppath %{_topdir}/tmp
%_buildroot %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
#
# the latter it is creating all the rpm type(arch,noarch) under
%{_topdir}/RPMS (e.g. the
default exansion of the rpm macros %{_rpmdir} : look at
rpm --eval '%{_rpmdir}' after you have done the above modificatiion on
~/.rpmmacros )


Then

mkdir -p $HOME/rpmbuild/{SRPMS,RPMS,BUILD,SPECS,tmp}

hth
How do I change the tmp path that RPM uses? I am trying to build the RPM
in my local user account but bases it off of root ('/'). With my own
macros, I change the tmp path, during the build process, I can echo the
tmp path and see that I changed it but it always adds '/' in the front.
For example, if I set the path to ./my_temp, it becomes /./my_temp.
One reason for the change, is I did a build and it put it in /tmp (not
./tmp). Well it failed and left the structure in /tmp/package-1.0.3. A
co-worker started a build on the same computer but was prevented from
doing the build since I owned /tmp/package-1.0.3. He had to wait until I
deleted the directory tree in /tmp
Yup, the commonly used "BuildRoot: %{_tmppath}/%{name}-%{version}" and
variants dont work very well in multiuser environment.
Just put something like this into ~/.rpmmacros to make your builds
%_tmppath %(echo $HOME)/tmp/
- Panu -
_______________________________________________
Rpm-list mailing list
https://www.redhat.com/mailman/listinfo/rpm-list
Michael Jennings
2008-04-17 16:12:54 UTC
Permalink
On Thursday, 17 April 2008, at 11:08:00 (+0200),
Post by devzero2000
Or, perhaps better, in ~/.rpmmacros put this lines
%_topdir %(echo $HOME)/rpmbuild
%_tmppath %{_topdir}/tmp
%_buildroot %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
^^^^^^^^^^^^^^^^

Do not use this. Despite its proliferation in Fedora, it is not
portable. It is also completely unnecessary in the above example
(since %{_tmppath} is already user- and build-specific) or in any
properly-written build tool.

Michael
--
Michael Jennings (a.k.a. KainX) http://www.kainx.org/ <***@kainx.org>
Linux Server/Cluster Admin, LBL.gov Author, Eterm (www.eterm.org)
-----------------------------------------------------------------------
"Kyrie eleison down the road that I must travel. Kyrie eleison
through the darkness of the night. Kyrie eleison; where I'm going,
will you follow?" -- Mr. Mister, "Kyrie"
devzero2000
2008-04-17 16:50:38 UTC
Permalink
Right

was a bad cut-and-paste, in effect in my .rpmmacros the buildroot is
prefixed by a #.

Sorry for the error.

Regards
Post by Michael Jennings
On Thursday, 17 April 2008, at 11:08:00 (+0200),
Post by devzero2000
Or, perhaps better, in ~/.rpmmacros put this lines
%_topdir %(echo $HOME)/rpmbuild
%_tmppath %{_topdir}/tmp
%_buildroot %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u}
-n)
^^^^^^^^^^^^^^^^
Do not use this. Despite its proliferation in Fedora, it is not
portable. It is also completely unnecessary in the above example
(since %{_tmppath} is already user- and build-specific) or in any
properly-written build tool.
Michael
--
Linux Server/Cluster Admin, LBL.gov Author, Eterm (www.eterm.org)
-----------------------------------------------------------------------
"Kyrie eleison down the road that I must travel. Kyrie eleison
through the darkness of the night. Kyrie eleison; where I'm going,
will you follow?" -- Mr. Mister, "Kyrie"
_______________________________________________
Rpm-list mailing list
https://www.redhat.com/mailman/listinfo/rpm-list
Loading...