I'm trying to build a debian package for a program that uses mono. My
make install target currently puts all of my binaries
/usr/local/lib/mypackage, then creates a tiny executable script in
/usr/local/bin that invokes the actual binaries with mono. I use a one-liner to replace the placeholder
PREFIX with the actual install path:
install: DESTDIR=/usr/local install: LIBDIR=$(DESTDIR)/lib install: BINDIR=$(DESTDIR)/bin install: $(PHONIX) $(ANTLR) doc install -m 0755 -d $(LIBDIR)/phonix install -m 0755 -t $(LIBDIR)/phonix $(PHONIX) $(ANTLER) install -m 0755 -D phonix.sh $(BINDIR)/phonix sed -i "s!PREFIX!$(LIBDIR)!" $(BINDIR)/phonix
When I'm running under
$(BINDIR) point to the packaging directory as desired. Everything gets installed into the right place for the packager, but the
sed call puts the path of my local packaging directory into the script, which then gets placed verbatim in the package. This obviously doesn't work once I actually install the package on the target system.
I think that I need to move the
sed call into the post-install script, but I'm not sure how to get the local install directory (the moral equivalent of my
$(BINDIR)) in the post-install step. Or is there a better way altogether to do this?
Edit: Here's my actual
phonix.shfile, before sed is called:
#!/usr/bin/sh exec mono PREFIX/phonix.exe
As you can see, the only purpose of this file is to provide an executable wrapper for the mono-based .exe. The sed call just replaces
PREFIX with the value of
$(LIBDIR). So all I really need to know is how can I get the actual installed location of my .exe on the target system so that the wrapper script works?