Customize debian.postinst on build time

I need to modify the contents of a debian.postinst script so that it acts differently according to where the compilation took place.

In an out of OBS solution I did that by writting some stuff in debian.rules so that .postinst changes. When I do so in OBS, the debian.postinst that gets archived into the final .deb remains the same (I understand it gets packaged before/after doing the build steps specified in debian.rules)

Maybe my approach is wrong somehow. Simplifying, what I want is:
Let’s say I’m packaging my app for Ubuntu12 and Debian8.
when someone installs myAppUbuntu12.deb I’d like to have a file that says “compiled in Ubuntu”, even though the he is installing the .deb in his Debian8 (for some weird reason).

Can anyone help?