Tim Hawes <tim%easyfreeunix.com@localhost> writes: > I know Jython is in wip, but it's broken, in fact it has been broken > for over a year now. I have improvised in the past, but now I want to > create the package myself. Great - it's always good to have more people working on wip. > It uses a java installer, so there is no compiling. But for some > reason it installs bin/jython with m=0644 instead of m=0755 > > The unpacked file has the proper permissions. > > I get the same problem from the package under wip. The problem appears > to have something to do with this line: > > do-install: > ${INSTALL_DATA} ${TMPJYTHON}/jython ${DESTDIR}${PREFIX}/bin Yes, INSTALL_DATA means it's a data file, so 644 is correct. > It seems right that I change this to INSTALL_SCRIPT, however, when I > do that, I get: So that's progress, but: > ERROR: [check-interpreter.mk] The interpreter "/usr/bin/env" of > "/usr/pkgsrc/mk/work/local/jython/work/.destdir/usr/pkg/bin/jython" is > not allowed. > *** Error code 1 So when you set it to INSTALL_SCRIPT, then pkgsrc checks a lot more things for errors, and finds trouble > yes, that /usr/bin/env is the interpreter on that and all the scripts > in the package. I get warnings for all the other scripts. So that's a bug in the upstream code, from the pkgsrc viewpoint. The basic issue is that scripts need to bind at packaging time to the interpreter that is depended on by the package. For python this means /usr/pkg/bin/python2.7 or something like that (depending on version), but not "#!/usr/bin/env python". For many scripts, the incantation is to use REPLACE_INTERPRETER in the Makefile. So it seems that jython is trying to substitute the interpreter path, but it's putting in the path to the wrkdir/destdir version, not the eventually installed version. > The other problem I am having is that the installer sets this inside > the jython script: > JYTHON_HOME_FALLBACK="/usr/pkgsrc/mk/work/local/jython/work/temp.jython" > I need to set it to /usr/pkg/lib/java/jython indeed, that sounds right. > Its ok, to hardcode this default, as it can be overridden by setting > JYTHON_HOME, I just need this to work out of the box for my mindless > sysadmins, when they start installing software on our servers. sure - this should be substituted via ${PREFIX} so that pkgsrc installs not to /usr/pkg will be right. So I think you should either: figure out the config/substitute process in the build, or figure out how to REPLACE_* fix up the paths in the binaries that get installed I'd look in the guide about REPLACE and at other makefiles for examples. I am unclear on exactly what you need to do, but I hope this points you in the right direction.
Attachment:
pgpudYabhPmfP.pgp
Description: PGP signature