Ticket #25041 (reopened defect)
rpmbuild uses /opt/local/var/tmp
| Reported by: | noahcampbell@… | Owned by: | n3npq@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 1.8.2 |
| Keywords: | Cc: | peter_e@… | |
| Port: | rpm |
Description (last modified by macsforever2000@…) (diff)
rpmbuild tries to access a directory that doesn't exist.
noahc-mbp:modules noahcampbell$ rpm --eval %_tmppath /opt/local/var/tmp
On my machine (fairly new) this directory doesn't exist. The work around is to great it and provide my user access to write to it.
I believe this is related to the compilation of rpmbuild given my CentOS machine reports the %_tmppath to be /var/tmp
Change History
comment:1 Changed 3 years ago by macsforever2000@…
- Owner changed from macports-tickets@… to n3npq@…
- Description modified (diff)
comment:2 Changed 3 years ago by afb@…
- Status changed from new to closed
- Resolution set to worksforme
You can change the default %_tmppath (in ~/.rpmmacros) if you don't want to build as root.
In the same place you can also change %_topdir from the default /opt/local/src/macports...
comment:3 follow-up: ↓ 4 Changed 3 years ago by noahcampbell@…
- Status changed from closed to reopened
- Resolution worksforme deleted
I guess my point was more about the defaults in rpmbuild, not so much how to change it. OOTB, rpmbuild won't work for a non-root user because it's compiled to depend on a directory that doesn't exist. If the path is correct in terms of proper path requirements for MacPorts, then either the port "spec" file should create the directory the build should depend on a different path.
comment:4 in reply to: ↑ 3 ; follow-up: ↓ 5 Changed 3 years ago by afb@…
OOTB, rpmbuild won't work for a non-root user
That is correct. But /opt/local/var/tmp will be created during the first (root) run, if needed.
So this seems more about running rpmbuild as non-root, than about missing directories ?
comment:5 in reply to: ↑ 4 Changed 3 years ago by noahcampbell@…
Replying to afb@…:
So this seems more about running rpmbuild as non-root, than about missing directories ?
Yeah, I'd say that's accurate...I'm wasn't aware that the directory would be created if run as root. Due to my (mis?)understanding that you shouldn't use rpmbuild as root, I never tried it.
comment:6 Changed 3 years ago by afb@…
MacPorts was doing all package building (see port rpm portname...) as root, mostly since it was running in a chroot anyway...
The default macro config for the old rpm is:
%_tmppath %{_var}/tmp
%_topdir %{_usrsrc}/rpm
Where "rpm" replaced the previous "%_vendor".
If you want to use rpmbuild for building your own packages, you will need to change configuration. Including %_topdir and %_tmppath.
Then again if you want to use RPM for building things outside of MacPorts, you might also want to use a release slightly newer than 2007.

