You can use /snap/<snapname>/current/ instead of $SNAP. At least from inside the snap's runtime environment that should always point to the current install base. It's not ideal, but it's at least a predictable path you know at build time.
Michael Hall mhall...@ubuntu.com On 01/10/2017 12:16 PM, Jin Hsieh wrote: > Hello All, > > We are trying to snap up a mail server, > by referring to the design of a popular solution, > there are several services need to be packaged as parts. > > The major one is the postfix, > it uses an install script to deploy the built binary, > libraries and the configuration files, > the problem here is it assigns an absolute path when installing: > https://github.com/jindallo/postfix/blob/master/postfix-install#L446 > it's a trouble in snap world since my goal is pushing them into $SNAP > properly, > however, in the Build phase of my parts it does not know the path $SNAP. > > I tried to deploy it by stage-packages directly but no luck for such the > complicated service, > the configuration path is hardcoded on the pre-compiled binary. > https://github.com/jindallo/iredmail-snap/blob/master/snapcraft.yaml > Besides give the postfix source a hack to do getenv for $SNAP in compiling, > do you guys have any idea or any tricks on this to make it works could > share with us? > > Many thanks. > > BR. > Jin > > -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft