why? The easiest thing to do is build a Universal application, at some (usually small cost) to the user in disk space.
If you really must do this, you'll need to read up on the documentation for installers: https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW7
and consult the man pages for pkgbuild and/or productbuild.
Somewhere in there, you'll probably find that you can restrict what is installed based on arch.
Topic:
App & System Services
SubTopic:
Core OS
Tags: