Opened 12 years ago
Closed 9 years ago
#37333 closed defect (invalid)
missing destroot and worksrcpath directories on destroot stage when creating binary + documentation port
Reported by: | garymamon@… | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.1.2 |
Keywords: | destroot | Cc: | |
Port: |
Description
I am trying to construct a port for a binary package plus documentation plus Makefile (for install), using MacPorts to force installation of dependent packages if missing. Because my package ("scamp") is already compiled (with a special compiler), my PortFile has:
use_configure no build {}
But after running:
% cd ~/ports; portindex; cd; sudo port clean scamp; sudo port uninstall scamp; sudo rm /opt/local/var/macports/distfiles/scamp/scamp-2.0b5.tbz2 ; sudo rm -rf /opt/local/var/macports/build/_Users_gam_ports_science_scamp/scamp; sudo port -v install scamp @2.0b5
after correct fetching, checksuming, extracting [from .tbz2 file], configuring, and building, I run into an error, whatever I try for the destroot stage in my Portfile. For example with (an empty)
destroot { puts "prefix = ${prefix}" puts "workpath = ${workpath}" puts "worksrcpath = ${worksrcpath}" puts "destroot = ${destroot}" }
I get
prefix = /opt/local workpath = /opt/local/var/macports/build/_Users_gam_ports_science_scamp/scamp/work worksrcpath = /opt/local/var/macports/build/_Users_gam_ports_science_scamp/scamp/work/scamp-2.0b5 destroot = /opt/local/var/macports/build/_Users_gam_ports_science_scamp/scamp/work/destroot Error: No files have been installed in the destroot directory! Error: Please make sure that this software supports 'make install DESTDIR=${destroot}' or implement an alternative destroot mechanism in the Portfile. Error: Files might have been installed directly into your system, check before proceeding. Error: org.macports.destroot for port scamp returned: Staging scamp into destroot failed
Now if I try
ls -l /opt/local/var/macports/build/_Users_gam_ports_science_scamp/scamp/work/scamp-2.0b5
or
ls -l /opt/local/var/macports/build/_Users_gam_ports_science_scamp/scamp/work/destroot
the directories do not exist! On the other hand, the workpath
directory exists and contains the root of the files I wish to have installed by the end user (i.e. Makefile, README, INSTALL, bin, doc, man...). Note that the Makefile has an install:
install: cp -R bin $(DESTDIR) mkdir -p $(DESTDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION) mkdir -p $(DESTDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)/share cp -R doc man [A-Z]* $(DESTDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)/share
Are these destroot issues normal or a bug in MacPorts? How can I work around them?
Attachments (3)
Change History (9)
Changed 12 years ago by garymamon@…
comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)
Your portfile tells MacPorts to do nothing at configure, build or destroot time, so logically, after MacPorts is done doing all those nothings, there is nothing in the destroot, about which MacPorts complains because all ports must install at least one file.
comment:2 follow-up: 3 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)
Running "make install" is what the standard destroot phase does. If you want MacPorts to do that, then don't replace the destroot phase with a no-op.
comment:3 Changed 12 years ago by garymamon@…
Replying to ryandesign@…:
Running "make install" is what the standard destroot phase does.
Many Thanks Ryan for your replies.
If you want MacPorts to do that, then don't replace the destroot phase with a no-op.
So what should I include in the destroot phase to have "make install" run?
I had also tried to modify my Makefile to force the installation directory to be opt/local/bin for the binaries and opt/local/share/scamp/ for the rest. But to no avail...
comment:4 follow-up: 5 Changed 12 years ago by lpsinger (Leo Singer)
FYI, there is already a port called "scamp", source:trunk/dports/science/scamp/Portfile.
comment:5 Changed 12 years ago by garymamon@…
Replying to aronnax@…:
FYI, there is already a port called "scamp", source:trunk/dports/science/scamp/Portfile.
Thank aronnax,
Although that port is for a much older version, the Portfile was useful to me. I realized that I had to add install -d
and copy
commands to the destroot phase (the Portfile in the example you mentioned had put similar commands in the post-destroot phase). I also realized that in the destroot stage, one should specify directories as ${destroot}${prefix} even if at the end the installation is in ${prefix}.
I wish the MacPorts documentation had been clearer on this issue!
So, I consider the problem solved.
comment:6 Changed 9 years ago by mf2k (Frank Schima)
Resolution: | → invalid |
---|---|
Status: | new → closed |
Portfile