In the scripted package builds in build.inc, if there is no existing prototype file for the package, one is created from the output files using pkgproto. pkgproto is able to handle symlinks, and for relative ones it outputs a line like:
s none /usr/local/bin/awk=gawk
However this line causes the pkgmk tool (in this version) to put in the package an absolute symlink to /gawk which will not work and is not what we want.
Note that for symlinks the prototype file determines the destination of symlink; pkgmk does not use the actual symlink file in the DESTDIR or similar as input.
It's possible to get a relative symlink by changing the line in the prototype to e.g.
s none /usr/local/bin/awk=./gawk
This will create a symlink to ./gawk, which is not exactly the same, but works fine in the majority of cases.
I've changed all the existing prototype files, but it would be good to update the script to ensure that prototype files generated automatically for new stuff in the future get corrected automatically.
A modern sed oneliner to start with (assumes no dotifles):
sed -i 's/^\(s none [^=]*=\)\([^/.].*\)/\1\.\/\2/'
In the scripted package builds in
build.inc
, if there is no existingprototype
file for the package, one is created from the output files usingpkgproto
.pkgproto
is able to handle symlinks, and for relative ones it outputs a line like:However this line causes the
pkgmk
tool (in this version) to put in the package an absolute symlink to/gawk
which will not work and is not what we want.Note that for symlinks the
prototype
file determines the destination of symlink;pkgmk
does not use the actual symlink file in theDESTDIR
or similar as input.It's possible to get a relative symlink by changing the line in the
prototype
to e.g.This will create a symlink to
./gawk
, which is not exactly the same, but works fine in the majority of cases.I've changed all the existing
prototype
files, but it would be good to update the script to ensure thatprototype
files generated automatically for new stuff in the future get corrected automatically.A modern sed oneliner to start with (assumes no dotifles):