# $ARCH $OSVERSION not available for pkg-install in FreeBSD10



## bler (Apr 15, 2014)

I'm using two bsd.port.mk variables in packages created from a port - ${ARCH} and ${OSVERSION}. I use them in two places: post-extract and pkg-install script in exactly the same manner, that is arithmetic testing of ${OSVERSION} and creating a filename from the above two.

On FreeBSD 9.2 this works as expected. On FreeBSD 10 with pkgng, neither of the two variables are accessible in pkg-install script. In post-extract they still work fine. I could probably hack this, but as I stated in my previous post- I prefer civilized ways, if possible. 

So, is it a bug or a feature? And if it has to be that way, what's the best way to pass on arguments/parameters to pkg-install when it's run from Makefile (by overriding post-install target)? I've tried adding parameters to the shell command line, original being:

```
post-install:
@PKG_PREFIX=${STAGEDIR}${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
```

by adding something after POST-INSTALL and looking for that variable in $3 in pkg-install, but it seems that all arguments after $2 are cut off.

Thanks in advance,
ML


----------

