Build it in your Minera system, then copy the binary "cgminer" to /var/www/minera/minera-bin/custom directory (with a different name like cgminer-gridseed), go to the settings page and enable it under "Custom miner".
Finally you have to setup it with this option: --gridseed-options=baud=115200,freq=800,chips=5,modules=1,usefifo=0,btc=16