Reputation: 5306
I'm in the process of developing a Portfile for my application and I'm running into problems during the destroot phase. According to the MacPorts guide, the destroot phase executes the following command:
make install DESTDIR=${destroot}
I think I may be misunderstanding how this is supposed to work in the Makefile. My application is very simple and the install rule only needs to copy a few directories to the DESTDIR
so it is specified as follows:
install:
cp -R bin $(DESTDIR)/bin
cp -R lib $(DESTDIR)/lib
cp -R cfg $(DESTDIR)/cfg
However, when I try to do a MacPort installation of my application, I get the following warnings:
---> Staging test into destroot
Warning: violation by /bin
Warning: violation by /lib
Warning: violation by /cfg
Warning: test violates the layout of the ports-filesystems!
How do I fix this? Am I misunderstanding how the DESTDIR
variable is used in the install rule or missing something altogether?
Upvotes: 0
Views: 240
Reputation: 26
The directories need to be put under DESTDIR as if you are starting at /.
, For example, instead of using $(DESTDIR)/bin
you should be using $(DESTDIR)/$(PREFIX)/bin
- where $(PREFIX)
is /opt/local
or whatever.
Upvotes: 1